dawn-cmake/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.msl
Ben Clayton fe08ba4677 builtins: Add insertBits
CTS tests: https://github.com/gpuweb/cts/pull/1012

Bug: tint:1371
Change-Id: Idd55c0bc9dad1dffb558d0bc57d744f65e9041b5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/81701
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
2022-02-23 21:18:09 +00:00

28 lines
533 B
Plaintext

#include <metal_stdlib>
using namespace metal;
uint tint_insert_bits(uint v, uint n, uint offset, uint count) {
uint const s = min(offset, 32u);
uint const e = min(32u, (s + count));
return insert_bits(v, n, s, (e - s));
}
void f_1() {
uint v = 0u;
uint n = 0u;
uint offset_1 = 0u;
uint count = 0u;
uint const x_14 = v;
uint const x_15 = n;
uint const x_16 = offset_1;
uint const x_17 = count;
uint const x_12 = tint_insert_bits(x_14, x_15, x_16, x_17);
return;
}
kernel void f() {
f_1();
return;
}