diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-11-22 09:43:40 +0000 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2025-11-22 09:43:40 +0000 |
| commit | adcbfb7861f23ad459b7652adc3c38c4c639ec8e (patch) | |
| tree | bd1bb755a3b9356fac26bf1c5890139e56035e97 /core/simd | |
| parent | 716449d6b32707e732a8af9b0fb3c575cd598faf (diff) | |
Add `@(require_results)` to `core:simd` procedures where missing
Diffstat (limited to 'core/simd')
| -rw-r--r-- | core/simd/simd.odin | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/simd/simd.odin b/core/simd/simd.odin index f065a3cec..14bf03f43 100644 --- a/core/simd/simd.odin +++ b/core/simd/simd.odin @@ -2636,6 +2636,7 @@ fma :: intrinsics.fused_mul_add /* Convert pointer to SIMD vector to an array pointer. */ +@(require_results) to_array_ptr :: #force_inline proc "contextless" (v: ^#simd[$LANES]$E) -> ^[LANES]E { return (^[LANES]E)(v) } @@ -2643,6 +2644,7 @@ to_array_ptr :: #force_inline proc "contextless" (v: ^#simd[$LANES]$E) -> ^[LANE /* Convert SIMD vector to an array. */ +@(require_results) to_array :: #force_inline proc "contextless" (v: #simd[$LANES]$E) -> [LANES]E { return transmute([LANES]E)(v) } @@ -2650,6 +2652,7 @@ to_array :: #force_inline proc "contextless" (v: #simd[$LANES]$E) -> [LANES]E { /* Convert array to SIMD vector. */ +@(require_results) from_array :: #force_inline proc "contextless" (v: $A/[$LANES]$E) -> #simd[LANES]E { return transmute(#simd[LANES]E)v } @@ -2657,6 +2660,7 @@ from_array :: #force_inline proc "contextless" (v: $A/[$LANES]$E) -> #simd[LANES /* Convert slice to SIMD vector. */ +@(require_results) 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 @@ -2689,6 +2693,7 @@ Example: | 0xff | 0xaf | 0x7f | 0x00 | +------+------+------+------+ */ +@(require_results) bit_not :: #force_inline proc "contextless" (v: $T/#simd[$LANES]$E) -> T where intrinsics.type_is_integer(E) { return bit_xor(v, T(~E(0))) } @@ -2696,6 +2701,7 @@ bit_not :: #force_inline proc "contextless" (v: $T/#simd[$LANES]$E) -> T where i /* Copy the signs from lanes of one SIMD vector into another SIMD vector. */ +@(require_results) copysign :: #force_inline proc "contextless" (v, sign: $T/#simd[$LANES]$E) -> T where intrinsics.type_is_float(E) { neg_zero := to_bits(T(-0.0)) sign_bit := to_bits(sign) & neg_zero @@ -2711,6 +2717,7 @@ This procedure returns a vector, each lane of which contains either +1.0 or input vector. If the lane of the input vector has NaN, then the result vector will contain this NaN value as-is. */ +@(require_results) signum :: #force_inline proc "contextless" (v: $T/#simd[$LANES]$E) -> T where intrinsics.type_is_float(E) { is_nan := lanes_ne(v, v) return select(is_nan, v, copysign(T(1), v)) @@ -2745,6 +2752,7 @@ Example: | 0.5 | 1 | 0.33 | 0.2 | +------+------+------+------+ */ +@(require_results) recip :: #force_inline proc "contextless" (v: $T/#simd[$LANES]$E) -> T where intrinsics.type_is_float(E) { return T(1) / v } |