@@ -16,11 +16,12 @@ RUNTIME_REQUIRE :: false // !ODIN_TILDE
1616@(private)
1717__float16 :: f16 when __ODIN_LLVM_F16_SUPPORTED else u16
1818
19- SIMD_IS_EMULATED :: true when (ODIN_ARCH == .amd64 || ODIN_ARCH == .i386) && !intrinsics.has_target_feature (" sse2" ) else
20- true when (ODIN_ARCH == .arm64 || ODIN_ARCH == .arm32) && !intrinsics.has_target_feature (" neon" ) else
21- true when (ODIN_ARCH == .wasm64p32 || ODIN_ARCH == .wasm32) && !intrinsics.has_target_feature (" simd128" ) else
22- true when (ODIN_ARCH == .riscv64) && !intrinsics.has_target_feature (" v" ) else
23- false
19+ HAS_HARDWARE_SIMD :: false when (ODIN_ARCH == .amd64 || ODIN_ARCH == .i386) && !intrinsics.has_target_feature (" sse2" ) else
20+ false when (ODIN_ARCH == .arm64 || ODIN_ARCH == .arm32) && !intrinsics.has_target_feature (" neon" ) else
21+ false when (ODIN_ARCH == .wasm64p32 || ODIN_ARCH == .wasm32) && !intrinsics.has_target_feature (" simd128" ) else
22+ false when (ODIN_ARCH == .riscv64) && !intrinsics.has_target_feature (" v" ) else
23+ true
24+
2425
2526@(private)
2627byte_slice :: #force_inline proc " contextless" (data: rawptr , len: int ) -> []byte #no_bounds_check {
@@ -241,7 +242,7 @@ memory_equal :: proc "contextless" (x, y: rawptr, n: int) -> bool {
241242 m := uint (0 )
242243
243244 if n >= 8 {
244- when !SIMD_IS_EMULATED {
245+ when HAS_HARDWARE_SIMD {
245246 // Avoid using 256-bit SIMD on platforms where its emulation is
246247 // likely to be less than ideal.
247248 when ODIN_ARCH == .amd64 && intrinsics.has_target_feature (" avx2" ) {
@@ -295,7 +296,7 @@ memory_compare :: proc "contextless" (x, y: rawptr, n: int) -> int #no_bounds_ch
295296 i := uint (0 )
296297 m := uint (0 )
297298
298- when !SIMD_IS_EMULATED {
299+ when HAS_HARDWARE_SIMD {
299300 when ODIN_ARCH == .amd64 && intrinsics.has_target_feature (" avx2" ) {
300301 m = n / 32 * 32
301302 for /**/ ; i < m; i += 32 {
@@ -364,7 +365,7 @@ memory_compare_zero :: proc "contextless" (a: rawptr, n: int) -> int #no_bounds_
364365 bytes := ([^]u8 )(a)
365366
366367 if n >= 8 {
367- when !SIMD_IS_EMULATED {
368+ when HAS_HARDWARE_SIMD {
368369 when ODIN_ARCH == .amd64 && intrinsics.has_target_feature (" avx2" ) {
369370 scanner32: #simd [32 ]u8
370371 m = n / 32 * 32
0 commit comments