-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Proposal: Rename SIMD vectors #7305
Comments
For the type itself, we can simply use the name |
Why not just call them SIMD registers? Would also give it some synergy with the |
You can do this, it behaves more like |
Huh, that's sort of weird. I always thought that was one of the biggest mistakes with |
I think that would be the most fitting type. "It's a type that provides simultaneous operations on a range of data". As @SpexGuy said, |
Sorry for my drive by comment, but for game and graphics programmers, the name "vector" is associated with vector math (of length 2 to 4), and the Whether the code is actually translated to SIMD instructions should depend on the target platform and compiler options (for instance it should still be possible to compile to WASM without SIMD support). It would be great IMHO, if Zig could offer the feature set of Clangs https://www.godbolt.org/z/zWGfcY5a4 The other thing that's needed to be "feature complete" is an |
The goal isn't so much to guarantee simd, but to encourage it. The semantics of other language constructs make it difficult or impossible to auto-vectorize code in most cases. Zig's Vector is trying to provide the optimizer with semantics that are more compatible to vectorization. It's not a hard guarantee that simd will be used, but the feature is designed in such a way that simd is usually the best way for the optimizer to implement it. However, the feature is defined in a way that does not strictly require hardware simd support. So if you are compiling to a platform that doesn't have simd instructions, the program will still compile and run correctly. Additionally, if you are for example doing a large number of by-element vector accesses on a platform with only SSE2, the optimizer may realize that simd would be less efficient than scalars, and decide to destructure the vector into multiple scalar values instead. |
#7295 once again shows once again that most programmers associate the word vector with a linear algebra vector type and not with a SIMD vector.
I proposa a rename to SIMD array, but i'm open for other names. I'm pretty much happy with any name that is not vector, as it is more confusing than helping.
The text was updated successfully, but these errors were encountered: