Repository navigation
Conversation
|
munrocket marked as non substantive for IPR from ash-nazg. |
Contributor
kvark
approved these changes
Oct 15, 2021
kvark
left a comment
Contributor
There was a problem hiding this comment.
I believe we've already agreed on this, just never made it into the text.
Contributor
|
See also #1830 which was an attempt at updating the semantics of these operations. On some backends, that would mean polyfilling when needed. |
Contributor
WGSL meeting minutes 2021-10-19
|
Contributor
|
#2450 just reminded me of this PR. We should get this landed or added to the next meeting agenda. |
alan-baker
reviewed
Jan 19, 2022
| <td>|e1| : |T|<br>|e2| : |T|<br>|T| is [UNSIGNEDINTEGRAL] | ||
| <td>|e1| `%` |e2| : |T| | ||
| <td>Unsigned integer remainder. [=Component-wise=] when |T| is a vector. (OpUMod) | ||
| <td>Unsigned integer remainder. [=Component-wise=] when |T| is a vector. (OpURem) |
Contributor
There was a problem hiding this comment.
OpURem isn't a SPIR-V opcode. There would be no difference from OpURem.
Contributor
|
Discussed in the 2022-01-18 meeting
Alan points out there is no OpURem. There is only OpUMod, and it would be the same anyway. |
Contributor
|
Landed via #2518 |
Contributor
|
details>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should we change OpSMod -> OpSRem and OpUMod -> OpURem for integers?
Motivation:
Conclusion:
OpUMod and OpURem is literally the same so just editorial change.
OpSRem not defined in Spir-V for non-negative numbers so basically the same too with exception.
If you going to emulate it. OpSRem looks simple
x - y * (x / y), but proper emulation for OpSMod looks wierd:if (y < 0) { x = -x; y = -y; }; r = (x >= 0) ? x / y : ((x + 1) / x) - 1; r = x - y * r;. I believe that all shader languages uses the same rounding in division? Because otherwise we will have problems with emulation and integer division consistency between backends.Little bit related issue: #1696, #1763.
This issue not related to float fmod (which is much more useful for webgl users and frequently requested)