aboutsummaryrefslogtreecommitdiff
path: root/core
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 /core
parentedbd2479722fecef3adc647dfeaee8c09231f7c9 (diff)
Rename `SIMD_IS_EMULATED` to capability-affirmative `HAS_HARDWARE_SIMD`
Diffstat (limited to 'core')
-rw-r--r--core/bytes/bytes.odin4
-rw-r--r--core/crypto/_chacha20/simd128/chacha20_simd128.odin2
-rw-r--r--core/simd/simd.odin8
3 files changed, 7 insertions, 7 deletions
diff --git a/core/bytes/bytes.odin b/core/bytes/bytes.odin
index c0d25bcce..71b6ef70c 100644
--- a/core/bytes/bytes.odin
+++ b/core/bytes/bytes.odin
@@ -350,7 +350,7 @@ index_byte :: proc "contextless" (s: []byte, c: byte) -> (index: int) #no_bounds
}
c_vec: simd.u8x16 = c
- when !simd.IS_EMULATED {
+ when simd.HAS_HARDWARE_SIMD {
// Note: While this is something that could also logically take
// advantage of AVX512, the various downclocking and power
// consumption related woes make premature to have a dedicated
@@ -485,7 +485,7 @@ last_index_byte :: proc "contextless" (s: []byte, c: byte) -> int #no_bounds_che
}
c_vec: simd.u8x16 = c
- when !simd.IS_EMULATED {
+ when simd.HAS_HARDWARE_SIMD {
// Note: While this is something that could also logically take
// advantage of AVX512, the various downclocking and power
// consumption related woes make premature to have a dedicated
diff --git a/core/crypto/_chacha20/simd128/chacha20_simd128.odin b/core/crypto/_chacha20/simd128/chacha20_simd128.odin
index 6b37b8d61..4bf40e240 100644
--- a/core/crypto/_chacha20/simd128/chacha20_simd128.odin
+++ b/core/crypto/_chacha20/simd128/chacha20_simd128.odin
@@ -39,7 +39,7 @@ when ODIN_ARCH == .arm64 || ODIN_ARCH == .arm32 {
// Some targets lack runtime feature detection, and will flat out refuse
// to load binaries that have unknown instructions. This is distinct from
-// `simd.IS_EMULATED` as actually good designs support runtime feature
+// `simd.HAS_HARDWARE_SIMD` as actually good designs support runtime feature
// detection and that constant establishes a baseline.
//
// See:
diff --git a/core/simd/simd.odin b/core/simd/simd.odin
index c6c1e10a0..b4779b5ff 100644
--- a/core/simd/simd.odin
+++ b/core/simd/simd.odin
@@ -26,12 +26,12 @@ import "base:runtime"
/*
Check if SIMD is software-emulated on a target platform.
-This value is `false`, when the compile-time target has the hardware support for
-at 128-bit (or wider) SIMD. If the compile-time target lacks the hardware support
-for 128-bit SIMD, this value is `true`, and all SIMD operations will likely be
+This value is `true`, when the compile-time target has the hardware support for
+at least 128-bit (or wider) SIMD. If the compile-time target lacks the hardware support
+for 128-bit SIMD, this value is `false`, and all SIMD operations will likely be
emulated.
*/
-IS_EMULATED :: runtime.SIMD_IS_EMULATED
+HAS_HARDWARE_SIMD :: runtime.HAS_HARDWARE_SIMD
/*
Vector of 16 `u8` lanes (128 bits).