-
-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core/simd]: Write package documentation #4545
base: master
Are you sure you want to change the base?
Conversation
Probably caused by actions/upload-artifact#602 Possibly fixes odin-lang#4384
Co-authored-by: Feoramund <[email protected]>
Co-authored-by: Feoramund <[email protected]>
Do not memory map files; Windows cannot write to a file that is memory mapped. Write cache after llvm building. This ensures the cache won't have a false positive if llvm fails.
This returns the number of runes in a u16 slice
* Fix odin-lang#4508 for abs, min, max and the rest of the builtins. None of these segfault now: ```odin package bug main :: proc() { p :: proc() {} // _ = len(p()) // _ = cap(p()) // _ = size_of(p()) // _ = align_of(p()) // T :: struct {} // _ = offset_of(p()) // _ = offset_of(T, p()) // _ = offset_of(p(), foo) // _ = offset_of(p(), "") // _ = type_of(p()) // _ = type_info_of(p()) // _ = typeid_of(p()) // A: [4]int // _ = swizzle(p()) // :: proc(x: [N]T, indices: ..int) -> [len(indices)]T --- // _ = swizzle(A, p()) // :: proc(x: [N]T, indices: ..int) -> [len(indices)]T --- // _ = complex(p(), p()) // _ = quaternion(p(), p(), p(), p()) // _ = quaternion(w=p(), x=p(), y=p(), z=p()) // _ = real(p()) // _ = imag(p()) // _ = jmag(p()) // _ = kmag(p()) // _ = conj(p()) // _ = expand_values(p()) // _ = min(p()) // _ = max(p()) // _ = abs(p()) // _ = clamp(p(), p(), p()) // _ = soa_zip(p()) // _ = soa_unzip(p()) } ```
Co-authored-by: Laytan <[email protected]>
And also moved Windows file procs to `os_windows.odin`, in line with all the other platforms who didn't have a dedicated `file_<platform>.odin`
core/simd/simd.odin
Outdated
/* | ||
Check if SIMD is emulated on a target platform. | ||
|
||
This value is `true`, if the compile-time target has the hardware support for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value is `true`, if the compile-time target has the hardware support for | |
This value is `false`, if the compile-time target has the hardware support for |
core/simd/simd.odin
Outdated
|
||
This value is `true`, if the compile-time target has the hardware support for | ||
at 128-bit (or wider) SIMD. If the compile-time target lacks the hardware support | ||
for 128-bit SIMD, this value is `false`, and all SIMD operations will be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for 128-bit SIMD, this value is `false`, and all SIMD operations will be | |
for 128-bit SIMD, this value is `true`, and all SIMD operations will likely be |
Co-authored-by: Laytan <[email protected]>
+-------+-------+-------+-------+ | ||
res: | ||
+-------+-------+-------+--------+ | ||
| 0x44 | 0xaa | 0x06 | 0xfe | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay this one I have to refuse, I was assuming 1-byte lanes, which I should probably make explicit in the comments.
core/simd/simd.odin
Outdated
/* | ||
Saturated addition of SIMD vectors. | ||
|
||
The *saturated sum* is a sum, that upon overflow or underflow, instead of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I should rewrite this.
core/simd/simd.odin
Outdated
res := simd.gather(ptrs, defaults, mask) | ||
fmt.println(res) | ||
|
||
The code would print `<2, 127, 10, 127>`. First and the third positions came |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are indented with a tab. Thanks for Output:
tip!
Co-authored-by: Laytan <[email protected]>
+------+------+------+------+ | ||
| 0 | 1 | 0.33 | 0.2 | | ||
+------+------+------+------+ | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1/0
may not result in 0
. That's a poor example.
Did some fixes, I think this one's ready for the final review. |
No description provided.