-
Notifications
You must be signed in to change notification settings - Fork 329
Closed
Labels
copyeditingPure editorial stuff (copyediting, *.bs file syntax, etc.)Pure editorial stuff (copyediting, *.bs file syntax, etc.)programming modelwgslWebGPU Shading Language IssuesWebGPU Shading Language Issues
Milestone
Description
What happens when an integer A is shifted by an amount B where B is equal to or greater than the number of bits in A? This applies to both left shift and right shift.
C++ has has various answers over time, see https://en.cppreference.com/w/cpp/language/operator_arithmetic#Bitwise_shift_operators
It's common to say undefined results occur if the shift width is equal or greater to the bit width. SPIR-V does this because it's the common case in ISAs.
What do we want to do here?
I don't think we have to cater to applications which do use very large shifts, and we can make them slow to make them consistent. But I'd like to keep the small shifts fast.
kvark
Metadata
Metadata
Assignees
Labels
copyeditingPure editorial stuff (copyediting, *.bs file syntax, etc.)Pure editorial stuff (copyediting, *.bs file syntax, etc.)programming modelwgslWebGPU Shading Language IssuesWebGPU Shading Language Issues
Type
Projects
Status
Done