cts
cts copied to clipboard
wgsl: Bitwise tests
Complement
- [x]
~for i32, u32 and vec of each - [x]
~for AbstractInt, and vectors of AbstractInt
Or, And, XOR
(|, & and ^ already have tests in shader/execution/expression/binary/bitwise.spec.ts)
For each of those, validate mixed types fails to parse
Left Shift expressions
- [x]
1 << 2 - [x] Modulo for i32/u32 shift e.g.
1i << 33shifts== 2 - [ ] most significant bits must be same for abstract (1<<63 is error, 2 <<62, etc)
- [ ]
1 << -1is validation error - [x]
1i << -1is validation error - [x]
1u << -1is validation error - [x] Component wise shift with
vec - [x]
vecsizes don't match for shift is error
Right shift expressions
- [x]
0x80000000{i|u} >> 32==0x8000000(shift is modulo) - [x]
0x80000000{i|u} >> 31==1 - [x]
0x80000000 >> 32==0(abstract) - [x]
1{i32, u32} >> -1is validation error - [ ]
1{Abstract} >> -1is validation error - [x]
vecsizes don't match is validation error - [x]
vecshifts component wise.