You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPIR-V] Fix OpBitFieldExtract emulation for unsigned integer (microsoft#7167)
For an unsigned integer, we should OpShiftRightLogical instead of
OpShiftRightArithmetic. Otherwise the value may be extended incorrectly.
For example:
```
struct S {
uint16_t m1 : 8;
uint16_t m2 : 8;
};
void main() {
S s;
s.m1 = 0xff;
s.m2 = 0xff;
uint16_t result = s.m1;
}
```
If we do OpShiftRightArithmetic here, the result will be 0xffff.
0 commit comments