Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

flysand7
Copy link
Contributor

@flysand7 flysand7 commented Dec 1, 2024

No description provided.

core/simd/simd.odin Outdated Show resolved Hide resolved
core/simd/simd.odin Outdated Show resolved Hide resolved
core/simd/simd.odin Outdated Show resolved Hide resolved
core/simd/simd.odin Show resolved Hide resolved
core/simd/simd.odin Show resolved Hide resolved
core/simd/simd.odin Outdated Show resolved Hide resolved
core/simd/simd.odin Outdated Show resolved Hide resolved
core/simd/simd.odin Outdated Show resolved Hide resolved
core/simd/simd.odin Outdated Show resolved Hide resolved
core/simd/simd.odin Outdated Show resolved Hide resolved
core/simd/simd.odin Outdated Show resolved Hide resolved
core/simd/simd.odin Show resolved Hide resolved
core/simd/simd.odin Show resolved Hide resolved
core/simd/simd.odin Show resolved Hide resolved
}
return res

Example:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! I should fix this then. I haven't read your comments below, but it should be okay to surround the code block with text that describes what the example achieves, right? Otherwise I feel like the purpose of example is defeated, unless it's explained at least a little bit.

+-------+-------+-------+-------+
res:
+-------+-------+-------+--------+
| 0x44 | 0xaa | 0x06 | 0xfe |
Copy link
Contributor Author

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.

/*
Saturated addition of SIMD vectors.

The *saturated sum* is a sum, that upon overflow or underflow, instead of
Copy link
Contributor Author

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 Show resolved Hide resolved
res := simd.gather(ptrs, defaults, mask)
fmt.println(res)

The code would print `<2, 127, 10, 127>`. First and the third positions came
Copy link
Contributor Author

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!

core/simd/simd.odin Outdated Show resolved Hide resolved
@flysand7
Copy link
Contributor Author

flysand7 commented Jan 8, 2025

Did some fixes, I think this one's ready for the final review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants