From 9ca78030ebf0231b9398e6984b2ccd46b4146bd1 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Wed, 9 Jun 2021 18:53:57 +0000 Subject: [PATCH] hlsl: Implement modf and frexp Change-Id: I40b3ad7e2d4811b0a52e75402c7d5ccda090a97c Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53809 Kokoro: Kokoro Reviewed-by: David Neto --- src/writer/hlsl/generator_impl.cc | 63 +++++++++++++++++-- src/writer/hlsl/generator_impl.h | 12 +++- .../hlsl/generator_impl_intrinsic_test.cc | 58 +++++++++++++++-- test/intrinsics/frexp.wgsl.expected.hlsl | 11 +++- .../gen/frexp/013caa.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/15edf3.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/19ab15.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/2052e9.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/234f02.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/2945dc.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/41e931.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/481e59.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/5a141e.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/64e816.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/68fc89.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/6d0058.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/6f0e62.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/790800.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/a951b5.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/b2f24a.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/b9e4de.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/c51019.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/d06c2c.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/d68011.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/e061dd.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/e9b529.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/ee3625.wgsl.expected.hlsl | 34 +++++----- .../gen/frexp/fb15f9.wgsl.expected.hlsl | 34 +++++----- .../gen/modf/353f7d.wgsl.expected.hlsl | 31 ++++----- .../gen/modf/3b79d5.wgsl.expected.hlsl | 31 ++++----- .../gen/modf/4bb324.wgsl.expected.hlsl | 31 ++++----- .../gen/modf/4fe3d9.wgsl.expected.hlsl | 31 ++++----- .../gen/modf/51e4c6.wgsl.expected.hlsl | 31 ++++----- .../gen/modf/546e09.wgsl.expected.hlsl | 31 ++++----- .../gen/modf/86441c.wgsl.expected.hlsl | 31 ++++----- .../gen/modf/955651.wgsl.expected.hlsl | 31 ++++----- .../gen/modf/a54eca.wgsl.expected.hlsl | 31 ++++----- .../gen/modf/d1d6f6.wgsl.expected.hlsl | 31 ++++----- .../gen/modf/e83560.wgsl.expected.hlsl | 31 ++++----- .../gen/modf/f90945.wgsl.expected.hlsl | 31 ++++----- test/intrinsics/modf.wgsl.expected.hlsl | 8 ++- 41 files changed, 678 insertions(+), 662 deletions(-) diff --git a/src/writer/hlsl/generator_impl.cc b/src/writer/hlsl/generator_impl.cc index 42661e54cc..f26515677f 100644 --- a/src/writer/hlsl/generator_impl.cc +++ b/src/writer/hlsl/generator_impl.cc @@ -586,6 +586,9 @@ bool GeneratorImpl::EmitCall(std::ostream& pre, } if (intrinsic->Type() == sem::IntrinsicType::kSelect) { return EmitSelectCall(pre, out, expr); + } + if (intrinsic->Type() == sem::IntrinsicType::kFrexp) { + return EmitFrexpCall(pre, out, expr, intrinsic); } else if (intrinsic->Type() == sem::IntrinsicType::kIsNormal) { diagnostics_.add_error("is_normal not supported in HLSL backend yet"); return false; @@ -701,6 +704,52 @@ bool GeneratorImpl::EmitSelectCall(std::ostream& pre, return true; } +bool GeneratorImpl::EmitFrexpCall(std::ostream& pre, + std::ostream& out, + ast::CallExpression* expr, + const sem::Intrinsic* intrinsic) { + // Exponent is an integer in WGSL, but HLSL wants a float. + // We need to make the call with a temporary float, and then cast. + + auto signficand = intrinsic->Parameters()[0]; + auto exponent = intrinsic->Parameters()[1]; + + std::string width; + if (auto* vec = signficand.type->As()) { + width = std::to_string(vec->size()); + } + + // Exponent is an integer, which HLSL does not have an overload for. + // We need to cast from a float. + std::stringstream ss; + auto float_exp = generate_name(kTempNamePrefix); + ss << "float" << width << " " << float_exp << ";"; + + make_indent(ss << std::endl); + auto significand = generate_name(kTempNamePrefix); + ss << "float" << width << " " << significand << " = frexp("; + if (!EmitExpression(pre, ss, expr->params()[0])) { + return false; + } + ss << ", " << float_exp << ");"; + + make_indent(ss << std::endl); + if (!EmitExpression(pre, ss, expr->params()[1])) { + return false; + } + ss << " = "; + if (!EmitType(ss, exponent.type->UnwrapPtr(), ast::StorageClass::kNone, + ast::Access::kUndefined, "")) { + return false; + } + ss << "(" << float_exp << ");"; + + make_indent(ss << std::endl); + pre << ss.str(); + out << significand; + return true; +} + bool GeneratorImpl::EmitDataPackingCall(std::ostream& pre, std::ostream& out, ast::CallExpression* expr, @@ -1150,13 +1199,15 @@ std::string GeneratorImpl::generate_builtin_name( const sem::Intrinsic* intrinsic) { std::string out; switch (intrinsic->Type()) { + case sem::IntrinsicType::kAbs: case sem::IntrinsicType::kAcos: - case sem::IntrinsicType::kAny: case sem::IntrinsicType::kAll: + case sem::IntrinsicType::kAny: case sem::IntrinsicType::kAsin: case sem::IntrinsicType::kAtan: case sem::IntrinsicType::kAtan2: case sem::IntrinsicType::kCeil: + case sem::IntrinsicType::kClamp: case sem::IntrinsicType::kCos: case sem::IntrinsicType::kCosh: case sem::IntrinsicType::kCross: @@ -1167,14 +1218,19 @@ std::string GeneratorImpl::generate_builtin_name( case sem::IntrinsicType::kExp2: case sem::IntrinsicType::kFloor: case sem::IntrinsicType::kFma: + case sem::IntrinsicType::kFrexp: case sem::IntrinsicType::kLdexp: case sem::IntrinsicType::kLength: case sem::IntrinsicType::kLog: case sem::IntrinsicType::kLog2: + case sem::IntrinsicType::kMax: + case sem::IntrinsicType::kMin: + case sem::IntrinsicType::kModf: case sem::IntrinsicType::kNormalize: case sem::IntrinsicType::kPow: case sem::IntrinsicType::kReflect: case sem::IntrinsicType::kRound: + case sem::IntrinsicType::kSign: case sem::IntrinsicType::kSin: case sem::IntrinsicType::kSinh: case sem::IntrinsicType::kSqrt: @@ -1183,11 +1239,6 @@ std::string GeneratorImpl::generate_builtin_name( case sem::IntrinsicType::kTanh: case sem::IntrinsicType::kTranspose: case sem::IntrinsicType::kTrunc: - case sem::IntrinsicType::kSign: - case sem::IntrinsicType::kAbs: - case sem::IntrinsicType::kMax: - case sem::IntrinsicType::kMin: - case sem::IntrinsicType::kClamp: out = intrinsic->str(); break; case sem::IntrinsicType::kCountOneBits: diff --git a/src/writer/hlsl/generator_impl.h b/src/writer/hlsl/generator_impl.h index 3c527c76c3..7ce0a43f23 100644 --- a/src/writer/hlsl/generator_impl.h +++ b/src/writer/hlsl/generator_impl.h @@ -139,7 +139,6 @@ class GeneratorImpl : public TextGenerator { std::ostream& out, ast::CallExpression* expr, const sem::Intrinsic* intrinsic); - /// Handles generating a call to the `select()` intrinsic /// @param pre the preamble of the expression stream /// @param out the output of the expression stream @@ -148,7 +147,16 @@ class GeneratorImpl : public TextGenerator { bool EmitSelectCall(std::ostream& pre, std::ostream& out, ast::CallExpression* expr); - + /// Handles generating a call to the `frexp()` intrinsic + /// @param pre the preamble of the expression stream + /// @param out the output of the expression stream + /// @param expr the call expression + /// @param intrinsic the semantic information for the intrinsic + /// @returns true if the call expression is emitted + bool EmitFrexpCall(std::ostream& pre, + std::ostream& out, + ast::CallExpression* expr, + const sem::Intrinsic* intrinsic); /// Handles generating a call to data packing intrinsic /// @param pre the preamble of the expression stream /// @param out the output of the expression stream diff --git a/src/writer/hlsl/generator_impl_intrinsic_test.cc b/src/writer/hlsl/generator_impl_intrinsic_test.cc index c1351b6cdc..c3eb6d1b94 100644 --- a/src/writer/hlsl/generator_impl_intrinsic_test.cc +++ b/src/writer/hlsl/generator_impl_intrinsic_test.cc @@ -257,10 +257,6 @@ TEST_F(HlslGeneratorImplTest_Intrinsic, DISABLED_Intrinsic_IsNormal) { FAIL(); } -TEST_F(HlslGeneratorImplTest_Intrinsic, DISABLED_Intrinsic_Select) { - FAIL(); -} - TEST_F(HlslGeneratorImplTest_Intrinsic, Intrinsic_Call) { auto* call = Call("dot", "param1", "param2"); @@ -297,6 +293,60 @@ TEST_F(HlslGeneratorImplTest_Intrinsic, Select_Vector) { EXPECT_EQ(result(), "(bool2(true, false) ? int2(1, 2) : int2(3, 4))"); } +TEST_F(HlslGeneratorImplTest_Intrinsic, Modf_Scalar) { + auto* res = Var("res", ty.f32()); + auto* call = Call("modf", 1.0f, AddressOf(res)); + WrapInFunction(res, call); + + GeneratorImpl& gen = SanitizeAndBuild(); + + ASSERT_TRUE(gen.Generate(out)) << gen.error(); + EXPECT_THAT(result(), HasSubstr("modf(1.0f, res)")); +} + +TEST_F(HlslGeneratorImplTest_Intrinsic, Modf_Vector) { + auto* res = Var("res", ty.vec3()); + auto* call = Call("modf", vec3(), AddressOf(res)); + WrapInFunction(res, call); + + GeneratorImpl& gen = SanitizeAndBuild(); + + ASSERT_TRUE(gen.Generate(out)) << gen.error(); + EXPECT_THAT(result(), HasSubstr("modf(float3(0.0f, 0.0f, 0.0f), res)")); +} + +TEST_F(HlslGeneratorImplTest_Intrinsic, Frexp_Scalar_i32) { + auto* exp = Var("exp", ty.i32()); + auto* call = Call("frexp", 1.0f, AddressOf(exp)); + WrapInFunction(exp, call); + + GeneratorImpl& gen = SanitizeAndBuild(); + + ASSERT_TRUE(gen.Generate(out)) << gen.error(); + EXPECT_THAT(result(), HasSubstr(R"( + float tint_tmp; + float tint_tmp_1 = frexp(1.0f, tint_tmp); + exp = int(tint_tmp); + (void) tint_tmp_1; +)")); +} + +TEST_F(HlslGeneratorImplTest_Intrinsic, Frexp_Vector_i32) { + auto* res = Var("res", ty.vec3()); + auto* call = Call("frexp", vec3(), AddressOf(res)); + WrapInFunction(res, call); + + GeneratorImpl& gen = SanitizeAndBuild(); + + ASSERT_TRUE(gen.Generate(out)) << gen.error(); + EXPECT_THAT(result(), HasSubstr(R"( + float3 tint_tmp; + float3 tint_tmp_1 = frexp(float3(0.0f, 0.0f, 0.0f), tint_tmp); + res = int3(tint_tmp); + (void) tint_tmp_1; +)")); +} + TEST_F(HlslGeneratorImplTest_Intrinsic, Pack4x8Snorm) { auto* call = Call("pack4x8snorm", "p1"); Global("p1", ty.vec4(), ast::StorageClass::kPrivate); diff --git a/test/intrinsics/frexp.wgsl.expected.hlsl b/test/intrinsics/frexp.wgsl.expected.hlsl index e0f2632880..9ac2398127 100644 --- a/test/intrinsics/frexp.wgsl.expected.hlsl +++ b/test/intrinsics/frexp.wgsl.expected.hlsl @@ -1 +1,10 @@ -SKIP: Failed to generate: error: Unknown builtin method: frexp +[numthreads(1, 1, 1)] +void main() { + int exponent = 0; + float tint_tmp; + float tint_tmp_1 = frexp(1.230000019f, tint_tmp); + exponent = int(tint_tmp); + const float significand = tint_tmp_1; + return; +} + diff --git a/test/intrinsics/gen/frexp/013caa.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/013caa.wgsl.expected.hlsl index 253f138549..ea3a251544 100644 --- a/test/intrinsics/gen/frexp/013caa.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/013caa.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_013caa() { - var arg_1 : vec4; - var res : vec4 = frexp(vec4(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_013caa() { + int4 arg_1 = int4(0, 0, 0, 0); + float4 tint_tmp; + float4 tint_tmp_1 = frexp(float4(0.0f, 0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = int4(tint_tmp); + float4 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_013caa(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_013caa(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_013caa(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/15edf3.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/15edf3.wgsl.expected.hlsl index 7bcdeb1e43..822b133192 100644 --- a/test/intrinsics/gen/frexp/15edf3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/15edf3.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_15edf3() { - var arg_1 : vec2; - var res : vec2 = frexp(vec2(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_15edf3() { + int2 arg_1 = int2(0, 0); + float2 tint_tmp; + float2 tint_tmp_1 = frexp(float2(0.0f, 0.0f), tint_tmp); + arg_1 = int2(tint_tmp); + float2 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_15edf3(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_15edf3(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_15edf3(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/19ab15.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/19ab15.wgsl.expected.hlsl index 48b34c6745..76392a0f66 100644 --- a/test/intrinsics/gen/frexp/19ab15.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/19ab15.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_19ab15() { - var arg_1 : vec4; - var res : vec4 = frexp(vec4(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_19ab15() { + int4 arg_1 = int4(0, 0, 0, 0); + float4 tint_tmp; + float4 tint_tmp_1 = frexp(float4(0.0f, 0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = int4(tint_tmp); + float4 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_19ab15(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_19ab15(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_19ab15(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/2052e9.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/2052e9.wgsl.expected.hlsl index cb57d0693d..47f244cb07 100644 --- a/test/intrinsics/gen/frexp/2052e9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/2052e9.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_2052e9() { - var arg_1 : vec4; - var res : vec4 = frexp(vec4(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_2052e9() { + int4 arg_1 = int4(0, 0, 0, 0); + float4 tint_tmp; + float4 tint_tmp_1 = frexp(float4(0.0f, 0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = int4(tint_tmp); + float4 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_2052e9(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_2052e9(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_2052e9(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/234f02.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/234f02.wgsl.expected.hlsl index 6611fed180..89ce1a0d2b 100644 --- a/test/intrinsics/gen/frexp/234f02.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/234f02.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_234f02() { - var arg_1 : vec4; - var res : vec4 = frexp(vec4(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_234f02() { + uint4 arg_1 = uint4(0u, 0u, 0u, 0u); + float4 tint_tmp; + float4 tint_tmp_1 = frexp(float4(0.0f, 0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = uint4(tint_tmp); + float4 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_234f02(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_234f02(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_234f02(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/2945dc.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/2945dc.wgsl.expected.hlsl index 0b0d3ac2a1..c60fced1e2 100644 --- a/test/intrinsics/gen/frexp/2945dc.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/2945dc.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_2945dc() { - var arg_1 : vec2; - var res : vec2 = frexp(vec2(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_2945dc() { + uint2 arg_1 = uint2(0u, 0u); + float2 tint_tmp; + float2 tint_tmp_1 = frexp(float2(0.0f, 0.0f), tint_tmp); + arg_1 = uint2(tint_tmp); + float2 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_2945dc(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_2945dc(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_2945dc(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/41e931.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/41e931.wgsl.expected.hlsl index a2ddb10d98..29011ade8c 100644 --- a/test/intrinsics/gen/frexp/41e931.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/41e931.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_41e931() { - var arg_1 : i32; - var res : f32 = frexp(1.0, &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_41e931() { + int arg_1 = 0; + float tint_tmp; + float tint_tmp_1 = frexp(1.0f, tint_tmp); + arg_1 = int(tint_tmp); + float res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_41e931(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_41e931(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_41e931(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/481e59.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/481e59.wgsl.expected.hlsl index aed728b1f3..cc4f941955 100644 --- a/test/intrinsics/gen/frexp/481e59.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/481e59.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_481e59() { - var arg_1 : i32; - var res : f32 = frexp(1.0, &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_481e59() { + int arg_1 = 0; + float tint_tmp; + float tint_tmp_1 = frexp(1.0f, tint_tmp); + arg_1 = int(tint_tmp); + float res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_481e59(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_481e59(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_481e59(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/5a141e.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/5a141e.wgsl.expected.hlsl index b10253fa43..4a71307c8c 100644 --- a/test/intrinsics/gen/frexp/5a141e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/5a141e.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_5a141e() { - var arg_1 : vec3; - var res : vec3 = frexp(vec3(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_5a141e() { + int3 arg_1 = int3(0, 0, 0); + float3 tint_tmp; + float3 tint_tmp_1 = frexp(float3(0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = int3(tint_tmp); + float3 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_5a141e(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_5a141e(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_5a141e(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/64e816.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/64e816.wgsl.expected.hlsl index 88bd5b29b9..689fdeaabb 100644 --- a/test/intrinsics/gen/frexp/64e816.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/64e816.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_64e816() { - var arg_1 : vec3; - var res : vec3 = frexp(vec3(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_64e816() { + uint3 arg_1 = uint3(0u, 0u, 0u); + float3 tint_tmp; + float3 tint_tmp_1 = frexp(float3(0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = uint3(tint_tmp); + float3 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_64e816(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_64e816(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_64e816(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/68fc89.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/68fc89.wgsl.expected.hlsl index 47a27bb423..7f021f30a1 100644 --- a/test/intrinsics/gen/frexp/68fc89.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/68fc89.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_68fc89() { - var arg_1 : vec4; - var res : vec4 = frexp(vec4(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_68fc89() { + uint4 arg_1 = uint4(0u, 0u, 0u, 0u); + float4 tint_tmp; + float4 tint_tmp_1 = frexp(float4(0.0f, 0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = uint4(tint_tmp); + float4 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_68fc89(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_68fc89(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_68fc89(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/6d0058.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/6d0058.wgsl.expected.hlsl index 43e0a0704f..d94d417180 100644 --- a/test/intrinsics/gen/frexp/6d0058.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/6d0058.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_6d0058() { - var arg_1 : vec3; - var res : vec3 = frexp(vec3(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_6d0058() { + int3 arg_1 = int3(0, 0, 0); + float3 tint_tmp; + float3 tint_tmp_1 = frexp(float3(0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = int3(tint_tmp); + float3 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_6d0058(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_6d0058(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_6d0058(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/6f0e62.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/6f0e62.wgsl.expected.hlsl index 61f8228fcc..ff4e8f6a12 100644 --- a/test/intrinsics/gen/frexp/6f0e62.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/6f0e62.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_6f0e62() { - var arg_1 : vec4; - var res : vec4 = frexp(vec4(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_6f0e62() { + uint4 arg_1 = uint4(0u, 0u, 0u, 0u); + float4 tint_tmp; + float4 tint_tmp_1 = frexp(float4(0.0f, 0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = uint4(tint_tmp); + float4 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_6f0e62(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_6f0e62(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_6f0e62(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/790800.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/790800.wgsl.expected.hlsl index e6727b9652..c8bd72ded8 100644 --- a/test/intrinsics/gen/frexp/790800.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/790800.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_790800() { - var arg_1 : u32; - var res : f32 = frexp(1.0, &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_790800() { + uint arg_1 = 0u; + float tint_tmp; + float tint_tmp_1 = frexp(1.0f, tint_tmp); + arg_1 = uint(tint_tmp); + float res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_790800(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_790800(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_790800(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/a951b5.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/a951b5.wgsl.expected.hlsl index 14836babe4..ebfed6a0b6 100644 --- a/test/intrinsics/gen/frexp/a951b5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/a951b5.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_a951b5() { - var arg_1 : vec2; - var res : vec2 = frexp(vec2(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_a951b5() { + int2 arg_1 = int2(0, 0); + float2 tint_tmp; + float2 tint_tmp_1 = frexp(float2(0.0f, 0.0f), tint_tmp); + arg_1 = int2(tint_tmp); + float2 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_a951b5(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_a951b5(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_a951b5(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/b2f24a.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/b2f24a.wgsl.expected.hlsl index 4adbecb261..ef8a2e37f4 100644 --- a/test/intrinsics/gen/frexp/b2f24a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/b2f24a.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_b2f24a() { - var arg_1 : u32; - var res : f32 = frexp(1.0, &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_b2f24a() { + uint arg_1 = 0u; + float tint_tmp; + float tint_tmp_1 = frexp(1.0f, tint_tmp); + arg_1 = uint(tint_tmp); + float res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_b2f24a(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_b2f24a(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_b2f24a(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/b9e4de.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/b9e4de.wgsl.expected.hlsl index 5889652618..14d25abbec 100644 --- a/test/intrinsics/gen/frexp/b9e4de.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/b9e4de.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_b9e4de() { - var arg_1 : vec3; - var res : vec3 = frexp(vec3(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_b9e4de() { + int3 arg_1 = int3(0, 0, 0); + float3 tint_tmp; + float3 tint_tmp_1 = frexp(float3(0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = int3(tint_tmp); + float3 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_b9e4de(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_b9e4de(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_b9e4de(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/c51019.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/c51019.wgsl.expected.hlsl index 5aa8fd82f6..95fc70a9b4 100644 --- a/test/intrinsics/gen/frexp/c51019.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/c51019.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_c51019() { - var arg_1 : vec3; - var res : vec3 = frexp(vec3(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_c51019() { + uint3 arg_1 = uint3(0u, 0u, 0u); + float3 tint_tmp; + float3 tint_tmp_1 = frexp(float3(0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = uint3(tint_tmp); + float3 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_c51019(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_c51019(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_c51019(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/d06c2c.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/d06c2c.wgsl.expected.hlsl index 2618017e9a..ad5a6e25e1 100644 --- a/test/intrinsics/gen/frexp/d06c2c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/d06c2c.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_d06c2c() { - var arg_1 : vec2; - var res : vec2 = frexp(vec2(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_d06c2c() { + int2 arg_1 = int2(0, 0); + float2 tint_tmp; + float2 tint_tmp_1 = frexp(float2(0.0f, 0.0f), tint_tmp); + arg_1 = int2(tint_tmp); + float2 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_d06c2c(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_d06c2c(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_d06c2c(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/d68011.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/d68011.wgsl.expected.hlsl index bdc55e209d..37b8d92392 100644 --- a/test/intrinsics/gen/frexp/d68011.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/d68011.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_d68011() { - var arg_1 : vec2; - var res : vec2 = frexp(vec2(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_d68011() { + uint2 arg_1 = uint2(0u, 0u); + float2 tint_tmp; + float2 tint_tmp_1 = frexp(float2(0.0f, 0.0f), tint_tmp); + arg_1 = uint2(tint_tmp); + float2 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_d68011(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_d68011(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_d68011(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/e061dd.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/e061dd.wgsl.expected.hlsl index 26b58feb0f..42cf4dd91f 100644 --- a/test/intrinsics/gen/frexp/e061dd.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/e061dd.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_e061dd() { - var arg_1 : i32; - var res : f32 = frexp(1.0, &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_e061dd() { + int arg_1 = 0; + float tint_tmp; + float tint_tmp_1 = frexp(1.0f, tint_tmp); + arg_1 = int(tint_tmp); + float res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_e061dd(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_e061dd(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_e061dd(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/e9b529.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/e9b529.wgsl.expected.hlsl index ebf37040fa..2e5f8aea37 100644 --- a/test/intrinsics/gen/frexp/e9b529.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/e9b529.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_e9b529() { - var arg_1 : vec3; - var res : vec3 = frexp(vec3(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_e9b529() { + uint3 arg_1 = uint3(0u, 0u, 0u); + float3 tint_tmp; + float3 tint_tmp_1 = frexp(float3(0.0f, 0.0f, 0.0f), tint_tmp); + arg_1 = uint3(tint_tmp); + float3 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_e9b529(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_e9b529(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_e9b529(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/ee3625.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/ee3625.wgsl.expected.hlsl index 03bfe9ed6f..39053bc710 100644 --- a/test/intrinsics/gen/frexp/ee3625.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/ee3625.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_ee3625() { - var arg_1 : vec2; - var res : vec2 = frexp(vec2(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_ee3625() { + uint2 arg_1 = uint2(0u, 0u); + float2 tint_tmp; + float2 tint_tmp_1 = frexp(float2(0.0f, 0.0f), tint_tmp); + arg_1 = uint2(tint_tmp); + float2 res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_ee3625(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_ee3625(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_ee3625(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/fb15f9.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/fb15f9.wgsl.expected.hlsl index 8cd6a16867..55e4853bac 100644 --- a/test/intrinsics/gen/frexp/fb15f9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/frexp/fb15f9.wgsl.expected.hlsl @@ -1,31 +1,29 @@ -SKIP: FAILED - - -fn frexp_fb15f9() { - var arg_1 : u32; - var res : f32 = frexp(1.0, &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void frexp_fb15f9() { + uint arg_1 = 0u; + float tint_tmp; + float tint_tmp_1 = frexp(1.0f, tint_tmp); + arg_1 = uint(tint_tmp); + float res = tint_tmp_1; +} + +tint_symbol vertex_main() { frexp_fb15f9(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { frexp_fb15f9(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { frexp_fb15f9(); + return; } -Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/modf/353f7d.wgsl.expected.hlsl b/test/intrinsics/gen/modf/353f7d.wgsl.expected.hlsl index ece5f6586a..2d9e125f5c 100644 --- a/test/intrinsics/gen/modf/353f7d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/353f7d.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_353f7d() { - var arg_1 : f32; - var res : f32 = modf(1.0, &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_353f7d() { + float arg_1 = 0.0f; + float res = modf(1.0f, arg_1); +} + +tint_symbol vertex_main() { modf_353f7d(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_353f7d(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_353f7d(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/3b79d5.wgsl.expected.hlsl b/test/intrinsics/gen/modf/3b79d5.wgsl.expected.hlsl index ec08b22977..fc102f9a07 100644 --- a/test/intrinsics/gen/modf/3b79d5.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/3b79d5.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_3b79d5() { - var arg_1 : vec3; - var res : vec3 = modf(vec3(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_3b79d5() { + float3 arg_1 = float3(0.0f, 0.0f, 0.0f); + float3 res = modf(float3(0.0f, 0.0f, 0.0f), arg_1); +} + +tint_symbol vertex_main() { modf_3b79d5(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_3b79d5(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_3b79d5(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/4bb324.wgsl.expected.hlsl b/test/intrinsics/gen/modf/4bb324.wgsl.expected.hlsl index 86f45cb166..f204c98e2d 100644 --- a/test/intrinsics/gen/modf/4bb324.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/4bb324.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_4bb324() { - var arg_1 : vec4; - var res : vec4 = modf(vec4(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_4bb324() { + float4 arg_1 = float4(0.0f, 0.0f, 0.0f, 0.0f); + float4 res = modf(float4(0.0f, 0.0f, 0.0f, 0.0f), arg_1); +} + +tint_symbol vertex_main() { modf_4bb324(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_4bb324(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_4bb324(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/4fe3d9.wgsl.expected.hlsl b/test/intrinsics/gen/modf/4fe3d9.wgsl.expected.hlsl index 644a3b111c..a708a27d6d 100644 --- a/test/intrinsics/gen/modf/4fe3d9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/4fe3d9.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_4fe3d9() { - var arg_1 : vec3; - var res : vec3 = modf(vec3(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_4fe3d9() { + float3 arg_1 = float3(0.0f, 0.0f, 0.0f); + float3 res = modf(float3(0.0f, 0.0f, 0.0f), arg_1); +} + +tint_symbol vertex_main() { modf_4fe3d9(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_4fe3d9(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_4fe3d9(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/51e4c6.wgsl.expected.hlsl b/test/intrinsics/gen/modf/51e4c6.wgsl.expected.hlsl index c4a06cef70..d7785bf8dc 100644 --- a/test/intrinsics/gen/modf/51e4c6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/51e4c6.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_51e4c6() { - var arg_1 : vec2; - var res : vec2 = modf(vec2(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_51e4c6() { + float2 arg_1 = float2(0.0f, 0.0f); + float2 res = modf(float2(0.0f, 0.0f), arg_1); +} + +tint_symbol vertex_main() { modf_51e4c6(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_51e4c6(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_51e4c6(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/546e09.wgsl.expected.hlsl b/test/intrinsics/gen/modf/546e09.wgsl.expected.hlsl index 04c6cd4cd2..34c99d8ff1 100644 --- a/test/intrinsics/gen/modf/546e09.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/546e09.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_546e09() { - var arg_1 : f32; - var res : f32 = modf(1.0, &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_546e09() { + float arg_1 = 0.0f; + float res = modf(1.0f, arg_1); +} + +tint_symbol vertex_main() { modf_546e09(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_546e09(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_546e09(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/86441c.wgsl.expected.hlsl b/test/intrinsics/gen/modf/86441c.wgsl.expected.hlsl index 1d242fcb42..7158a0efc1 100644 --- a/test/intrinsics/gen/modf/86441c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/86441c.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_86441c() { - var arg_1 : vec2; - var res : vec2 = modf(vec2(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_86441c() { + float2 arg_1 = float2(0.0f, 0.0f); + float2 res = modf(float2(0.0f, 0.0f), arg_1); +} + +tint_symbol vertex_main() { modf_86441c(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_86441c(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_86441c(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/955651.wgsl.expected.hlsl b/test/intrinsics/gen/modf/955651.wgsl.expected.hlsl index 94f15f683d..b4f93893a5 100644 --- a/test/intrinsics/gen/modf/955651.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/955651.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_955651() { - var arg_1 : vec3; - var res : vec3 = modf(vec3(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_955651() { + float3 arg_1 = float3(0.0f, 0.0f, 0.0f); + float3 res = modf(float3(0.0f, 0.0f, 0.0f), arg_1); +} + +tint_symbol vertex_main() { modf_955651(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_955651(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_955651(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/a54eca.wgsl.expected.hlsl b/test/intrinsics/gen/modf/a54eca.wgsl.expected.hlsl index b5e104ebff..67ab4f52d2 100644 --- a/test/intrinsics/gen/modf/a54eca.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/a54eca.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_a54eca() { - var arg_1 : vec2; - var res : vec2 = modf(vec2(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_a54eca() { + float2 arg_1 = float2(0.0f, 0.0f); + float2 res = modf(float2(0.0f, 0.0f), arg_1); +} + +tint_symbol vertex_main() { modf_a54eca(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_a54eca(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_a54eca(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/d1d6f6.wgsl.expected.hlsl b/test/intrinsics/gen/modf/d1d6f6.wgsl.expected.hlsl index fd38668dd2..5b308469a1 100644 --- a/test/intrinsics/gen/modf/d1d6f6.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/d1d6f6.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_d1d6f6() { - var arg_1 : vec4; - var res : vec4 = modf(vec4(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_d1d6f6() { + float4 arg_1 = float4(0.0f, 0.0f, 0.0f, 0.0f); + float4 res = modf(float4(0.0f, 0.0f, 0.0f, 0.0f), arg_1); +} + +tint_symbol vertex_main() { modf_d1d6f6(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_d1d6f6(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_d1d6f6(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/e83560.wgsl.expected.hlsl b/test/intrinsics/gen/modf/e83560.wgsl.expected.hlsl index c8bf82cc2f..43ea2ba63c 100644 --- a/test/intrinsics/gen/modf/e83560.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/e83560.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_e83560() { - var arg_1 : vec4; - var res : vec4 = modf(vec4(), &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_e83560() { + float4 arg_1 = float4(0.0f, 0.0f, 0.0f, 0.0f); + float4 res = modf(float4(0.0f, 0.0f, 0.0f, 0.0f), arg_1); +} + +tint_symbol vertex_main() { modf_e83560(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_e83560(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_e83560(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/f90945.wgsl.expected.hlsl b/test/intrinsics/gen/modf/f90945.wgsl.expected.hlsl index 1e46e3ad58..2836d0289a 100644 --- a/test/intrinsics/gen/modf/f90945.wgsl.expected.hlsl +++ b/test/intrinsics/gen/modf/f90945.wgsl.expected.hlsl @@ -1,31 +1,26 @@ -SKIP: FAILED - - -fn modf_f90945() { - var arg_1 : f32; - var res : f32 = modf(1.0, &(arg_1)); -} - struct tint_symbol { - [[builtin(position)]] - value : vec4; + float4 value : SV_Position; }; -[[stage(vertex)]] -fn vertex_main() -> tint_symbol { +void modf_f90945() { + float arg_1 = 0.0f; + float res = modf(1.0f, arg_1); +} + +tint_symbol vertex_main() { modf_f90945(); - let tint_symbol_1 : tint_symbol = tint_symbol(vec4()); + const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } -[[stage(fragment)]] -fn fragment_main() { +void fragment_main() { modf_f90945(); + return; } -[[stage(compute)]] -fn compute_main() { +[numthreads(1, 1, 1)] +void compute_main() { modf_f90945(); + return; } -Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/modf.wgsl.expected.hlsl b/test/intrinsics/modf.wgsl.expected.hlsl index e0f2632880..8d67e8a7ab 100644 --- a/test/intrinsics/modf.wgsl.expected.hlsl +++ b/test/intrinsics/modf.wgsl.expected.hlsl @@ -1 +1,7 @@ -SKIP: Failed to generate: error: Unknown builtin method: frexp +[numthreads(1, 1, 1)] +void main() { + float whole = 0.0f; + const float tint_symbol = modf(1.230000019f, whole); + return; +} +