diff options
| author | Anders Leino <aleino@nvidia.com> | 2025-01-10 21:05:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-10 11:05:05 -0800 |
| commit | 803e0c9f9a9dc4b01e29ebbf3b37a5bba782ac83 (patch) | |
| tree | 4996c9f415c64692e8381ae8c9ab1ab914ee86ea /tests/metal | |
| parent | 6437f2d37b08972db5e4515bd124639c2903dda1 (diff) | |
WGSL: Convert signed vector shift amounts to unsigned (#6023)
* WGSL: Fixes for signed shift amounts
- Handle the case of vector shift amounts
- Closes #5985
- Move handling of scalar case from emit to legalization
- Add tests for bitshifts.
* Move the binary operator legalization function to a common place
* Metal: Legalize binary operations
Closes #6029.
* Fix Metal filecheck test
The int shift amounts are now converted to unsigned.
* format code
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/metal')
| -rw-r--r-- | tests/metal/byte-address-buffer.slang | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/metal/byte-address-buffer.slang b/tests/metal/byte-address-buffer.slang index 24802815e..d4b58061f 100644 --- a/tests/metal/byte-address-buffer.slang +++ b/tests/metal/byte-address-buffer.slang @@ -20,11 +20,11 @@ struct TestStruct void main_kernel(uint3 tid: SV_DispatchThreadID) { // CHECK: uint [[WORD0:[a-zA-Z0-9_]+]] = as_type<uint>({{.*}}[(int(0))>>2]); - // CHECK: uint8_t [[A:[a-zA-Z0-9_]+]] = uint8_t([[WORD0]] >> int(0) & 255U); + // CHECK: uint8_t [[A:[a-zA-Z0-9_]+]] = uint8_t([[WORD0]] >> 0U & 255U); // CHECK: uint [[WORD1:[a-zA-Z0-9_]+]] = as_type<uint>({{.*}}[(int(0))>>2]); - // CHECK: half [[H:[a-zA-Z0-9_]+]] = as_type<half>(ushort([[WORD1]] >> int(16) & 65535U)); + // CHECK: half [[H:[a-zA-Z0-9_]+]] = as_type<half>(ushort([[WORD1]] >> 16U & 65535U)); - // CHECK: {{.*}}[(int(128))>>2] = as_type<uint32_t>(({{.*}} & 4294967040U) | uint([[A]]) << int(0)); - // CHECK: {{.*}}[(int(128))>>2] = as_type<uint32_t>(({{.*}} & 65535U) | uint(as_type<ushort>([[H]])) << int(16)); + // CHECK: {{.*}}[(int(128))>>2] = as_type<uint32_t>(({{.*}} & 4294967040U) | uint([[A]]) << 0U); + // CHECK: {{.*}}[(int(128))>>2] = as_type<uint32_t>(({{.*}} & 65535U) | uint(as_type<ushort>([[H]])) << 16U); buffer.Store(128, buffer.Load<TestStruct>(0)); } |
