Skip to content

Commit

Permalink
fix: Fix failed build on gcc-8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
howjmay committed Jan 27, 2024
1 parent 01cba29 commit feb0b6d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
16 changes: 10 additions & 6 deletions .ci/cross-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ if [ $(printenv CXX | grep clang) ]; then
exit
fi

set -x
set -e

make clean
export PATH=gcc-arm-${GCC_REL}-x86_64-aarch64-none-linux-gnu/bin:$PATH
make CROSS_COMPILE=aarch64-none-linux-gnu- check || exit 1 # ARMv8-A
wget -O gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf.tar.xz "https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.02/gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf.tar.xz?revision=ac15fd02-ba82-40dd-8b9a-8e5996988618&rev=ac15fd02ba8240dd8b9a8e5996988618&hash=347FC4F06948A4C49D8DFC6D847DC1AA090D3588"

tar Jxvf gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf.tar.xz

make clean
export PATH=gcc-arm-${GCC_REL}-x86_64-arm-none-linux-gnueabihf/bin:$PATH
make CROSS_COMPILE=arm-none-linux-gnueabihf- check || exit 1 # ARMv7-A
export PATH=gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf/bin:$PATH
make CROSS_COMPILE=arm-linux-gnueabihf- check || exit 1 # ARMv8-A

# make clean
# export PATH=gcc-arm-${GCC_REL}-x86_64-arm-none-linux-gnueabihf/bin:$PATH
# make CROSS_COMPILE=arm-none-linux-gnueabihf- check || exit 1 # ARMv7-A
2 changes: 1 addition & 1 deletion .ci/cross-tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
check_platform

sudo apt-get update -q -y
sudo apt-get install -q -y qemu-user
sudo apt-get install -q -y qemu-user wget

# Clang/LLVM is natively a cross-compiler, meaning that one set of programs
# can compile to all targets by setting the -target option.
Expand Down
8 changes: 4 additions & 4 deletions tests/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5580,17 +5580,17 @@ result_t test_mm_packus_epi16(const SSE2NEONTestImpl &impl, uint32_t iter)

uint8_t d[16];
for (int i = 0; i < 8; i++) {
if (_a[i] > (int16_t) max)
if (_a[i] > (uint16_t) max)
d[i] = max;
else if (_a[i] < (int16_t) min)
else if (_a[i] < (uint16_t) min)
d[i] = min;
else
d[i] = (uint8_t) _a[i];
}
for (int i = 0; i < 8; i++) {
if (_b[i] > (int16_t) max)
if (_b[i] > (uint16_t) max)
d[i + 8] = max;
else if (_b[i] < (int16_t) min)
else if (_b[i] < (uint16_t) min)
d[i + 8] = min;
else
d[i + 8] = (uint8_t) _b[i];
Expand Down

0 comments on commit feb0b6d

Please sign in to comment.