Repository navigation
stage1: Implement @reduce builtin for vector types - #6558
Conversation
The builtin folds a Vector(N,T) into a scalar T using a specified operator. Closes ziglang#2698
|
My goodness, we just cannot catch a break with that windows CI |
andrewrk
left a comment
There was a problem hiding this comment.
Nice progress! 1 nitpick and then this is good to land.
BTW why not work towards this in stage2? This is still useful progress because the changes to builtin.zig, behavior tests, and zig_llvm.{h,cpp} will persist, but I have a feeling you would enjoy the work more on stage2, and once we get far enough on that, the current plan is to delete the stage1 codebase (#6378).
Also I'm happy to do the nitpick myself in the merge process if you want, just say the word.
| And, | ||
| Or, | ||
| Xor, | ||
| Min, | ||
| Max, |
There was a problem hiding this comment.
lower case tag names for new enums please. I normally don't want to care about style stuff but I also don't want to have to make unnecessary breaking changes later.
Because I was playing with SIMD rather than with the compiler :^)
Yeah go ahead, didn't know about the lowercase rule for enum members. |
|
Oh, hmm. Gonna change my mind on this one. Capitalized enum tag names in this case works around the conflicts with the language keywords. 🤷 |
Alright well that's certainly motivating for me or someone else to get started on #6541 :-) |
|
|
Sure, I didn't implement those because I wasn't sure about the names to use (nor I had any need for those ops). |
Before 0.7.0 release? :) But I thought about integer/float overflow for |
The builtin folds a Vector(N,T) into a scalar T using a specified operator.
Closes #2698