tint/hlsl: implement trunc in terms of floor/ceil to work around FXC bug

Bug: tint:1883
Change-Id: If6c160da0684353a873428a08063aa91ee7a01c4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/125420
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Antonio Maiorano 2023-03-27 18:55:25 +00:00 committed by Dawn LUCI CQ
parent 194abe611b
commit 5cf943e797
51 changed files with 345 additions and 67 deletions

View File

@ -997,6 +997,9 @@ bool GeneratorImpl::EmitBuiltinCall(utils::StringStream& out,
if (type == builtin::Function::kQuantizeToF16) { if (type == builtin::Function::kQuantizeToF16) {
return EmitQuantizeToF16Call(out, expr, builtin); return EmitQuantizeToF16Call(out, expr, builtin);
} }
if (type == builtin::Function::kTrunc) {
return EmitTruncCall(out, expr, builtin);
}
if (builtin->IsDataPacking()) { if (builtin->IsDataPacking()) {
return EmitDataPackingCall(out, expr, builtin); return EmitDataPackingCall(out, expr, builtin);
} }
@ -2116,6 +2119,20 @@ bool GeneratorImpl::EmitQuantizeToF16Call(utils::StringStream& out,
return true; return true;
} }
bool GeneratorImpl::EmitTruncCall(utils::StringStream& out,
const ast::CallExpression* expr,
const sem::Builtin* builtin) {
// HLSL's trunc is broken for very large/small float values.
// See crbug.com/tint/1883
return CallBuiltinHelper( //
out, expr, builtin, [&](TextBuffer* b, const std::vector<std::string>& params) {
// value < 0 ? ceil(value) : floor(value)
line(b) << "return " << params[0] << " < 0 ? ceil(" << params[0] << ") : floor("
<< params[0] << ");";
return true;
});
}
bool GeneratorImpl::EmitDataPackingCall(utils::StringStream& out, bool GeneratorImpl::EmitDataPackingCall(utils::StringStream& out,
const ast::CallExpression* expr, const ast::CallExpression* expr,
const sem::Builtin* builtin) { const sem::Builtin* builtin) {
@ -2704,7 +2721,6 @@ std::string GeneratorImpl::generate_builtin_name(const sem::Builtin* builtin) {
case builtin::Function::kTan: case builtin::Function::kTan:
case builtin::Function::kTanh: case builtin::Function::kTanh:
case builtin::Function::kTranspose: case builtin::Function::kTranspose:
case builtin::Function::kTrunc:
return builtin->str(); return builtin->str();
case builtin::Function::kCountOneBits: // uint case builtin::Function::kCountOneBits: // uint
return "countbits"; return "countbits";

View File

@ -281,6 +281,14 @@ class GeneratorImpl : public TextGenerator {
bool EmitQuantizeToF16Call(utils::StringStream& out, bool EmitQuantizeToF16Call(utils::StringStream& out,
const ast::CallExpression* expr, const ast::CallExpression* expr,
const sem::Builtin* builtin); const sem::Builtin* builtin);
/// Handles generating a call to the `trunc()` intrinsic
/// @param out the output of the expression stream
/// @param expr the call expression
/// @param builtin the semantic information for the builtin
/// @returns true if the call expression is emitted
bool EmitTruncCall(utils::StringStream& out,
const ast::CallExpression* expr,
const sem::Builtin* builtin);
/// Handles generating a call to DP4a builtins (dot4I8Packed and dot4U8Packed) /// Handles generating a call to DP4a builtins (dot4I8Packed and dot4U8Packed)
/// @param out the output of the expression stream /// @param out the output of the expression stream
/// @param expr the call expression /// @param expr the call expression

View File

@ -97,7 +97,6 @@ const ast::CallExpression* GenerateCall(builtin::Function builtin,
case builtin::Function::kSqrt: case builtin::Function::kSqrt:
case builtin::Function::kTan: case builtin::Function::kTan:
case builtin::Function::kTanh: case builtin::Function::kTanh:
case builtin::Function::kTrunc:
if (type == CallParamType::kF16) { if (type == CallParamType::kF16) {
return builder->Call(str.str(), "h2"); return builder->Call(str.str(), "h2");
} else { } else {
@ -309,8 +308,6 @@ INSTANTIATE_TEST_SUITE_P(
BuiltinData{builtin::Function::kTan, CallParamType::kF16, "tan"}, BuiltinData{builtin::Function::kTan, CallParamType::kF16, "tan"},
BuiltinData{builtin::Function::kTanh, CallParamType::kF32, "tanh"}, BuiltinData{builtin::Function::kTanh, CallParamType::kF32, "tanh"},
BuiltinData{builtin::Function::kTanh, CallParamType::kF16, "tanh"}, BuiltinData{builtin::Function::kTanh, CallParamType::kF16, "tanh"},
BuiltinData{builtin::Function::kTrunc, CallParamType::kF32, "trunc"},
BuiltinData{builtin::Function::kTrunc, CallParamType::kF16, "trunc"},
/* Integer built-in */ /* Integer built-in */
BuiltinData{builtin::Function::kAbs, CallParamType::kU32, "abs"}, BuiltinData{builtin::Function::kAbs, CallParamType::kU32, "abs"},
BuiltinData{builtin::Function::kClamp, CallParamType::kU32, "clamp"}, BuiltinData{builtin::Function::kClamp, CallParamType::kU32, "clamp"},
@ -1089,6 +1086,94 @@ void test_function() {
)"); )");
} }
TEST_F(HlslGeneratorImplTest_Builtin, Trunc_Scalar_f32) {
auto* val = Var("val", ty.f32());
auto* call = Call("trunc", val);
WrapInFunction(val, call);
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
[numthreads(1, 1, 1)]
void test_function() {
float val = 0.0f;
const float tint_symbol = tint_trunc(val);
return;
}
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Trunc_Vector_f32) {
auto* val = Var("val", ty.vec3<f32>());
auto* call = Call("trunc", val);
WrapInFunction(val, call);
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
[numthreads(1, 1, 1)]
void test_function() {
float3 val = float3(0.0f, 0.0f, 0.0f);
const float3 tint_symbol = tint_trunc(val);
return;
}
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Trunc_Scalar_f16) {
Enable(builtin::Extension::kF16);
auto* val = Var("val", ty.f16());
auto* call = Call("trunc", val);
WrapInFunction(val, call);
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(float16_t tint_trunc(float16_t param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
[numthreads(1, 1, 1)]
void test_function() {
float16_t val = float16_t(0.0h);
const float16_t tint_symbol = tint_trunc(val);
return;
}
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Trunc_Vector_f16) {
Enable(builtin::Extension::kF16);
auto* val = Var("val", ty.vec3<f16>());
auto* call = Call("trunc", val);
WrapInFunction(val, call);
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(vector<float16_t, 3> tint_trunc(vector<float16_t, 3> param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
[numthreads(1, 1, 1)]
void test_function() {
vector<float16_t, 3> val = vector<float16_t, 3>(float16_t(0.0h), float16_t(0.0h), float16_t(0.0h));
const vector<float16_t, 3> tint_symbol = tint_trunc(val);
return;
}
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Pack4x8Snorm) { TEST_F(HlslGeneratorImplTest_Builtin, Pack4x8Snorm) {
auto* call = Call("pack4x8snorm", "p1"); auto* call = Call("pack4x8snorm", "p1");
GlobalVar("p1", ty.vec4<f32>(), builtin::AddressSpace::kPrivate); GlobalVar("p1", ty.vec4<f32>(), builtin::AddressSpace::kPrivate);

View File

@ -66,8 +66,7 @@ INSTANTIATE_TEST_SUITE_P(HlslGeneratorImplTest_Import,
HlslImportData{"sinh", "sinh"}, HlslImportData{"sinh", "sinh"},
HlslImportData{"sqrt", "sqrt"}, HlslImportData{"sqrt", "sqrt"},
HlslImportData{"tan", "tan"}, HlslImportData{"tan", "tan"},
HlslImportData{"tanh", "tanh"}, HlslImportData{"tanh", "tanh"}));
HlslImportData{"trunc", "trunc"}));
using HlslImportData_SingleIntParamTest = TestParamHelper<HlslImportData>; using HlslImportData_SingleIntParamTest = TestParamHelper<HlslImportData>;
TEST_P(HlslImportData_SingleIntParamTest, IntScalar) { TEST_P(HlslImportData_SingleIntParamTest, IntScalar) {
@ -125,8 +124,7 @@ INSTANTIATE_TEST_SUITE_P(HlslGeneratorImplTest_Import,
HlslImportData{"sinh", "sinh"}, HlslImportData{"sinh", "sinh"},
HlslImportData{"sqrt", "sqrt"}, HlslImportData{"sqrt", "sqrt"},
HlslImportData{"tan", "tan"}, HlslImportData{"tan", "tan"},
HlslImportData{"tanh", "tanh"}, HlslImportData{"tanh", "tanh"}));
HlslImportData{"trunc", "trunc"}));
using HlslImportData_DualParam_ScalarTest = TestParamHelper<HlslImportData>; using HlslImportData_DualParam_ScalarTest = TestParamHelper<HlslImportData>;
TEST_P(HlslImportData_DualParam_ScalarTest, Float) { TEST_P(HlslImportData_DualParam_ScalarTest, Float) {

View File

@ -1,3 +1,7 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
cbuffer cbuffer_x_20 : register(b9, space2) { cbuffer cbuffer_x_20 : register(b9, space2) {
uint4 x_20[8]; uint4 x_20[8];
}; };
@ -34,7 +38,7 @@ float4x4 getFrameData_f1_(inout float frameID) {
} }
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
void main_1() { void main_1() {

View File

@ -1,3 +1,7 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
cbuffer cbuffer_x_20 : register(b9, space2) { cbuffer cbuffer_x_20 : register(b9, space2) {
uint4 x_20[8]; uint4 x_20[8];
}; };
@ -34,7 +38,7 @@ float4x4 getFrameData_f1_(inout float frameID) {
} }
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
void main_1() { void main_1() {

View File

@ -1,8 +1,12 @@
vector<float16_t, 3> tint_trunc(vector<float16_t, 3> param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_103ab8() { void trunc_103ab8() {
vector<float16_t, 3> arg_0 = (float16_t(1.5h)).xxx; vector<float16_t, 3> arg_0 = (float16_t(1.5h)).xxx;
vector<float16_t, 3> res = trunc(arg_0); vector<float16_t, 3> res = tint_trunc(arg_0);
prevent_dce.Store<vector<float16_t, 3> >(0u, res); prevent_dce.Store<vector<float16_t, 3> >(0u, res);
} }

View File

@ -1,8 +1,12 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_562d05() { void trunc_562d05() {
float3 arg_0 = (1.5f).xxx; float3 arg_0 = (1.5f).xxx;
float3 res = trunc(arg_0); float3 res = tint_trunc(arg_0);
prevent_dce.Store3(0u, asuint(res)); prevent_dce.Store3(0u, asuint(res));
} }

View File

@ -1,8 +1,12 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_562d05() { void trunc_562d05() {
float3 arg_0 = (1.5f).xxx; float3 arg_0 = (1.5f).xxx;
float3 res = trunc(arg_0); float3 res = tint_trunc(arg_0);
prevent_dce.Store3(0u, asuint(res)); prevent_dce.Store3(0u, asuint(res));
} }

View File

@ -1,8 +1,12 @@
vector<float16_t, 2> tint_trunc(vector<float16_t, 2> param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_a56109() { void trunc_a56109() {
vector<float16_t, 2> arg_0 = (float16_t(1.5h)).xx; vector<float16_t, 2> arg_0 = (float16_t(1.5h)).xx;
vector<float16_t, 2> res = trunc(arg_0); vector<float16_t, 2> res = tint_trunc(arg_0);
prevent_dce.Store<vector<float16_t, 2> >(0u, res); prevent_dce.Store<vector<float16_t, 2> >(0u, res);
} }

View File

@ -1,8 +1,12 @@
float16_t tint_trunc(float16_t param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_cc2b0d() { void trunc_cc2b0d() {
float16_t arg_0 = float16_t(1.5h); float16_t arg_0 = float16_t(1.5h);
float16_t res = trunc(arg_0); float16_t res = tint_trunc(arg_0);
prevent_dce.Store<float16_t>(0u, res); prevent_dce.Store<float16_t>(0u, res);
} }

View File

@ -1,8 +1,12 @@
vector<float16_t, 4> tint_trunc(vector<float16_t, 4> param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_ce7c17() { void trunc_ce7c17() {
vector<float16_t, 4> arg_0 = (float16_t(1.5h)).xxxx; vector<float16_t, 4> arg_0 = (float16_t(1.5h)).xxxx;
vector<float16_t, 4> res = trunc(arg_0); vector<float16_t, 4> res = tint_trunc(arg_0);
prevent_dce.Store<vector<float16_t, 4> >(0u, res); prevent_dce.Store<vector<float16_t, 4> >(0u, res);
} }

View File

@ -1,8 +1,12 @@
float4 tint_trunc(float4 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_e183aa() { void trunc_e183aa() {
float4 arg_0 = (1.5f).xxxx; float4 arg_0 = (1.5f).xxxx;
float4 res = trunc(arg_0); float4 res = tint_trunc(arg_0);
prevent_dce.Store4(0u, asuint(res)); prevent_dce.Store4(0u, asuint(res));
} }

View File

@ -1,8 +1,12 @@
float4 tint_trunc(float4 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_e183aa() { void trunc_e183aa() {
float4 arg_0 = (1.5f).xxxx; float4 arg_0 = (1.5f).xxxx;
float4 res = trunc(arg_0); float4 res = tint_trunc(arg_0);
prevent_dce.Store4(0u, asuint(res)); prevent_dce.Store4(0u, asuint(res));
} }

View File

@ -1,8 +1,12 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_eb83df() { void trunc_eb83df() {
float arg_0 = 1.5f; float arg_0 = 1.5f;
float res = trunc(arg_0); float res = tint_trunc(arg_0);
prevent_dce.Store(0u, asuint(res)); prevent_dce.Store(0u, asuint(res));
} }

View File

@ -1,8 +1,12 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_eb83df() { void trunc_eb83df() {
float arg_0 = 1.5f; float arg_0 = 1.5f;
float res = trunc(arg_0); float res = tint_trunc(arg_0);
prevent_dce.Store(0u, asuint(res)); prevent_dce.Store(0u, asuint(res));
} }

View File

@ -1,8 +1,12 @@
float2 tint_trunc(float2 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_f370d3() { void trunc_f370d3() {
float2 arg_0 = (1.5f).xx; float2 arg_0 = (1.5f).xx;
float2 res = trunc(arg_0); float2 res = tint_trunc(arg_0);
prevent_dce.Store2(0u, asuint(res)); prevent_dce.Store2(0u, asuint(res));
} }

View File

@ -1,8 +1,12 @@
float2 tint_trunc(float2 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
RWByteAddressBuffer prevent_dce : register(u0, space2); RWByteAddressBuffer prevent_dce : register(u0, space2);
void trunc_f370d3() { void trunc_f370d3() {
float2 arg_0 = (1.5f).xx; float2 arg_0 = (1.5f).xx;
float2 res = trunc(arg_0); float2 res = tint_trunc(arg_0);
prevent_dce.Store2(0u, asuint(res)); prevent_dce.Store2(0u, asuint(res));
} }

View File

@ -1,5 +1,9 @@
float16_t tint_trunc(float16_t param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float16_t tint_float_mod(float16_t lhs, float16_t rhs) { float16_t tint_float_mod(float16_t lhs, float16_t rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,6 +1,10 @@
vector<float16_t, 3> tint_trunc(vector<float16_t, 3> param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
vector<float16_t, 3> tint_float_mod(float16_t lhs, vector<float16_t, 3> rhs) { vector<float16_t, 3> tint_float_mod(float16_t lhs, vector<float16_t, 3> rhs) {
const vector<float16_t, 3> l = vector<float16_t, 3>((lhs).xxx); const vector<float16_t, 3> l = vector<float16_t, 3>((lhs).xxx);
return (l - (trunc((l / rhs)) * rhs)); return (l - (tint_trunc((l / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,6 +1,10 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float lhs, float3 rhs) { float3 tint_float_mod(float lhs, float3 rhs) {
const float3 l = float3((lhs).xxx); const float3 l = float3((lhs).xxx);
return (l - (trunc((l / rhs)) * rhs)); return (l - (tint_trunc((l / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,6 +1,10 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float lhs, float3 rhs) { float3 tint_float_mod(float lhs, float3 rhs) {
const float3 l = float3((lhs).xxx); const float3 l = float3((lhs).xxx);
return (l - (trunc((l / rhs)) * rhs)); return (l - (tint_trunc((l / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,6 +1,10 @@
vector<float16_t, 3> tint_trunc(vector<float16_t, 3> param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
vector<float16_t, 3> tint_float_mod(vector<float16_t, 3> lhs, float16_t rhs) { vector<float16_t, 3> tint_float_mod(vector<float16_t, 3> lhs, float16_t rhs) {
const vector<float16_t, 3> r = vector<float16_t, 3>((rhs).xxx); const vector<float16_t, 3> r = vector<float16_t, 3>((rhs).xxx);
return (lhs - (trunc((lhs / r)) * r)); return (lhs - (tint_trunc((lhs / r)) * r));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,6 +1,10 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float3 lhs, float rhs) { float3 tint_float_mod(float3 lhs, float rhs) {
const float3 r = float3((rhs).xxx); const float3 r = float3((rhs).xxx);
return (lhs - (trunc((lhs / r)) * r)); return (lhs - (tint_trunc((lhs / r)) * r));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,6 +1,10 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float3 lhs, float rhs) { float3 tint_float_mod(float3 lhs, float rhs) {
const float3 r = float3((rhs).xxx); const float3 r = float3((rhs).xxx);
return (lhs - (trunc((lhs / r)) * r)); return (lhs - (tint_trunc((lhs / r)) * r));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
vector<float16_t, 3> tint_trunc(vector<float16_t, 3> param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
vector<float16_t, 3> tint_float_mod(vector<float16_t, 3> lhs, vector<float16_t, 3> rhs) { vector<float16_t, 3> tint_float_mod(vector<float16_t, 3> lhs, vector<float16_t, 3> rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float3 lhs, float3 rhs) { float3 tint_float_mod(float3 lhs, float3 rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float3 lhs, float3 rhs) { float3 tint_float_mod(float3 lhs, float3 rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float16_t tint_trunc(float16_t param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float16_t tint_float_mod(float16_t lhs, float16_t rhs) { float16_t tint_float_mod(float16_t lhs, float16_t rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
vector<float16_t, 3> tint_trunc(vector<float16_t, 3> param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
vector<float16_t, 3> tint_float_mod(vector<float16_t, 3> lhs, vector<float16_t, 3> rhs) { vector<float16_t, 3> tint_float_mod(vector<float16_t, 3> lhs, vector<float16_t, 3> rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float3 lhs, float3 rhs) { float3 tint_float_mod(float3 lhs, float3 rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float3 lhs, float3 rhs) { float3 tint_float_mod(float3 lhs, float3 rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float16_t tint_trunc(float16_t param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float16_t tint_float_mod(float16_t lhs, float16_t rhs) { float16_t tint_float_mod(float16_t lhs, float16_t rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
vector<float16_t, 3> tint_trunc(vector<float16_t, 3> param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
vector<float16_t, 3> tint_float_mod(vector<float16_t, 3> lhs, vector<float16_t, 3> rhs) { vector<float16_t, 3> tint_float_mod(vector<float16_t, 3> lhs, vector<float16_t, 3> rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float3 lhs, float3 rhs) { float3 tint_float_mod(float3 lhs, float3 rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float3 lhs, float3 rhs) { float3 tint_float_mod(float3 lhs, float3 rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float16_t tint_trunc(float16_t param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float16_t tint_float_mod(float16_t lhs, float16_t rhs) { float16_t tint_float_mod(float16_t lhs, float16_t rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
vector<float16_t, 3> tint_trunc(vector<float16_t, 3> param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
vector<float16_t, 3> tint_float_mod(vector<float16_t, 3> lhs, vector<float16_t, 3> rhs) { vector<float16_t, 3> tint_float_mod(vector<float16_t, 3> lhs, vector<float16_t, 3> rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float3 lhs, float3 rhs) { float3 tint_float_mod(float3 lhs, float3 rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,5 +1,9 @@
float3 tint_trunc(float3 param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
float3 tint_float_mod(float3 lhs, float3 rhs) { float3 tint_float_mod(float3 lhs, float3 rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]

View File

@ -1,3 +1,7 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]
void unused_entry_point() { void unused_entry_point() {
return; return;
@ -20,7 +24,7 @@ int tint_mod(int lhs, int rhs) {
} }
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
void foo(int maybe_zero) { void foo(int maybe_zero) {

View File

@ -1,3 +1,7 @@
float tint_trunc(float param_0) {
return param_0 < 0 ? ceil(param_0) : floor(param_0);
}
[numthreads(1, 1, 1)] [numthreads(1, 1, 1)]
void unused_entry_point() { void unused_entry_point() {
return; return;
@ -20,7 +24,7 @@ int tint_mod(int lhs, int rhs) {
} }
float tint_float_mod(float lhs, float rhs) { float tint_float_mod(float lhs, float rhs) {
return (lhs - (trunc((lhs / rhs)) * rhs)); return (lhs - (tint_trunc((lhs / rhs)) * rhs));
} }
void foo(int maybe_zero) { void foo(int maybe_zero) {

View File

@ -718,19 +718,6 @@ crbug.com/dawn/0000 [ amd-0x67ef dawn-no-backend-validation ventura ] webgpu:sha
crbug.com/dawn/0000 [ amd-0x67ef dawn-backend-validation ventura ] webgpu:shader,execution,expression,binary,f32_arithmetic:addition:inputSource="uniform";vectorize="_undef_" [ Failure ] crbug.com/dawn/0000 [ amd-0x67ef dawn-backend-validation ventura ] webgpu:shader,execution,expression,binary,f32_arithmetic:addition:inputSource="uniform";vectorize="_undef_" [ Failure ]
crbug.com/dawn/0000 [ dawn-no-backend-validation intel-0x9bc5 ubuntu ] webgpu:shader,execution,expression,binary,f32_arithmetic:addition_compound:inputSource="const";vectorize=3 [ Slow ] crbug.com/dawn/0000 [ dawn-no-backend-validation intel-0x9bc5 ubuntu ] webgpu:shader,execution,expression,binary,f32_arithmetic:addition_compound:inputSource="const";vectorize=3 [ Slow ]
crbug.com/dawn/0000 [ dawn-backend-validation intel-0x3e9b monterey ] webgpu:shader,execution,expression,binary,f32_arithmetic:addition_scalar_vector:inputSource="storage_rw";dim=2 [ Failure ] crbug.com/dawn/0000 [ dawn-backend-validation intel-0x3e9b monterey ] webgpu:shader,execution,expression,binary,f32_arithmetic:addition_scalar_vector:inputSource="storage_rw";dim=2 [ Failure ]
crbug.com/dawn/0000 [ dawn-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize="_undef_" [ Failure ]
crbug.com/dawn/0000 [ dawn-no-backend-validation intel-0x9bc5 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize="_undef_" [ Failure ]
crbug.com/dawn/0000 [ dawn-no-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize="_undef_" [ Failure ]
crbug.com/dawn/0000 [ dawn-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize=2 [ Failure ]
crbug.com/dawn/0000 [ dawn-no-backend-validation intel-0x9bc5 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize=2 [ Failure ]
crbug.com/dawn/0000 [ dawn-no-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize=2 [ Failure ]
crbug.com/dawn/0000 [ dawn-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize=3 [ Failure ]
crbug.com/dawn/0000 [ dawn-no-backend-validation intel-0x9bc5 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize=3 [ Failure ]
crbug.com/dawn/0000 [ dawn-no-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize=3 [ Failure ]
crbug.com/dawn/0000 [ dawn-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize=4 [ Failure ]
crbug.com/dawn/0000 [ dawn-no-backend-validation intel-0x9bc5 ubuntu ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize=4 [ Slow ]
crbug.com/dawn/0000 [ dawn-no-backend-validation intel-0x9bc5 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize=4 [ Failure ]
crbug.com/dawn/0000 [ dawn-no-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_compound:inputSource="const";vectorize=4 [ Failure ]
crbug.com/dawn/0000 [ dawn-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_vector_scalar_compound:inputSource="const";dim=2 [ Failure ] crbug.com/dawn/0000 [ dawn-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_vector_scalar_compound:inputSource="const";dim=2 [ Failure ]
crbug.com/dawn/0000 [ dawn-no-backend-validation intel-0x9bc5 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_vector_scalar_compound:inputSource="const";dim=2 [ Failure ] crbug.com/dawn/0000 [ dawn-no-backend-validation intel-0x9bc5 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_vector_scalar_compound:inputSource="const";dim=2 [ Failure ]
crbug.com/dawn/0000 [ dawn-no-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_vector_scalar_compound:inputSource="const";dim=2 [ Failure ] crbug.com/dawn/0000 [ dawn-no-backend-validation nvidia-0x2184 win10 ] webgpu:shader,execution,expression,binary,f32_arithmetic:remainder_vector_scalar_compound:inputSource="const";dim=2 [ Failure ]