aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorFeoramund <161657516+Feoramund@users.noreply.github.com>2025-05-29 17:17:51 -0400
committerFeoramund <161657516+Feoramund@users.noreply.github.com>2025-05-29 17:17:51 -0400
commit45219f240efdb5ced113ea10398abe864ee21632 (patch)
treee3452477549bb2172605620ad5b9e14b921d82f1 /base
parentedbd2479722fecef3adc647dfeaee8c09231f7c9 (diff)
Rename `SIMD_IS_EMULATED` to capability-affirmative `HAS_HARDWARE_SIMD`
Diffstat (limited to 'base')
-rw-r--r--base/runtime/internal.odin17
1 files changed, 9 insertions, 8 deletions
diff --git a/base/runtime/internal.odin b/base/runtime/internal.odin
index f51d01a9d..a35dbff8a 100644
--- a/base/runtime/internal.odin
+++ b/base/runtime/internal.odin
@@ -16,11 +16,12 @@ RUNTIME_REQUIRE :: false // !ODIN_TILDE
@(private)
__float16 :: f16 when __ODIN_LLVM_F16_SUPPORTED else u16
-SIMD_IS_EMULATED :: true when (ODIN_ARCH == .amd64 || ODIN_ARCH == .i386) && !intrinsics.has_target_feature("sse2") else
- true when (ODIN_ARCH == .arm64 || ODIN_ARCH == .arm32) && !intrinsics.has_target_feature("neon") else
- true when (ODIN_ARCH == .wasm64p32 || ODIN_ARCH == .wasm32) && !intrinsics.has_target_feature("simd128") else
- true when (ODIN_ARCH == .riscv64) && !intrinsics.has_target_feature("v") else
- false
+HAS_HARDWARE_SIMD :: false when (ODIN_ARCH == .amd64 || ODIN_ARCH == .i386) && !intrinsics.has_target_feature("sse2") else
+ false when (ODIN_ARCH == .arm64 || ODIN_ARCH == .arm32) && !intrinsics.has_target_feature("neon") else
+ false when (ODIN_ARCH == .wasm64p32 || ODIN_ARCH == .wasm32) && !intrinsics.has_target_feature("simd128") else
+ false when (ODIN_ARCH == .riscv64) && !intrinsics.has_target_feature("v") else
+ true
+
@(private)
byte_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 {
m := uint(0)
if n >= 8 {
- when !SIMD_IS_EMULATED {
+ when HAS_HARDWARE_SIMD {
// Avoid using 256-bit SIMD on platforms where its emulation is
// likely to be less than ideal.
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
i := uint(0)
m := uint(0)
- when !SIMD_IS_EMULATED {
+ when HAS_HARDWARE_SIMD {
when ODIN_ARCH == .amd64 && intrinsics.has_target_feature("avx2") {
m = n / 32 * 32
for /**/; i < m; i += 32 {
@@ -364,7 +365,7 @@ memory_compare_zero :: proc "contextless" (a: rawptr, n: int) -> int #no_bounds_
bytes := ([^]u8)(a)
if n >= 8 {
- when !SIMD_IS_EMULATED {
+ when HAS_HARDWARE_SIMD {
when ODIN_ARCH == .amd64 && intrinsics.has_target_feature("avx2") {
scanner32: #simd[32]u8
m = n / 32 * 32