Repository navigation
Conversation
In Vulkan, OpSMod is undefined if either operand is negative. The spec explicit says it's no more functional than OpUMod. https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#spirvenv-precision-operation
|
Counter proposal: just polyfill this on SPIR-V with |
You need to watch out for INT_MIN / -1, which overflows signed integer. |
|
Right. I imagine we could just put a note into spec saying that under specific conditions this computation falls under the umbrella of integer overflow scenarios. |
Now I have to ask about how signed integer division works. cpprefrence says:
It seems to me important that the identity should hold even when a/b is not an integer. Otherwise the important things like the Euclidean algorithm breaks down. I think the quotient-rounding direction of integer division is orthogonal. |
WGSL meeting minutes 2021-05-25
|
#1774 tracks questions about signed integer division, particularly for opposite signed operands. |
WGSL meeting minutes 2021-06-08
|
|
@dneto0 I think we agreed to not remove it on the call yesterday, so this PR can be closed. |
In Vulkan, OpSMod is undefined if either operand is negative. The spec
explicit says it's no more functional than OpUMod.
https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#spirvenv-precision-operation