Commit 38580983 authored by Michael R. Crusoe's avatar Michael R. Crusoe Committed by Michael R. Crusoe

riscv64 clang: doesn't support _Float16 or __fp16 properly yet

Fixes errors like

FAILED: test/x86/avx512/cast-emul-c (also load, loadu, max, min, permutexvar, reduce, set, setzero, set1, storeu, f16c)
clang-17  -o test/x86/avx512/cast-emul-c test/x86/avx512/cast-emul-c.p/cast.c.o -Wl,--as-needed -Wl,--no-undefined --target=riscv64-linux-gnu -Wl,--start-group -lm -Wl,--end-group
/usr/bin/riscv64-linux-gnu-ld: test/x86/avx512/cast-emul-c.p/cast.c.o: in function `simde_test_x86_assert_equal_f16x32_':
/opt/simde/riscv64-clang-17/../../../usr/local/src/simde/test/x86/avx512/test-avx512.h:14: undefined reference to `__truncsfhf2'

FAILED: test/x86/avx512/cmp-emul-c (also reduce)
clang-17  -o test/x86/avx512/cmp-emul-c test/x86/avx512/cmp-emul-c.p/cmp.c.o -Wl,--as-needed -Wl,--no-undefined --target=riscv64-linux-gnu -Wl,--start-group -lm -Wl,--end-group
/usr/bin/riscv64-linux-gnu-ld: test/x86/avx512/cmp-emul-c.p/cmp.c.o: in function `simde_mm512_cmp_ph_mask':
/opt/simde/riscv64-clang-17/../../../usr/local/src/simde/simde/x86/avx512/cmp.h:741: undefined reference to `__extendhfsf2'
/usr/bin/riscv64-linux-gnu-ld: /opt/simde/riscv64-clang-17/../../../usr/local/src/simde/simde/x86/avx512/cmp.h:741: undefined reference to `__extendhfsf2'
/usr/bin/riscv64-linux-gnu-ld: /opt/simde/riscv64-clang-17/../../../usr/local/src/simde/simde/x86/avx512/cmp.h:741: undefined reference to `__extendhfsf2'
/usr/bin/riscv64-linux-gnu-ld: /opt/simde/riscv64-clang-17/../../../usr/local/src/simde/simde/x86/avx512/cmp.h:741: undefined reference to `__extendhfsf2'
/usr/bin/riscv64-linux-gnu-ld: /opt/simde/riscv64-clang-17/../../../usr/local/src/simde/simde/x86/avx512/cmp.h:741: undefined reference to `__extendhfsf2'
/usr/bin/riscv64-linux-gnu-ld: test/x86/avx512/cmp-emul-c.p/cmp.c.o:/opt/simde/riscv64-clang-17/../../../usr/local/src/simde/simde/x86/avx512/cmp.h:741: more undefined references to `__extendhfsf2' follow
clang: error: linker command failed with exit code 1 (use -v to see invocation)
parent a39f2c3b
...@@ -467,6 +467,10 @@ ...@@ -467,6 +467,10 @@
#define SIMDE_ARCH_POWER_ALTIVEC_CHECK(version) (0) #define SIMDE_ARCH_POWER_ALTIVEC_CHECK(version) (0)
#endif #endif
#if defined(__riscv) && __riscv_xlen==64
# define SIMDE_ARCH_RISCV64
#endif
/* SPARC /* SPARC
<https://en.wikipedia.org/wiki/SPARC> */ <https://en.wikipedia.org/wiki/SPARC> */
#if defined(__sparc_v9__) || defined(__sparcv9) #if defined(__sparc_v9__) || defined(__sparcv9)
......
...@@ -65,7 +65,8 @@ SIMDE_BEGIN_DECLS_ ...@@ -65,7 +65,8 @@ SIMDE_BEGIN_DECLS_
* any ideas on how to improve it. If you do, patches are definitely * any ideas on how to improve it. If you do, patches are definitely
* welcome. */ * welcome. */
#if !defined(SIMDE_FLOAT16_API) #if !defined(SIMDE_FLOAT16_API)
#if !defined(__EMSCRIPTEN__) && !(defined(__clang__) && defined(SIMDE_ARCH_POWER)) && ( \ #if !defined(__EMSCRIPTEN__) && !(defined(__clang__) && defined(SIMDE_ARCH_POWER)) && \
!(defined(__clang__) && defined(SIMDE_ARCH_RISCV64)) && ( \
defined(SIMDE_X86_AVX512FP16_NATIVE) || \ defined(SIMDE_X86_AVX512FP16_NATIVE) || \
(defined(SIMDE_ARCH_X86_SSE2) && HEDLEY_GCC_VERSION_CHECK(12,0,0)) || \ (defined(SIMDE_ARCH_X86_SSE2) && HEDLEY_GCC_VERSION_CHECK(12,0,0)) || \
(defined(SIMDE_ARCH_AARCH64) && HEDLEY_GCC_VERSION_CHECK(7,0,0) && !defined(__cplusplus)) || \ (defined(SIMDE_ARCH_AARCH64) && HEDLEY_GCC_VERSION_CHECK(7,0,0) && !defined(__cplusplus)) || \
...@@ -79,7 +80,10 @@ SIMDE_BEGIN_DECLS_ ...@@ -79,7 +80,10 @@ SIMDE_BEGIN_DECLS_
#define SIMDE_FLOAT16_API SIMDE_FLOAT16_API_FLOAT16 #define SIMDE_FLOAT16_API SIMDE_FLOAT16_API_FLOAT16
#elif defined(__ARM_FP16_FORMAT_IEEE) && (defined(SIMDE_ARM_NEON_FP16) || defined(__ARM_FP16_ARGS)) #elif defined(__ARM_FP16_FORMAT_IEEE) && (defined(SIMDE_ARM_NEON_FP16) || defined(__ARM_FP16_ARGS))
#define SIMDE_FLOAT16_API SIMDE_FLOAT16_API_FP16 #define SIMDE_FLOAT16_API SIMDE_FLOAT16_API_FP16
#elif defined(__FLT16_MIN__) && (defined(__clang__) && (!defined(SIMDE_ARCH_AARCH64) || SIMDE_DETECT_CLANG_VERSION_CHECK(7,0,0))) #elif defined(__FLT16_MIN__) && \
(defined(__clang__) && \
(!defined(SIMDE_ARCH_AARCH64) || SIMDE_DETECT_CLANG_VERSION_CHECK(7,0,0)) \
&& !defined(SIMDE_ARCH_RISCV64))
#define SIMDE_FLOAT16_API SIMDE_FLOAT16_API_FP16_NO_ABI #define SIMDE_FLOAT16_API SIMDE_FLOAT16_API_FP16_NO_ABI
#else #else
#define SIMDE_FLOAT16_API SIMDE_FLOAT16_API_PORTABLE #define SIMDE_FLOAT16_API SIMDE_FLOAT16_API_PORTABLE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment