From 8648fb1106d451b8612a4978825aa073128f3143 Mon Sep 17 00:00:00 2001 From: Antonio Maiorano Date: Mon, 9 Sep 2024 23:47:47 +0000 Subject: [PATCH] HLSL-IR: implement insertBits full polyfill Implemented as a general polyfill, but only used by the HLSL backend currently. Tested CTS using dawn_node with `-use-ir` and the following now pass: `webgpu:shader,execution,expression,call,builtin,insertBits:*` `webgpu:shader,validation,expression,call,builtin,insertBits:*` Bug: b/363199437 Bug: b/42251045 Change-Id: I985dbb178bd4778f2cd682c6226d9383416051db Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/206117 Reviewed-by: James Price Commit-Queue: Antonio Maiorano --- .../core/ir/transform/builtin_polyfill.cc | 63 ++++-- .../ir/transform/builtin_polyfill_test.cc | 186 ++++++++++++++++++ .../3c7ba5.wgsl.expected.ir.dxc.hlsl | 61 +++++- .../3c7ba5.wgsl.expected.ir.fxc.hlsl | 61 +++++- .../428b0b.wgsl.expected.ir.dxc.hlsl | 61 +++++- .../428b0b.wgsl.expected.ir.fxc.hlsl | 61 +++++- .../51ede1.wgsl.expected.ir.dxc.hlsl | 61 +++++- .../51ede1.wgsl.expected.ir.fxc.hlsl | 61 +++++- .../65468b.wgsl.expected.ir.dxc.hlsl | 61 +++++- .../65468b.wgsl.expected.ir.fxc.hlsl | 61 +++++- .../87826b.wgsl.expected.ir.dxc.hlsl | 61 +++++- .../87826b.wgsl.expected.ir.fxc.hlsl | 61 +++++- .../d86978.wgsl.expected.ir.dxc.hlsl | 61 +++++- .../d86978.wgsl.expected.ir.fxc.hlsl | 61 +++++- .../e3e3a2.wgsl.expected.ir.dxc.hlsl | 61 +++++- .../e3e3a2.wgsl.expected.ir.fxc.hlsl | 61 +++++- .../fe6ba6.wgsl.expected.ir.dxc.hlsl | 61 +++++- .../fe6ba6.wgsl.expected.ir.fxc.hlsl | 61 +++++- .../scalar/i32.spvasm.expected.ir.dxc.hlsl | 29 ++- .../scalar/i32.spvasm.expected.ir.fxc.hlsl | 29 ++- .../scalar/u32.spvasm.expected.ir.dxc.hlsl | 29 ++- .../scalar/u32.spvasm.expected.ir.fxc.hlsl | 29 ++- .../vec3/i32.spvasm.expected.ir.dxc.hlsl | 29 ++- .../vec3/i32.spvasm.expected.ir.fxc.hlsl | 29 ++- .../vec3/u32.spvasm.expected.ir.dxc.hlsl | 29 ++- .../vec3/u32.spvasm.expected.ir.fxc.hlsl | 29 ++- 26 files changed, 1227 insertions(+), 230 deletions(-) diff --git a/src/tint/lang/core/ir/transform/builtin_polyfill.cc b/src/tint/lang/core/ir/transform/builtin_polyfill.cc index d2d3ae8e5ec..3694fda370f 100644 --- a/src/tint/lang/core/ir/transform/builtin_polyfill.cc +++ b/src/tint/lang/core/ir/transform/builtin_polyfill.cc @@ -411,26 +411,26 @@ struct State { } break; case BuiltinPolyfillLevel::kFull: { // Replace: - // result = extractBits(v, offset, count) + // result = extractBits(e, offset, count) // With: // let s = min(offset, 32u); - // let e = min(32u, (s + count)); - // let shl = (32u - e); - // let shr = (shl + s); - // let shl_result = select(i32(), (v << shl), (shl < 32u)); + // let t = min(32u, (s + count)); + // let shl = (32u - t); + // let shr = (shl + s + // let shl_result = select(i32(), (e << shl), (shl < 32u)); // result = select(((shl_result >> 31u) >> 1u), (shl_result >> shr), (shr < 32u)); // } - auto* v = call->Args()[0]; - auto* result_ty = v->Type(); + auto* e = call->Args()[0]; + auto* result_ty = e->Type(); auto* uint_ty = ty.match_width(ty.u32(), result_ty); auto V = [&](uint32_t u) { return b.MatchWidth(u32(u), result_ty); }; b.InsertBefore(call, [&] { auto* s = b.Call(core::BuiltinFn::kMin, offset, 32_u); - auto* e = b.Call(core::BuiltinFn::kMin, 32_u, b.Add(ty.u32(), s, count)); - auto* shl = b.Subtract(32_u, e); + auto* t = b.Call(core::BuiltinFn::kMin, 32_u, b.Add(ty.u32(), s, count)); + auto* shl = b.Subtract(32_u, t); auto* shr = b.Add(shl, s); auto* f1 = b.Zero(result_ty); - auto* t1 = b.ShiftLeft(result_ty, v, b.Construct(uint_ty, shl)); + auto* t1 = b.ShiftLeft(result_ty, e, b.Construct(uint_ty, shl)); auto* shl_result = b.Call(result_ty, core::BuiltinFn::kSelect, f1, t1, b.LessThan(shl, 32_u)); auto* f2 = @@ -592,19 +592,54 @@ struct State { case BuiltinPolyfillLevel::kClampOrRangeCheck: { b.InsertBefore(call, [&] { // Replace: - // insertBits(e, offset, count) + // insertBits(e, newbits, offset, count) // With: // let o = min(offset, 32); // let c = min(count, w - o); - // insertBits(e, o, c); + // insertBits(e, newbits, o, c); auto* o = b.Call(ty.u32(), core::BuiltinFn::kMin, offset, 32_u); auto* c = b.Call(ty.u32(), core::BuiltinFn::kMin, count, b.Subtract(ty.u32(), 32_u, o)); call->SetOperand(ir::CoreBuiltinCall::kArgsOperandOffset + 2, o->Result(0)); call->SetOperand(ir::CoreBuiltinCall::kArgsOperandOffset + 3, c->Result(0)); }); - break; - } + } break; + case BuiltinPolyfillLevel::kFull: { + // Replace: + // result = insertBits(e, newbits, offset, count) + // With: + // let oc = (offset + count); + // let mask = ((select(0u, (1u << offset), (offset < 32u)) - 1u) + // ^ (select(0u, (1u << oc), (oc < 32u)) - 1u)); + // result = ((select(i32(), (newbits << offset), (offset < 32u)) & i32(mask)) + // | (e & i32(~(mask)))); + auto* e = call->Args()[0]; + auto* newbits = call->Args()[1]; + auto* result_ty = e->Type(); + auto* uint_ty = ty.match_width(ty.u32(), result_ty); + b.InsertBefore(call, [&] { + auto* oc = b.Add(offset, count); + auto* t1 = b.ShiftLeft(1_u, offset); + auto* s1 = b.Call(core::BuiltinFn::kSelect, b.Zero(), t1, + b.LessThan(offset, 32_u)); + auto* t2 = b.ShiftLeft(1_u, oc); + auto* s2 = b.Call(core::BuiltinFn::kSelect, b.Zero(), t2, + b.LessThan(oc, 32_u)); + auto* mask_lhs = b.Subtract(s1, 1_u); + auto* mask_rhs = b.Subtract(s2, 1_u); + auto* mask = b.Xor(mask_lhs, mask_rhs); + auto* f3 = b.Zero(result_ty); + auto* t3 = b.ShiftLeft(result_ty, newbits, b.Construct(uint_ty, offset)); + auto* s3 = b.Call(result_ty, core::BuiltinFn::kSelect, f3, t3, + b.LessThan(offset, 32_u)); + auto* result_lhs = b.And(result_ty, s3, b.Construct(result_ty, mask)); + auto* result_rhs = + b.And(result_ty, e, b.Construct(result_ty, b.Complement(mask))); + auto* result = b.Or(result_ty, result_lhs, result_rhs); + result->SetResults(Vector{call->DetachResult()}); + }); + call->Destroy(); + } break; default: TINT_UNIMPLEMENTED() << "insertBits polyfill level"; } diff --git a/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc b/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc index 5a3c740c67b..eecff1e1690 100644 --- a/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc +++ b/src/tint/lang/core/ir/transform/builtin_polyfill_test.cc @@ -1730,6 +1730,192 @@ TEST_F(IR_BuiltinPolyfillTest, InsertBits_ClampArgs_Vec4I32) { EXPECT_EQ(expect, str()); } +TEST_F(IR_BuiltinPolyfillTest, InsertBits_Full_U32) { + Build(core::BuiltinFn::kInsertBits, ty.u32(), Vector{ty.u32(), ty.u32(), ty.u32(), ty.u32()}); + auto* src = R"( +%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32, %arg_3:u32):u32 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg' + $B1: { + %result:u32 = insertBits %arg, %arg_1, %arg_2, %arg_3 + ret %result + } +} +)"; + auto* expect = R"( +%foo = func(%arg:u32, %arg_1:u32, %arg_2:u32, %arg_3:u32):u32 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg' + $B1: { + %6:u32 = add %arg_2, %arg_3 + %7:u32 = shl 1u, %arg_2 + %8:bool = lt %arg_2, 32u + %9:u32 = select 0u, %7, %8 + %10:u32 = shl 1u, %6 + %11:bool = lt %6, 32u + %12:u32 = select 0u, %10, %11 + %13:u32 = sub %9, 1u + %14:u32 = sub %12, 1u + %15:u32 = xor %13, %14 + %16:u32 = construct %arg_2 + %17:u32 = shl %arg_1, %16 + %18:bool = lt %arg_2, 32u + %19:u32 = select 0u, %17, %18 + %20:u32 = construct %15 + %21:u32 = and %19, %20 + %22:u32 = complement %15 + %23:u32 = construct %22 + %24:u32 = and %arg, %23 + %result:u32 = or %21, %24 + ret %result + } +} +)"; + + EXPECT_EQ(src, str()); + + BuiltinPolyfillConfig config; + config.insert_bits = BuiltinPolyfillLevel::kFull; + Run(BuiltinPolyfill, config); + EXPECT_EQ(expect, str()); +} + +TEST_F(IR_BuiltinPolyfillTest, InsertBits_Full_I32) { + Build(core::BuiltinFn::kInsertBits, ty.i32(), Vector{ty.i32(), ty.i32(), ty.u32(), ty.u32()}); + auto* src = R"( +%foo = func(%arg:i32, %arg_1:i32, %arg_2:u32, %arg_3:u32):i32 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg' + $B1: { + %result:i32 = insertBits %arg, %arg_1, %arg_2, %arg_3 + ret %result + } +} +)"; + auto* expect = R"( +%foo = func(%arg:i32, %arg_1:i32, %arg_2:u32, %arg_3:u32):i32 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg' + $B1: { + %6:u32 = add %arg_2, %arg_3 + %7:u32 = shl 1u, %arg_2 + %8:bool = lt %arg_2, 32u + %9:u32 = select 0u, %7, %8 + %10:u32 = shl 1u, %6 + %11:bool = lt %6, 32u + %12:u32 = select 0u, %10, %11 + %13:u32 = sub %9, 1u + %14:u32 = sub %12, 1u + %15:u32 = xor %13, %14 + %16:u32 = construct %arg_2 + %17:i32 = shl %arg_1, %16 + %18:bool = lt %arg_2, 32u + %19:i32 = select 0i, %17, %18 + %20:i32 = construct %15 + %21:i32 = and %19, %20 + %22:u32 = complement %15 + %23:i32 = construct %22 + %24:i32 = and %arg, %23 + %result:i32 = or %21, %24 + ret %result + } +} +)"; + + EXPECT_EQ(src, str()); + + BuiltinPolyfillConfig config; + config.insert_bits = BuiltinPolyfillLevel::kFull; + Run(BuiltinPolyfill, config); + EXPECT_EQ(expect, str()); +} + +TEST_F(IR_BuiltinPolyfillTest, InsertBits_Full_Vec2U32) { + Build(core::BuiltinFn::kInsertBits, ty.vec2(), + Vector{ty.vec2(), ty.vec2(), ty.u32(), ty.u32()}); + auto* src = R"( +%foo = func(%arg:vec2, %arg_1:vec2, %arg_2:u32, %arg_3:u32):vec2 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg' + $B1: { + %result:vec2 = insertBits %arg, %arg_1, %arg_2, %arg_3 + ret %result + } +} +)"; + auto* expect = R"( +%foo = func(%arg:vec2, %arg_1:vec2, %arg_2:u32, %arg_3:u32):vec2 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg' + $B1: { + %6:u32 = add %arg_2, %arg_3 + %7:u32 = shl 1u, %arg_2 + %8:bool = lt %arg_2, 32u + %9:u32 = select 0u, %7, %8 + %10:u32 = shl 1u, %6 + %11:bool = lt %6, 32u + %12:u32 = select 0u, %10, %11 + %13:u32 = sub %9, 1u + %14:u32 = sub %12, 1u + %15:u32 = xor %13, %14 + %16:vec2 = construct %arg_2 + %17:vec2 = shl %arg_1, %16 + %18:bool = lt %arg_2, 32u + %19:vec2 = select vec2(0u), %17, %18 + %20:vec2 = construct %15 + %21:vec2 = and %19, %20 + %22:u32 = complement %15 + %23:vec2 = construct %22 + %24:vec2 = and %arg, %23 + %result:vec2 = or %21, %24 + ret %result + } +} +)"; + + EXPECT_EQ(src, str()); + + BuiltinPolyfillConfig config; + config.insert_bits = BuiltinPolyfillLevel::kFull; + Run(BuiltinPolyfill, config); + EXPECT_EQ(expect, str()); +} + +TEST_F(IR_BuiltinPolyfillTest, InsertBits_Full_Vec4I32) { + Build(core::BuiltinFn::kInsertBits, ty.vec4(), + Vector{ty.vec4(), ty.vec4(), ty.u32(), ty.u32()}); + auto* src = R"( +%foo = func(%arg:vec4, %arg_1:vec4, %arg_2:u32, %arg_3:u32):vec4 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg' + $B1: { + %result:vec4 = insertBits %arg, %arg_1, %arg_2, %arg_3 + ret %result + } +} +)"; + auto* expect = R"( +%foo = func(%arg:vec4, %arg_1:vec4, %arg_2:u32, %arg_3:u32):vec4 { # %arg_1: 'arg', %arg_2: 'arg', %arg_3: 'arg' + $B1: { + %6:u32 = add %arg_2, %arg_3 + %7:u32 = shl 1u, %arg_2 + %8:bool = lt %arg_2, 32u + %9:u32 = select 0u, %7, %8 + %10:u32 = shl 1u, %6 + %11:bool = lt %6, 32u + %12:u32 = select 0u, %10, %11 + %13:u32 = sub %9, 1u + %14:u32 = sub %12, 1u + %15:u32 = xor %13, %14 + %16:vec4 = construct %arg_2 + %17:vec4 = shl %arg_1, %16 + %18:bool = lt %arg_2, 32u + %19:vec4 = select vec4(0i), %17, %18 + %20:vec4 = construct %15 + %21:vec4 = and %19, %20 + %22:u32 = complement %15 + %23:vec4 = construct %22 + %24:vec4 = and %arg, %23 + %result:vec4 = or %21, %24 + ret %result + } +} +)"; + + EXPECT_EQ(src, str()); + + BuiltinPolyfillConfig config; + config.insert_bits = BuiltinPolyfillLevel::kFull; + Run(BuiltinPolyfill, config); + EXPECT_EQ(expect, str()); +} + TEST_F(IR_BuiltinPolyfillTest, TextureSampleBaseClampToEdge_2d_f32_NoPolyfill) { auto* texture_ty = ty.Get(core::type::TextureDimension::k2d, ty.f32()); diff --git a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.ir.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.ir.dxc.hlsl index 02ab672e7e9..0683ff69585 100644 --- a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.ir.dxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.ir.dxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + uint2 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation uint2 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +uint2 insertBits_3c7ba5() { + uint2 arg_0 = (1u).xx; + uint2 arg_1 = (1u).xx; + uint arg_2 = 1u; + uint arg_3 = 1u; + uint2 v = arg_0; + uint2 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + uint2 v_6 = (((v_2 < 32u)) ? ((v_1 << uint2((v_2).xx))) : ((0u).xx)); + uint2 v_7 = (v_6 & uint2((v_5).xx)); + uint2 res = (v_7 | (v & uint2((~(v_5)).xx))); + return res; +} + +void fragment_main() { + prevent_dce.Store2(0u, insertBits_3c7ba5()); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store2(0u, insertBits_3c7ba5()); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_3c7ba5(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.ir.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.ir.fxc.hlsl index 02ab672e7e9..0683ff69585 100644 --- a/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.ir.fxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/3c7ba5.wgsl.expected.ir.fxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + uint2 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation uint2 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +uint2 insertBits_3c7ba5() { + uint2 arg_0 = (1u).xx; + uint2 arg_1 = (1u).xx; + uint arg_2 = 1u; + uint arg_3 = 1u; + uint2 v = arg_0; + uint2 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + uint2 v_6 = (((v_2 < 32u)) ? ((v_1 << uint2((v_2).xx))) : ((0u).xx)); + uint2 v_7 = (v_6 & uint2((v_5).xx)); + uint2 res = (v_7 | (v & uint2((~(v_5)).xx))); + return res; +} + +void fragment_main() { + prevent_dce.Store2(0u, insertBits_3c7ba5()); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store2(0u, insertBits_3c7ba5()); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_3c7ba5(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.ir.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.ir.dxc.hlsl index 02ab672e7e9..cee174ce2fb 100644 --- a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.ir.dxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.ir.dxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + int3 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation int3 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +int3 insertBits_428b0b() { + int3 arg_0 = (1).xxx; + int3 arg_1 = (1).xxx; + uint arg_2 = 1u; + uint arg_3 = 1u; + int3 v = arg_0; + int3 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + int3 v_6 = (((v_2 < 32u)) ? ((v_1 << uint3((v_2).xxx))) : ((0).xxx)); + int3 v_7 = (v_6 & int3((v_5).xxx)); + int3 res = (v_7 | (v & int3((~(v_5)).xxx))); + return res; +} + +void fragment_main() { + prevent_dce.Store3(0u, asuint(insertBits_428b0b())); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store3(0u, asuint(insertBits_428b0b())); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_428b0b(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.ir.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.ir.fxc.hlsl index 02ab672e7e9..cee174ce2fb 100644 --- a/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.ir.fxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/428b0b.wgsl.expected.ir.fxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + int3 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation int3 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +int3 insertBits_428b0b() { + int3 arg_0 = (1).xxx; + int3 arg_1 = (1).xxx; + uint arg_2 = 1u; + uint arg_3 = 1u; + int3 v = arg_0; + int3 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + int3 v_6 = (((v_2 < 32u)) ? ((v_1 << uint3((v_2).xxx))) : ((0).xxx)); + int3 v_7 = (v_6 & int3((v_5).xxx)); + int3 res = (v_7 | (v & int3((~(v_5)).xxx))); + return res; +} + +void fragment_main() { + prevent_dce.Store3(0u, asuint(insertBits_428b0b())); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store3(0u, asuint(insertBits_428b0b())); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_428b0b(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.ir.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.ir.dxc.hlsl index 02ab672e7e9..11406b457ff 100644 --- a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.ir.dxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.ir.dxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + uint4 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation uint4 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +uint4 insertBits_51ede1() { + uint4 arg_0 = (1u).xxxx; + uint4 arg_1 = (1u).xxxx; + uint arg_2 = 1u; + uint arg_3 = 1u; + uint4 v = arg_0; + uint4 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + uint4 v_6 = (((v_2 < 32u)) ? ((v_1 << uint4((v_2).xxxx))) : ((0u).xxxx)); + uint4 v_7 = (v_6 & uint4((v_5).xxxx)); + uint4 res = (v_7 | (v & uint4((~(v_5)).xxxx))); + return res; +} + +void fragment_main() { + prevent_dce.Store4(0u, insertBits_51ede1()); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store4(0u, insertBits_51ede1()); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_51ede1(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.ir.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.ir.fxc.hlsl index 02ab672e7e9..11406b457ff 100644 --- a/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.ir.fxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/51ede1.wgsl.expected.ir.fxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + uint4 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation uint4 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +uint4 insertBits_51ede1() { + uint4 arg_0 = (1u).xxxx; + uint4 arg_1 = (1u).xxxx; + uint arg_2 = 1u; + uint arg_3 = 1u; + uint4 v = arg_0; + uint4 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + uint4 v_6 = (((v_2 < 32u)) ? ((v_1 << uint4((v_2).xxxx))) : ((0u).xxxx)); + uint4 v_7 = (v_6 & uint4((v_5).xxxx)); + uint4 res = (v_7 | (v & uint4((~(v_5)).xxxx))); + return res; +} + +void fragment_main() { + prevent_dce.Store4(0u, insertBits_51ede1()); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store4(0u, insertBits_51ede1()); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_51ede1(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.ir.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.ir.dxc.hlsl index 02ab672e7e9..5846bddac1d 100644 --- a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.ir.dxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.ir.dxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + int prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation int VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +int insertBits_65468b() { + int arg_0 = 1; + int arg_1 = 1; + uint arg_2 = 1u; + uint arg_3 = 1u; + int v = arg_0; + int v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + int v_6 = (((v_2 < 32u)) ? ((v_1 << uint(v_2))) : (0)); + int v_7 = (v_6 & int(v_5)); + int res = (v_7 | (v & int(~(v_5)))); + return res; +} + +void fragment_main() { + prevent_dce.Store(0u, asuint(insertBits_65468b())); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store(0u, asuint(insertBits_65468b())); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_65468b(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.ir.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.ir.fxc.hlsl index 02ab672e7e9..5846bddac1d 100644 --- a/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.ir.fxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/65468b.wgsl.expected.ir.fxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + int prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation int VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +int insertBits_65468b() { + int arg_0 = 1; + int arg_1 = 1; + uint arg_2 = 1u; + uint arg_3 = 1u; + int v = arg_0; + int v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + int v_6 = (((v_2 < 32u)) ? ((v_1 << uint(v_2))) : (0)); + int v_7 = (v_6 & int(v_5)); + int res = (v_7 | (v & int(~(v_5)))); + return res; +} + +void fragment_main() { + prevent_dce.Store(0u, asuint(insertBits_65468b())); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store(0u, asuint(insertBits_65468b())); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_65468b(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.ir.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.ir.dxc.hlsl index 02ab672e7e9..cc6deb5feba 100644 --- a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.ir.dxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.ir.dxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + uint3 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation uint3 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +uint3 insertBits_87826b() { + uint3 arg_0 = (1u).xxx; + uint3 arg_1 = (1u).xxx; + uint arg_2 = 1u; + uint arg_3 = 1u; + uint3 v = arg_0; + uint3 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + uint3 v_6 = (((v_2 < 32u)) ? ((v_1 << uint3((v_2).xxx))) : ((0u).xxx)); + uint3 v_7 = (v_6 & uint3((v_5).xxx)); + uint3 res = (v_7 | (v & uint3((~(v_5)).xxx))); + return res; +} + +void fragment_main() { + prevent_dce.Store3(0u, insertBits_87826b()); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store3(0u, insertBits_87826b()); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_87826b(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.ir.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.ir.fxc.hlsl index 02ab672e7e9..cc6deb5feba 100644 --- a/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.ir.fxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/87826b.wgsl.expected.ir.fxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + uint3 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation uint3 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +uint3 insertBits_87826b() { + uint3 arg_0 = (1u).xxx; + uint3 arg_1 = (1u).xxx; + uint arg_2 = 1u; + uint arg_3 = 1u; + uint3 v = arg_0; + uint3 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + uint3 v_6 = (((v_2 < 32u)) ? ((v_1 << uint3((v_2).xxx))) : ((0u).xxx)); + uint3 v_7 = (v_6 & uint3((v_5).xxx)); + uint3 res = (v_7 | (v & uint3((~(v_5)).xxx))); + return res; +} + +void fragment_main() { + prevent_dce.Store3(0u, insertBits_87826b()); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store3(0u, insertBits_87826b()); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_87826b(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.ir.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.ir.dxc.hlsl index 02ab672e7e9..ed16c13d5f2 100644 --- a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.ir.dxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.ir.dxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + int4 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation int4 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +int4 insertBits_d86978() { + int4 arg_0 = (1).xxxx; + int4 arg_1 = (1).xxxx; + uint arg_2 = 1u; + uint arg_3 = 1u; + int4 v = arg_0; + int4 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + int4 v_6 = (((v_2 < 32u)) ? ((v_1 << uint4((v_2).xxxx))) : ((0).xxxx)); + int4 v_7 = (v_6 & int4((v_5).xxxx)); + int4 res = (v_7 | (v & int4((~(v_5)).xxxx))); + return res; +} + +void fragment_main() { + prevent_dce.Store4(0u, asuint(insertBits_d86978())); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store4(0u, asuint(insertBits_d86978())); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_d86978(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.ir.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.ir.fxc.hlsl index 02ab672e7e9..ed16c13d5f2 100644 --- a/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.ir.fxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/d86978.wgsl.expected.ir.fxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + int4 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation int4 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +int4 insertBits_d86978() { + int4 arg_0 = (1).xxxx; + int4 arg_1 = (1).xxxx; + uint arg_2 = 1u; + uint arg_3 = 1u; + int4 v = arg_0; + int4 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + int4 v_6 = (((v_2 < 32u)) ? ((v_1 << uint4((v_2).xxxx))) : ((0).xxxx)); + int4 v_7 = (v_6 & int4((v_5).xxxx)); + int4 res = (v_7 | (v & int4((~(v_5)).xxxx))); + return res; +} + +void fragment_main() { + prevent_dce.Store4(0u, asuint(insertBits_d86978())); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store4(0u, asuint(insertBits_d86978())); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_d86978(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.ir.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.ir.dxc.hlsl index 02ab672e7e9..0484c686793 100644 --- a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.ir.dxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.ir.dxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + uint prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation uint VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +uint insertBits_e3e3a2() { + uint arg_0 = 1u; + uint arg_1 = 1u; + uint arg_2 = 1u; + uint arg_3 = 1u; + uint v = arg_0; + uint v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + uint v_6 = (((v_2 < 32u)) ? ((v_1 << uint(v_2))) : (0u)); + uint v_7 = (v_6 & uint(v_5)); + uint res = (v_7 | (v & uint(~(v_5)))); + return res; +} + +void fragment_main() { + prevent_dce.Store(0u, insertBits_e3e3a2()); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store(0u, insertBits_e3e3a2()); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_e3e3a2(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.ir.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.ir.fxc.hlsl index 02ab672e7e9..0484c686793 100644 --- a/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.ir.fxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/e3e3a2.wgsl.expected.ir.fxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + uint prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation uint VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +uint insertBits_e3e3a2() { + uint arg_0 = 1u; + uint arg_1 = 1u; + uint arg_2 = 1u; + uint arg_3 = 1u; + uint v = arg_0; + uint v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + uint v_6 = (((v_2 < 32u)) ? ((v_1 << uint(v_2))) : (0u)); + uint v_7 = (v_6 & uint(v_5)); + uint res = (v_7 | (v & uint(~(v_5)))); + return res; +} + +void fragment_main() { + prevent_dce.Store(0u, insertBits_e3e3a2()); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store(0u, insertBits_e3e3a2()); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_e3e3a2(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.ir.dxc.hlsl b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.ir.dxc.hlsl index 02ab672e7e9..005ace07f3b 100644 --- a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.ir.dxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.ir.dxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + int2 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation int2 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +int2 insertBits_fe6ba6() { + int2 arg_0 = (1).xx; + int2 arg_1 = (1).xx; + uint arg_2 = 1u; + uint arg_3 = 1u; + int2 v = arg_0; + int2 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + int2 v_6 = (((v_2 < 32u)) ? ((v_1 << uint2((v_2).xx))) : ((0).xx)); + int2 v_7 = (v_6 & int2((v_5).xx)); + int2 res = (v_7 | (v & int2((~(v_5)).xx))); + return res; +} + +void fragment_main() { + prevent_dce.Store2(0u, asuint(insertBits_fe6ba6())); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store2(0u, asuint(insertBits_fe6ba6())); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_fe6ba6(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.ir.fxc.hlsl b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.ir.fxc.hlsl index 02ab672e7e9..005ace07f3b 100644 --- a/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.ir.fxc.hlsl +++ b/test/tint/builtins/gen/var/insertBits/fe6ba6.wgsl.expected.ir.fxc.hlsl @@ -1,11 +1,54 @@ -SKIP: FAILED +struct VertexOutput { + float4 pos; + int2 prevent_dce; +}; -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +struct vertex_main_outputs { + nointerpolation int2 VertexOutput_prevent_dce : TEXCOORD0; + float4 VertexOutput_pos : SV_Position; +}; + + +RWByteAddressBuffer prevent_dce : register(u0); +int2 insertBits_fe6ba6() { + int2 arg_0 = (1).xx; + int2 arg_1 = (1).xx; + uint arg_2 = 1u; + uint arg_3 = 1u; + int2 v = arg_0; + int2 v_1 = arg_1; + uint v_2 = arg_2; + uint v_3 = (v_2 + arg_3); + uint v_4 = (((v_2 < 32u)) ? ((1u << v_2)) : (0u)); + uint v_5 = ((v_4 - 1u) ^ ((((v_3 < 32u)) ? ((1u << v_3)) : (0u)) - 1u)); + int2 v_6 = (((v_2 < 32u)) ? ((v_1 << uint2((v_2).xx))) : ((0).xx)); + int2 v_7 = (v_6 & int2((v_5).xx)); + int2 res = (v_7 | (v & int2((~(v_5)).xx))); + return res; +} + +void fragment_main() { + prevent_dce.Store2(0u, asuint(insertBits_fe6ba6())); +} + +[numthreads(1, 1, 1)] +void compute_main() { + prevent_dce.Store2(0u, asuint(insertBits_fe6ba6())); +} + +VertexOutput vertex_main_inner() { + VertexOutput tint_symbol = (VertexOutput)0; + tint_symbol.pos = (0.0f).xxxx; + tint_symbol.prevent_dce = insertBits_fe6ba6(); + VertexOutput v_8 = tint_symbol; + return v_8; +} + +vertex_main_outputs vertex_main() { + VertexOutput v_9 = vertex_main_inner(); + VertexOutput v_10 = v_9; + VertexOutput v_11 = v_9; + vertex_main_outputs v_12 = {v_11.prevent_dce, v_10.pos}; + return v_12; +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.ir.dxc.hlsl b/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.ir.dxc.hlsl index 02ab672e7e9..5faba4323cd 100644 --- a/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.ir.dxc.hlsl +++ b/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.ir.dxc.hlsl @@ -1,11 +1,22 @@ -SKIP: FAILED -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +void f_1() { + int v = 0; + int n = 0; + uint offset_1 = 0u; + uint count = 0u; + int v_1 = v; + int v_2 = n; + uint v_3 = offset_1; + uint v_4 = (v_3 + count); + uint v_5 = (((v_3 < 32u)) ? ((1u << v_3)) : (0u)); + uint v_6 = ((v_5 - 1u) ^ ((((v_4 < 32u)) ? ((1u << v_4)) : (0u)) - 1u)); + int v_7 = (((v_3 < 32u)) ? ((v_2 << uint(v_3))) : (0)); + int v_8 = (v_7 & int(v_6)); + int x_15 = (v_8 | (v_1 & int(~(v_6)))); +} + +[numthreads(1, 1, 1)] +void f() { + f_1(); +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.ir.fxc.hlsl b/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.ir.fxc.hlsl index 02ab672e7e9..5faba4323cd 100644 --- a/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.ir.fxc.hlsl +++ b/test/tint/builtins/insertBits/scalar/i32.spvasm.expected.ir.fxc.hlsl @@ -1,11 +1,22 @@ -SKIP: FAILED -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +void f_1() { + int v = 0; + int n = 0; + uint offset_1 = 0u; + uint count = 0u; + int v_1 = v; + int v_2 = n; + uint v_3 = offset_1; + uint v_4 = (v_3 + count); + uint v_5 = (((v_3 < 32u)) ? ((1u << v_3)) : (0u)); + uint v_6 = ((v_5 - 1u) ^ ((((v_4 < 32u)) ? ((1u << v_4)) : (0u)) - 1u)); + int v_7 = (((v_3 < 32u)) ? ((v_2 << uint(v_3))) : (0)); + int v_8 = (v_7 & int(v_6)); + int x_15 = (v_8 | (v_1 & int(~(v_6)))); +} + +[numthreads(1, 1, 1)] +void f() { + f_1(); +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.ir.dxc.hlsl b/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.ir.dxc.hlsl index 02ab672e7e9..20023a23fe8 100644 --- a/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.ir.dxc.hlsl +++ b/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.ir.dxc.hlsl @@ -1,11 +1,22 @@ -SKIP: FAILED -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +void f_1() { + uint v = 0u; + uint n = 0u; + uint offset_1 = 0u; + uint count = 0u; + uint v_1 = v; + uint v_2 = n; + uint v_3 = offset_1; + uint v_4 = (v_3 + count); + uint v_5 = (((v_3 < 32u)) ? ((1u << v_3)) : (0u)); + uint v_6 = ((v_5 - 1u) ^ ((((v_4 < 32u)) ? ((1u << v_4)) : (0u)) - 1u)); + uint v_7 = (((v_3 < 32u)) ? ((v_2 << uint(v_3))) : (0u)); + uint v_8 = (v_7 & uint(v_6)); + uint x_12 = (v_8 | (v_1 & uint(~(v_6)))); +} + +[numthreads(1, 1, 1)] +void f() { + f_1(); +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.ir.fxc.hlsl b/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.ir.fxc.hlsl index 02ab672e7e9..20023a23fe8 100644 --- a/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.ir.fxc.hlsl +++ b/test/tint/builtins/insertBits/scalar/u32.spvasm.expected.ir.fxc.hlsl @@ -1,11 +1,22 @@ -SKIP: FAILED -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +void f_1() { + uint v = 0u; + uint n = 0u; + uint offset_1 = 0u; + uint count = 0u; + uint v_1 = v; + uint v_2 = n; + uint v_3 = offset_1; + uint v_4 = (v_3 + count); + uint v_5 = (((v_3 < 32u)) ? ((1u << v_3)) : (0u)); + uint v_6 = ((v_5 - 1u) ^ ((((v_4 < 32u)) ? ((1u << v_4)) : (0u)) - 1u)); + uint v_7 = (((v_3 < 32u)) ? ((v_2 << uint(v_3))) : (0u)); + uint v_8 = (v_7 & uint(v_6)); + uint x_12 = (v_8 | (v_1 & uint(~(v_6)))); +} + +[numthreads(1, 1, 1)] +void f() { + f_1(); +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.ir.dxc.hlsl b/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.ir.dxc.hlsl index 02ab672e7e9..dabecd953b1 100644 --- a/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.ir.dxc.hlsl +++ b/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.ir.dxc.hlsl @@ -1,11 +1,22 @@ -SKIP: FAILED -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +void f_1() { + int3 v = (0).xxx; + int3 n = (0).xxx; + uint offset_1 = 0u; + uint count = 0u; + int3 v_1 = v; + int3 v_2 = n; + uint v_3 = offset_1; + uint v_4 = (v_3 + count); + uint v_5 = (((v_3 < 32u)) ? ((1u << v_3)) : (0u)); + uint v_6 = ((v_5 - 1u) ^ ((((v_4 < 32u)) ? ((1u << v_4)) : (0u)) - 1u)); + int3 v_7 = (((v_3 < 32u)) ? ((v_2 << uint3((v_3).xxx))) : ((0).xxx)); + int3 v_8 = (v_7 & int3((v_6).xxx)); + int3 x_16 = (v_8 | (v_1 & int3((~(v_6)).xxx))); +} + +[numthreads(1, 1, 1)] +void f() { + f_1(); +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.ir.fxc.hlsl b/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.ir.fxc.hlsl index 02ab672e7e9..dabecd953b1 100644 --- a/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.ir.fxc.hlsl +++ b/test/tint/builtins/insertBits/vec3/i32.spvasm.expected.ir.fxc.hlsl @@ -1,11 +1,22 @@ -SKIP: FAILED -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +void f_1() { + int3 v = (0).xxx; + int3 n = (0).xxx; + uint offset_1 = 0u; + uint count = 0u; + int3 v_1 = v; + int3 v_2 = n; + uint v_3 = offset_1; + uint v_4 = (v_3 + count); + uint v_5 = (((v_3 < 32u)) ? ((1u << v_3)) : (0u)); + uint v_6 = ((v_5 - 1u) ^ ((((v_4 < 32u)) ? ((1u << v_4)) : (0u)) - 1u)); + int3 v_7 = (((v_3 < 32u)) ? ((v_2 << uint3((v_3).xxx))) : ((0).xxx)); + int3 v_8 = (v_7 & int3((v_6).xxx)); + int3 x_16 = (v_8 | (v_1 & int3((~(v_6)).xxx))); +} + +[numthreads(1, 1, 1)] +void f() { + f_1(); +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.ir.dxc.hlsl b/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.ir.dxc.hlsl index 02ab672e7e9..674cc6b69e8 100644 --- a/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.ir.dxc.hlsl +++ b/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.ir.dxc.hlsl @@ -1,11 +1,22 @@ -SKIP: FAILED -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +void f_1() { + uint3 v = (0u).xxx; + uint3 n = (0u).xxx; + uint offset_1 = 0u; + uint count = 0u; + uint3 v_1 = v; + uint3 v_2 = n; + uint v_3 = offset_1; + uint v_4 = (v_3 + count); + uint v_5 = (((v_3 < 32u)) ? ((1u << v_3)) : (0u)); + uint v_6 = ((v_5 - 1u) ^ ((((v_4 < 32u)) ? ((1u << v_4)) : (0u)) - 1u)); + uint3 v_7 = (((v_3 < 32u)) ? ((v_2 << uint3((v_3).xxx))) : ((0u).xxx)); + uint3 v_8 = (v_7 & uint3((v_6).xxx)); + uint3 x_15 = (v_8 | (v_1 & uint3((~(v_6)).xxx))); +} + +[numthreads(1, 1, 1)] +void f() { + f_1(); +} -tint executable returned error: exit status 0xc000001d diff --git a/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.ir.fxc.hlsl b/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.ir.fxc.hlsl index 02ab672e7e9..674cc6b69e8 100644 --- a/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.ir.fxc.hlsl +++ b/test/tint/builtins/insertBits/vec3/u32.spvasm.expected.ir.fxc.hlsl @@ -1,11 +1,22 @@ -SKIP: FAILED -..\..\src\tint\lang\core\ir\transform\builtin_polyfill.cc:555 internal compiler error: TINT_UNIMPLEMENTED insertBits polyfill level -******************************************************************** -* The tint shader compiler has encountered an unexpected error. * -* * -* Please help us fix this issue by submitting a bug report at * -* crbug.com/tint with the source program that triggered the bug. * -******************************************************************** +void f_1() { + uint3 v = (0u).xxx; + uint3 n = (0u).xxx; + uint offset_1 = 0u; + uint count = 0u; + uint3 v_1 = v; + uint3 v_2 = n; + uint v_3 = offset_1; + uint v_4 = (v_3 + count); + uint v_5 = (((v_3 < 32u)) ? ((1u << v_3)) : (0u)); + uint v_6 = ((v_5 - 1u) ^ ((((v_4 < 32u)) ? ((1u << v_4)) : (0u)) - 1u)); + uint3 v_7 = (((v_3 < 32u)) ? ((v_2 << uint3((v_3).xxx))) : ((0u).xxx)); + uint3 v_8 = (v_7 & uint3((v_6).xxx)); + uint3 x_15 = (v_8 | (v_1 & uint3((~(v_6)).xxx))); +} + +[numthreads(1, 1, 1)] +void f() { + f_1(); +} -tint executable returned error: exit status 0xc000001d