diff options
| author | gingerBill <bill@gingerbill.org> | 2025-05-05 11:43:19 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2025-05-05 11:43:19 +0100 |
| commit | c4719e75fd1cc209b46ec3844110e1d87266c5d2 (patch) | |
| tree | feb3046e53d69abb66cfe92a8122222892cffc96 /core/simd | |
| parent | 36945079f8131973abb9e59bf642ab13c1c602be (diff) | |
Add `simd.indices` and docs
Diffstat (limited to 'core/simd')
| -rw-r--r-- | core/simd/simd.odin | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/simd/simd.odin b/core/simd/simd.odin index 37cc19ebd..0e69304c3 100644 --- a/core/simd/simd.odin +++ b/core/simd/simd.odin @@ -2510,3 +2510,17 @@ Example: recip :: #force_inline proc "contextless" (v: $T/#simd[$LANES]$E) -> T where intrinsics.type_is_float(E) { return T(1) / v } + + +/* +Create a vector where each lane contains the index of that lane. +Inputs: +- `V`: The type of the vector to create. +Result: +- A vector of the given type, where each lane contains the index of that lane. +**Operation**: + for i in 0 ..< N { + res[i] = i + } +*/ +indices :: intrinsics.simd_indices
\ No newline at end of file |