mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
@(require_target_feature=<string>) @(enable_target_feature=<string>)
require_target_feature - required by the target micro-architecture enable_target_feature - will be enabled for the specified procedure only
This commit is contained in:
@@ -4,36 +4,47 @@ package simd_x86
|
||||
import "core:intrinsics"
|
||||
import "core:simd"
|
||||
|
||||
@(enable_target_feature="sse3")
|
||||
_mm_addsub_ps :: #force_inline proc "c" (a, b: __m128) -> __m128 {
|
||||
return addsubps(a, b)
|
||||
}
|
||||
@(enable_target_feature="sse3")
|
||||
_mm_addsub_pd :: #force_inline proc "c" (a: __m128d, b: __m128d) -> __m128d {
|
||||
return addsubpd(a, b)
|
||||
}
|
||||
@(enable_target_feature="sse3")
|
||||
_mm_hadd_pd :: #force_inline proc "c" (a: __m128d, b: __m128d) -> __m128d {
|
||||
return haddpd(a, b)
|
||||
}
|
||||
@(enable_target_feature="sse3")
|
||||
_mm_hadd_ps :: #force_inline proc "c" (a, b: __m128) -> __m128 {
|
||||
return haddps(a, b)
|
||||
}
|
||||
@(enable_target_feature="sse3")
|
||||
_mm_hsub_pd :: #force_inline proc "c" (a: __m128d, b: __m128d) -> __m128d {
|
||||
return hsubpd(a, b)
|
||||
}
|
||||
@(enable_target_feature="sse3")
|
||||
_mm_hsub_ps :: #force_inline proc "c" (a, b: __m128) -> __m128 {
|
||||
return hsubps(a, b)
|
||||
}
|
||||
@(enable_target_feature="sse3")
|
||||
_mm_lddqu_si128 :: #force_inline proc "c" (mem_addr: ^__m128i) -> __m128i {
|
||||
return transmute(__m128i)lddqu(mem_addr)
|
||||
}
|
||||
@(enable_target_feature="sse3")
|
||||
_mm_movedup_pd :: #force_inline proc "c" (a: __m128d) -> __m128d {
|
||||
return simd.shuffle(a, a, 0, 0)
|
||||
}
|
||||
@(enable_target_feature="sse3")
|
||||
_mm_loaddup_pd :: #force_inline proc "c" (mem_addr: [^]f64) -> __m128d {
|
||||
return _mm_load1_pd(mem_addr)
|
||||
}
|
||||
@(enable_target_feature="sse3")
|
||||
_mm_movehdup_ps :: #force_inline proc "c" (a: __m128) -> __m128 {
|
||||
return simd.shuffle(a, a, 1, 1, 3, 3)
|
||||
}
|
||||
@(enable_target_feature="sse3")
|
||||
_mm_moveldup_ps :: #force_inline proc "c" (a: __m128) -> __m128 {
|
||||
return simd.shuffle(a, a, 0, 0, 2, 2)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user