mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 14:18:47 +00:00
Move simd.IS_EMULATED to runtime.SIMD_IS_EMULATED
This commit is contained in:
@@ -16,6 +16,11 @@ RUNTIME_REQUIRE :: false // !ODIN_TILDE
|
|||||||
@(private)
|
@(private)
|
||||||
__float16 :: f16 when __ODIN_LLVM_F16_SUPPORTED else u16
|
__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
|
||||||
|
|
||||||
@(private)
|
@(private)
|
||||||
byte_slice :: #force_inline proc "contextless" (data: rawptr, len: int) -> []byte #no_bounds_check {
|
byte_slice :: #force_inline proc "contextless" (data: rawptr, len: int) -> []byte #no_bounds_check {
|
||||||
|
|||||||
+2
-5
@@ -21,6 +21,7 @@ package simd
|
|||||||
|
|
||||||
import "base:builtin"
|
import "base:builtin"
|
||||||
import "base:intrinsics"
|
import "base:intrinsics"
|
||||||
|
import "base:runtime"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Check if SIMD is software-emulated on a target platform.
|
Check if SIMD is software-emulated on a target platform.
|
||||||
@@ -30,11 +31,7 @@ at 128-bit (or wider) SIMD. If the compile-time target lacks the hardware suppor
|
|||||||
for 128-bit SIMD, this value is `true`, and all SIMD operations will likely be
|
for 128-bit SIMD, this value is `true`, and all SIMD operations will likely be
|
||||||
emulated.
|
emulated.
|
||||||
*/
|
*/
|
||||||
IS_EMULATED :: true when (ODIN_ARCH == .amd64 || ODIN_ARCH == .i386) && !intrinsics.has_target_feature("sse2") else
|
IS_EMULATED :: runtime.SIMD_IS_EMULATED
|
||||||
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
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Vector of 16 `u8` lanes (128 bits).
|
Vector of 16 `u8` lanes (128 bits).
|
||||||
|
|||||||
Reference in New Issue
Block a user