mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-29 10:50:05 +00:00
Make simd_shuffle act closer to swizzle
This commit is contained in:
@@ -236,7 +236,7 @@ simd_reduce_and :: proc(a: #simd[N]T) -> T ---
|
||||
simd_reduce_or :: proc(a: #simd[N]T) -> T ---
|
||||
simd_reduce_xor :: proc(a: #simd[N]T) -> T ---
|
||||
|
||||
simd_shuffle :: proc(a, b: #simd[N]T, indices: #simd[max 2*N]u32) -> #simd[len(indices)]T ---
|
||||
simd_shuffle :: proc(a, b: #simd[N]T, indices: ..int) -> #simd[len(indices)]T ---
|
||||
simd_select :: proc(cond: #simd[N]boolean_or_integer, true, false: #simd[N]T) -> #simd[N]T ---
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -93,11 +93,11 @@ to_array_ptr :: #force_inline proc "contextless" (v: ^#simd[$LANES]$E) -> ^[LANE
|
||||
to_array :: #force_inline proc "contextless" (v: #simd[$LANES]$E) -> [LANES]E {
|
||||
return transmute([LANES]E)(v)
|
||||
}
|
||||
from_array :: #force_inline proc "contextless" (v: $A/[$LANES]$E) -> #simd[LANES]E where LANES & (LANES-1) == 0 {
|
||||
from_array :: #force_inline proc "contextless" (v: $A/[$LANES]$E) -> #simd[LANES]E {
|
||||
return transmute(#simd[LANES]E)v
|
||||
}
|
||||
|
||||
from_slice :: proc($T: typeid/#simd[$LANES]$E, slice: []E) -> T where LANES & (LANES-1) == 0 {
|
||||
from_slice :: proc($T: typeid/#simd[$LANES]$E, slice: []E) -> T {
|
||||
assert(len(slice) >= LANES, "slice length must be a least the number of lanes")
|
||||
array: [LANES]E
|
||||
#no_bounds_check for i in 0..<LANES {
|
||||
|
||||
Reference in New Issue
Block a user