tint: Implement modf and frexp built-ins for f16 types

This patch implement modf and frexp built-ins for f16 types, and also
simplify their implementation for f32 in MSL and HLSL, and clean up
deprecated code in GLSL writer. Corresponding unittests are also
implemented, but end-to-end tests for f16 are not implemented yet.

Bug: tint:1473, tint:1502
Change-Id: I12887ae5303c6dc032a51f619e1afeb19b4603b6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/98102
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Zhaoming Jiang 2022-08-05 15:11:44 +00:00 committed by Dawn LUCI CQ
parent 1cd4706f85
commit 20cddbf04c
130 changed files with 2519 additions and 1775 deletions

View File

@ -148,10 +148,10 @@ type texture_storage_2d_array<F: texel_format, A: access>
type texture_storage_3d<F: texel_format, A: access>
type texture_external
type __modf_result
@display("__modf_result_vec{N}") type __modf_result_vec<N: num>
type __frexp_result
@display("__frexp_result_vec{N}") type __frexp_result_vec<N: num>
@display("__modf_result_{T}") type __modf_result<T>
@display("__modf_result_vec{N}_{T}") type __modf_result_vec<N: num, T>
@display("__frexp_result_{T}") type __frexp_result<T>
@display("__frexp_result_vec{N}_{T}") type __frexp_result_vec<N: num, T>
type __atomic_compare_exchange_result<T>
@ -463,8 +463,8 @@ fn fma<T: f32_f16>(T, T, T) -> T
fn fma<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T>
fn fract<T: f32_f16>(T) -> T
fn fract<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
fn frexp(f32) -> __frexp_result
fn frexp<N: num>(vec<N, f32>) -> __frexp_result_vec<N>
fn frexp<T: f32_f16>(T) -> __frexp_result<T>
fn frexp<N: num, T: f32_f16>(vec<N, T>) -> __frexp_result_vec<N, T>
@stage("fragment") fn fwidth(f32) -> f32
@stage("fragment") fn fwidth<N: num>(vec<N, f32>) -> vec<N, f32>
@stage("fragment") fn fwidthCoarse(f32) -> f32
@ -490,8 +490,8 @@ fn min<N: num, T: fiu32_f16>(vec<N, T>, vec<N, T>) -> vec<N, T>
fn mix<T: f32_f16>(T, T, T) -> T
fn mix<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T>
fn mix<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T>
fn modf(f32) -> __modf_result
fn modf<N: num>(vec<N, f32>) -> __modf_result_vec<N>
fn modf<T: f32_f16>(T) -> __modf_result<T>
fn modf<N: num, T: f32_f16>(vec<N, T>) -> __modf_result_vec<N, T>
fn normalize<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
fn pack2x16float(vec2<f32>) -> u32
fn pack2x16snorm(vec2<f32>) -> u32

View File

@ -901,8 +901,9 @@ TEST_F(ResolverBuiltinFloatTest, Distance_NoParams) {
)");
}
// frexp: (f32) -> __frexp_result, (vecN<f32>) -> __frexp_result_vecN
TEST_F(ResolverBuiltinFloatTest, FrexpScalar) {
// frexp: (f32) -> __frexp_result, (vecN<f32>) -> __frexp_result_vecN, (f16) -> __frexp_result_16,
// (vecN<f16>) -> __frexp_result_vecN_f16
TEST_F(ResolverBuiltinFloatTest, FrexpScalar_f32) {
auto* call = Call("frexp", 1_f);
WrapInFunction(call);
@ -931,7 +932,38 @@ TEST_F(ResolverBuiltinFloatTest, FrexpScalar) {
EXPECT_EQ(ty->SizeNoPadding(), 8u);
}
TEST_F(ResolverBuiltinFloatTest, FrexpVector) {
TEST_F(ResolverBuiltinFloatTest, FrexpScalar_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("frexp", 1_h);
WrapInFunction(call);
EXPECT_TRUE(r()->Resolve()) << r()->error();
ASSERT_NE(TypeOf(call), nullptr);
auto* ty = TypeOf(call)->As<sem::Struct>();
ASSERT_NE(ty, nullptr);
ASSERT_EQ(ty->Members().size(), 2u);
auto* sig = ty->Members()[0];
EXPECT_TRUE(sig->Type()->Is<sem::F16>());
EXPECT_EQ(sig->Offset(), 0u);
EXPECT_EQ(sig->Size(), 2u);
EXPECT_EQ(sig->Align(), 2u);
EXPECT_EQ(sig->Name(), Sym("sig"));
auto* exp = ty->Members()[1];
EXPECT_TRUE(exp->Type()->Is<sem::I32>());
EXPECT_EQ(exp->Offset(), 4u);
EXPECT_EQ(exp->Size(), 4u);
EXPECT_EQ(exp->Align(), 4u);
EXPECT_EQ(exp->Name(), Sym("exp"));
EXPECT_EQ(ty->Size(), 8u);
EXPECT_EQ(ty->SizeNoPadding(), 8u);
}
TEST_F(ResolverBuiltinFloatTest, FrexpVector_f32) {
auto* call = Call("frexp", vec3<f32>());
WrapInFunction(call);
@ -964,6 +996,41 @@ TEST_F(ResolverBuiltinFloatTest, FrexpVector) {
EXPECT_EQ(ty->SizeNoPadding(), 28u);
}
TEST_F(ResolverBuiltinFloatTest, FrexpVector_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("frexp", vec3<f16>());
WrapInFunction(call);
EXPECT_TRUE(r()->Resolve()) << r()->error();
ASSERT_NE(TypeOf(call), nullptr);
auto* ty = TypeOf(call)->As<sem::Struct>();
ASSERT_NE(ty, nullptr);
ASSERT_EQ(ty->Members().size(), 2u);
auto* sig = ty->Members()[0];
ASSERT_TRUE(sig->Type()->Is<sem::Vector>());
EXPECT_EQ(sig->Type()->As<sem::Vector>()->Width(), 3u);
EXPECT_TRUE(sig->Type()->As<sem::Vector>()->type()->Is<sem::F16>());
EXPECT_EQ(sig->Offset(), 0u);
EXPECT_EQ(sig->Size(), 6u);
EXPECT_EQ(sig->Align(), 8u);
EXPECT_EQ(sig->Name(), Sym("sig"));
auto* exp = ty->Members()[1];
ASSERT_TRUE(exp->Type()->Is<sem::Vector>());
EXPECT_EQ(exp->Type()->As<sem::Vector>()->Width(), 3u);
EXPECT_TRUE(exp->Type()->As<sem::Vector>()->type()->Is<sem::I32>());
EXPECT_EQ(exp->Offset(), 16u);
EXPECT_EQ(exp->Size(), 12u);
EXPECT_EQ(exp->Align(), 16u);
EXPECT_EQ(exp->Name(), Sym("exp"));
EXPECT_EQ(ty->Size(), 32u);
EXPECT_EQ(ty->SizeNoPadding(), 28u);
}
TEST_F(ResolverBuiltinFloatTest, Frexp_Error_FirstParamInt) {
GlobalVar("v", ty.i32(), ast::StorageClass::kWorkgroup);
auto* call = Call("frexp", 1_i, AddressOf("v"));
@ -975,8 +1042,8 @@ TEST_F(ResolverBuiltinFloatTest, Frexp_Error_FirstParamInt) {
R"(error: no matching call to frexp(i32, ptr<workgroup, i32, read_write>)
2 candidate functions:
frexp(f32) -> __frexp_result
frexp(vecN<f32>) -> __frexp_result_vecN
frexp(T) -> __frexp_result_T where: T is f32 or f16
frexp(vecN<T>) -> __frexp_result_vecN_T where: T is f32 or f16
)");
}
@ -991,8 +1058,8 @@ TEST_F(ResolverBuiltinFloatTest, Frexp_Error_SecondParamFloatPtr) {
R"(error: no matching call to frexp(f32, ptr<workgroup, f32, read_write>)
2 candidate functions:
frexp(f32) -> __frexp_result
frexp(vecN<f32>) -> __frexp_result_vecN
frexp(T) -> __frexp_result_T where: T is f32 or f16
frexp(vecN<T>) -> __frexp_result_vecN_T where: T is f32 or f16
)");
}
@ -1005,8 +1072,8 @@ TEST_F(ResolverBuiltinFloatTest, Frexp_Error_SecondParamNotAPointer) {
EXPECT_EQ(r()->error(), R"(error: no matching call to frexp(f32, i32)
2 candidate functions:
frexp(f32) -> __frexp_result
frexp(vecN<f32>) -> __frexp_result_vecN
frexp(T) -> __frexp_result_T where: T is f32 or f16
frexp(vecN<T>) -> __frexp_result_vecN_T where: T is f32 or f16
)");
}
@ -1021,8 +1088,8 @@ TEST_F(ResolverBuiltinFloatTest, Frexp_Error_VectorSizesDontMatch) {
R"(error: no matching call to frexp(vec2<f32>, ptr<workgroup, vec4<i32>, read_write>)
2 candidate functions:
frexp(vecN<f32>) -> __frexp_result_vecN
frexp(f32) -> __frexp_result
frexp(T) -> __frexp_result_T where: T is f32 or f16
frexp(vecN<T>) -> __frexp_result_vecN_T where: T is f32 or f16
)");
}
@ -1129,8 +1196,9 @@ TEST_F(ResolverBuiltinFloatTest, Mix_VectorScalar_f16) {
EXPECT_TRUE(TypeOf(call)->As<sem::Vector>()->type()->Is<sem::F16>());
}
// modf: (f32) -> __modf_result, (vecN<f32>) -> __modf_result_vecN
TEST_F(ResolverBuiltinFloatTest, ModfScalar) {
// modf: (f32) -> __modf_result, (vecN<f32>) -> __modf_result_vecN, (f16) -> __modf_result_f16,
// (vecN<f16>) -> __modf_result_vecN_f16
TEST_F(ResolverBuiltinFloatTest, ModfScalar_f32) {
auto* call = Call("modf", 1_f);
WrapInFunction(call);
@ -1159,7 +1227,38 @@ TEST_F(ResolverBuiltinFloatTest, ModfScalar) {
EXPECT_EQ(ty->SizeNoPadding(), 8u);
}
TEST_F(ResolverBuiltinFloatTest, ModfVector) {
TEST_F(ResolverBuiltinFloatTest, ModfScalar_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("modf", 1_h);
WrapInFunction(call);
EXPECT_TRUE(r()->Resolve()) << r()->error();
ASSERT_NE(TypeOf(call), nullptr);
auto* ty = TypeOf(call)->As<sem::Struct>();
ASSERT_NE(ty, nullptr);
ASSERT_EQ(ty->Members().size(), 2u);
auto* fract = ty->Members()[0];
EXPECT_TRUE(fract->Type()->Is<sem::F16>());
EXPECT_EQ(fract->Offset(), 0u);
EXPECT_EQ(fract->Size(), 2u);
EXPECT_EQ(fract->Align(), 2u);
EXPECT_EQ(fract->Name(), Sym("fract"));
auto* whole = ty->Members()[1];
EXPECT_TRUE(whole->Type()->Is<sem::F16>());
EXPECT_EQ(whole->Offset(), 2u);
EXPECT_EQ(whole->Size(), 2u);
EXPECT_EQ(whole->Align(), 2u);
EXPECT_EQ(whole->Name(), Sym("whole"));
EXPECT_EQ(ty->Size(), 4u);
EXPECT_EQ(ty->SizeNoPadding(), 4u);
}
TEST_F(ResolverBuiltinFloatTest, ModfVector_f32) {
auto* call = Call("modf", vec3<f32>());
WrapInFunction(call);
@ -1192,6 +1291,41 @@ TEST_F(ResolverBuiltinFloatTest, ModfVector) {
EXPECT_EQ(ty->SizeNoPadding(), 28u);
}
TEST_F(ResolverBuiltinFloatTest, ModfVector_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("modf", vec3<f16>());
WrapInFunction(call);
EXPECT_TRUE(r()->Resolve()) << r()->error();
ASSERT_NE(TypeOf(call), nullptr);
auto* ty = TypeOf(call)->As<sem::Struct>();
ASSERT_NE(ty, nullptr);
ASSERT_EQ(ty->Members().size(), 2u);
auto* fract = ty->Members()[0];
ASSERT_TRUE(fract->Type()->Is<sem::Vector>());
EXPECT_EQ(fract->Type()->As<sem::Vector>()->Width(), 3u);
EXPECT_TRUE(fract->Type()->As<sem::Vector>()->type()->Is<sem::F16>());
EXPECT_EQ(fract->Offset(), 0u);
EXPECT_EQ(fract->Size(), 6u);
EXPECT_EQ(fract->Align(), 8u);
EXPECT_EQ(fract->Name(), Sym("fract"));
auto* whole = ty->Members()[1];
ASSERT_TRUE(whole->Type()->Is<sem::Vector>());
EXPECT_EQ(whole->Type()->As<sem::Vector>()->Width(), 3u);
EXPECT_TRUE(whole->Type()->As<sem::Vector>()->type()->Is<sem::F16>());
EXPECT_EQ(whole->Offset(), 8u);
EXPECT_EQ(whole->Size(), 6u);
EXPECT_EQ(whole->Align(), 8u);
EXPECT_EQ(whole->Name(), Sym("whole"));
EXPECT_EQ(ty->Size(), 16u);
EXPECT_EQ(ty->SizeNoPadding(), 14u);
}
TEST_F(ResolverBuiltinFloatTest, Modf_Error_FirstParamInt) {
GlobalVar("whole", ty.f32(), ast::StorageClass::kWorkgroup);
auto* call = Call("modf", 1_i, AddressOf("whole"));
@ -1203,8 +1337,8 @@ TEST_F(ResolverBuiltinFloatTest, Modf_Error_FirstParamInt) {
R"(error: no matching call to modf(i32, ptr<workgroup, f32, read_write>)
2 candidate functions:
modf(f32) -> __modf_result
modf(vecN<f32>) -> __modf_result_vecN
modf(T) -> __modf_result_T where: T is f32 or f16
modf(vecN<T>) -> __modf_result_vecN_T where: T is f32 or f16
)");
}
@ -1219,8 +1353,8 @@ TEST_F(ResolverBuiltinFloatTest, Modf_Error_SecondParamIntPtr) {
R"(error: no matching call to modf(f32, ptr<workgroup, i32, read_write>)
2 candidate functions:
modf(f32) -> __modf_result
modf(vecN<f32>) -> __modf_result_vecN
modf(T) -> __modf_result_T where: T is f32 or f16
modf(vecN<T>) -> __modf_result_vecN_T where: T is f32 or f16
)");
}
@ -1233,8 +1367,8 @@ TEST_F(ResolverBuiltinFloatTest, Modf_Error_SecondParamNotAPointer) {
EXPECT_EQ(r()->error(), R"(error: no matching call to modf(f32, f32)
2 candidate functions:
modf(f32) -> __modf_result
modf(vecN<f32>) -> __modf_result_vecN
modf(T) -> __modf_result_T where: T is f32 or f16
modf(vecN<T>) -> __modf_result_vecN_T where: T is f32 or f16
)");
}
@ -1249,8 +1383,8 @@ TEST_F(ResolverBuiltinFloatTest, Modf_Error_VectorSizesDontMatch) {
R"(error: no matching call to modf(vec2<f32>, ptr<workgroup, vec4<f32>, read_write>)
2 candidate functions:
modf(vecN<f32>) -> __modf_result_vecN
modf(f32) -> __modf_result
modf(T) -> __modf_result_T where: T is f32 or f16
modf(vecN<T>) -> __modf_result_vecN_T where: T is f32 or f16
)");
}

View File

@ -732,24 +732,34 @@ const sem::ExternalTexture* build_texture_external(MatchState& state) {
// Builtin types starting with a _ prefix cannot be declared in WGSL, so they
// can only be used as return types. Because of this, they must only match Any,
// which is used as the return type matcher.
bool match_modf_result(const sem::Type* ty) {
return ty->Is<Any>();
}
bool match_modf_result_vec(const sem::Type* ty, Number& N) {
bool match_modf_result(const sem::Type* ty, const sem::Type*& T) {
if (!ty->Is<Any>()) {
return false;
}
N = Number::any;
T = ty;
return true;
}
bool match_frexp_result(const sem::Type* ty) {
return ty->Is<Any>();
}
bool match_frexp_result_vec(const sem::Type* ty, Number& N) {
bool match_modf_result_vec(const sem::Type* ty, Number& N, const sem::Type*& T) {
if (!ty->Is<Any>()) {
return false;
}
N = Number::any;
T = ty;
return true;
}
bool match_frexp_result(const sem::Type* ty, const sem::Type*& T) {
if (!ty->Is<Any>()) {
return false;
}
T = ty;
return true;
}
bool match_frexp_result_vec(const sem::Type* ty, Number& N, const sem::Type*& T) {
if (!ty->Is<Any>()) {
return false;
}
N = Number::any;
T = ty;
return true;
}
@ -763,7 +773,7 @@ bool match_atomic_compare_exchange_result(const sem::Type* ty, const sem::Type*&
struct NameAndType {
std::string name;
sem::Type* type;
const sem::Type* type;
};
const sem::Struct* build_struct(MatchState& state,
std::string name,
@ -797,27 +807,46 @@ const sem::Struct* build_struct(MatchState& state,
/* size_no_padding */ size_without_padding);
}
const sem::Struct* build_modf_result(MatchState& state) {
auto* f32 = state.builder.create<sem::F32>();
return build_struct(state, "__modf_result", {{"fract", f32}, {"whole", f32}});
const sem::Struct* build_modf_result(MatchState& state, const sem::Type* el) {
std::string display_name;
if (el->Is<sem::F16>()) {
display_name = "__modf_result_f16";
} else {
display_name = "__modf_result";
}
return build_struct(state, display_name, {{"fract", el}, {"whole", el}});
}
const sem::Struct* build_modf_result_vec(MatchState& state, Number& n) {
auto* vec_f32 = state.builder.create<sem::Vector>(state.builder.create<sem::F32>(), n.Value());
return build_struct(state, "__modf_result_vec" + std::to_string(n.Value()),
{{"fract", vec_f32}, {"whole", vec_f32}});
const sem::Struct* build_modf_result_vec(MatchState& state, Number& n, const sem::Type* el) {
std::string display_name;
if (el->Is<sem::F16>()) {
display_name = "__modf_result_vec" + std::to_string(n.Value()) + "_f16";
} else {
display_name = "__modf_result_vec" + std::to_string(n.Value());
}
auto* vec = state.builder.create<sem::Vector>(el, n.Value());
return build_struct(state, display_name, {{"fract", vec}, {"whole", vec}});
}
const sem::Struct* build_frexp_result(MatchState& state) {
auto* f32 = state.builder.create<sem::F32>();
const sem::Struct* build_frexp_result(MatchState& state, const sem::Type* el) {
std::string display_name;
if (el->Is<sem::F16>()) {
display_name = "__frexp_result_f16";
} else {
display_name = "__frexp_result";
}
auto* i32 = state.builder.create<sem::I32>();
return build_struct(state, "__frexp_result", {{"sig", f32}, {"exp", i32}});
return build_struct(state, display_name, {{"sig", el}, {"exp", i32}});
}
const sem::Struct* build_frexp_result_vec(MatchState& state, Number& n) {
auto* vec_f32 = state.builder.create<sem::Vector>(state.builder.create<sem::F32>(), n.Value());
const sem::Struct* build_frexp_result_vec(MatchState& state, Number& n, const sem::Type* el) {
std::string display_name;
if (el->Is<sem::F16>()) {
display_name = "__frexp_result_vec" + std::to_string(n.Value()) + "_f16";
} else {
display_name = "__frexp_result_vec" + std::to_string(n.Value());
}
auto* vec = state.builder.create<sem::Vector>(el, n.Value());
auto* vec_i32 = state.builder.create<sem::Vector>(state.builder.create<sem::I32>(), n.Value());
return build_struct(state, "__frexp_result_vec" + std::to_string(n.Value()),
{{"sig", vec_f32}, {"exp", vec_i32}});
return build_struct(state, display_name, {{"sig", vec}, {"exp", vec_i32}});
}
const sem::Struct* build_atomic_compare_exchange_result(MatchState& state, const sem::Type* ty) {
return build_struct(
state, "__atomic_compare_exchange_result" + ty->FriendlyName(state.builder.Symbols()),

File diff suppressed because it is too large Load Diff

View File

@ -1205,97 +1205,51 @@ bool GeneratorImpl::EmitDotCall(std::ostream& out,
bool GeneratorImpl::EmitModfCall(std::ostream& out,
const ast::CallExpression* expr,
const sem::Builtin* builtin) {
if (expr->args.Length() == 1) {
return CallBuiltinHelper(
out, expr, builtin, [&](TextBuffer* b, const std::vector<std::string>& params) {
// Emit the builtin return type unique to this overload. This does not
// exist in the AST, so it will not be generated in Generate().
if (!EmitStructType(&helpers_, builtin->ReturnType()->As<sem::Struct>())) {
TINT_ASSERT(Writer, expr->args.Length() == 1);
return CallBuiltinHelper(
out, expr, builtin, [&](TextBuffer* b, const std::vector<std::string>& params) {
// Emit the builtin return type unique to this overload. This does not
// exist in the AST, so it will not be generated in Generate().
if (!EmitStructType(&helpers_, builtin->ReturnType()->As<sem::Struct>())) {
return false;
}
{
auto l = line(b);
if (!EmitType(l, builtin->ReturnType(), ast::StorageClass::kNone,
ast::Access::kUndefined, "")) {
return false;
}
{
auto l = line(b);
if (!EmitType(l, builtin->ReturnType(), ast::StorageClass::kNone,
ast::Access::kUndefined, "")) {
return false;
}
l << " result;";
}
line(b) << "result.fract = modf(" << params[0] << ", result.whole);";
line(b) << "return result;";
return true;
});
}
// DEPRECATED
out << "modf";
ScopedParen sp(out);
if (!EmitExpression(out, expr->args[0])) {
return false;
}
out << ", ";
if (!EmitExpression(out, expr->args[1])) {
return false;
}
return true;
l << " result;";
}
line(b) << "result.fract = modf(" << params[0] << ", result.whole);";
line(b) << "return result;";
return true;
});
}
bool GeneratorImpl::EmitFrexpCall(std::ostream& out,
const ast::CallExpression* expr,
const sem::Builtin* builtin) {
if (expr->args.Length() == 1) {
return CallBuiltinHelper(
out, expr, builtin, [&](TextBuffer* b, const std::vector<std::string>& params) {
// Emit the builtin return type unique to this overload. This does not
// exist in the AST, so it will not be generated in Generate().
if (!EmitStructType(&helpers_, builtin->ReturnType()->As<sem::Struct>())) {
return false;
}
{
auto l = line(b);
if (!EmitType(l, builtin->ReturnType(), ast::StorageClass::kNone,
ast::Access::kUndefined, "")) {
return false;
}
l << " result;";
}
line(b) << "result.sig = frexp(" << params[0] << ", result.exp);";
line(b) << "return result;";
return true;
});
}
// DEPRECATED
// Exponent is an integer in WGSL, but HLSL wants a float.
// We need to make the call with a temporary float, and then cast.
TINT_ASSERT(Writer, expr->args.Length() == 1);
return CallBuiltinHelper(
out, expr, builtin, [&](TextBuffer* b, const std::vector<std::string>& params) {
auto* significand_ty = builtin->Parameters()[0]->Type();
auto significand = params[0];
auto* exponent_ty = builtin->Parameters()[1]->Type();
auto exponent = params[1];
std::string width;
if (auto* vec = significand_ty->As<sem::Vector>()) {
width = std::to_string(vec->Width());
// Emit the builtin return type unique to this overload. This does not
// exist in the AST, so it will not be generated in Generate().
if (!EmitStructType(&helpers_, builtin->ReturnType()->As<sem::Struct>())) {
return false;
}
// Exponent is an integer, which HLSL does not have an overload for.
// We need to cast from a float.
line(b) << "float" << width << " float_exp;";
line(b) << "float" << width << " significand = frexp(" << significand
<< ", float_exp);";
{
auto l = line(b);
l << exponent << " = ";
if (!EmitType(l, exponent_ty->UnwrapPtr(), ast::StorageClass::kNone,
if (!EmitType(l, builtin->ReturnType(), ast::StorageClass::kNone,
ast::Access::kUndefined, "")) {
return false;
}
l << "(float_exp);";
l << " result;";
}
line(b) << "return significand;";
line(b) << "result.sig = frexp(" << params[0] << ", result.exp);";
line(b) << "return result;";
return true;
});
}

View File

@ -412,7 +412,7 @@ TEST_F(GlslGeneratorImplTest_Builtin, FMA_f16) {
EXPECT_EQ(out.str(), "((a) * (b) + (c))");
}
TEST_F(GlslGeneratorImplTest_Builtin, Modf_Scalar) {
TEST_F(GlslGeneratorImplTest_Builtin, Modf_Scalar_f32) {
auto* call = Call("modf", 1_f);
WrapInFunction(CallStmt(call));
@ -445,7 +445,43 @@ void main() {
)");
}
TEST_F(GlslGeneratorImplTest_Builtin, Modf_Vector) {
TEST_F(GlslGeneratorImplTest_Builtin, Modf_Scalar_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("modf", 1_h);
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(#version 310 es
#extension GL_AMD_gpu_shader_half_float : require
struct modf_result_f16 {
float16_t fract;
float16_t whole;
};
modf_result_f16 tint_modf(float16_t param_0) {
modf_result_f16 result;
result.fract = modf(param_0, result.whole);
return result;
}
void test_function() {
tint_modf(1.0hf);
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
test_function();
return;
}
)");
}
TEST_F(GlslGeneratorImplTest_Builtin, Modf_Vector_f32) {
auto* call = Call("modf", vec3<f32>());
WrapInFunction(CallStmt(call));
@ -478,7 +514,43 @@ void main() {
)");
}
TEST_F(GlslGeneratorImplTest_Builtin, Frexp_Scalar_i32) {
TEST_F(GlslGeneratorImplTest_Builtin, Modf_Vector_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("modf", vec3<f16>());
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(#version 310 es
#extension GL_AMD_gpu_shader_half_float : require
struct modf_result_vec3_f16 {
f16vec3 fract;
f16vec3 whole;
};
modf_result_vec3_f16 tint_modf(f16vec3 param_0) {
modf_result_vec3_f16 result;
result.fract = modf(param_0, result.whole);
return result;
}
void test_function() {
tint_modf(f16vec3(0.0hf));
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
test_function();
return;
}
)");
}
TEST_F(GlslGeneratorImplTest_Builtin, Frexp_Scalar_f32) {
auto* call = Call("frexp", 1_f);
WrapInFunction(CallStmt(call));
@ -505,7 +577,42 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
)"));
}
TEST_F(GlslGeneratorImplTest_Builtin, Frexp_Vector_i32) {
TEST_F(GlslGeneratorImplTest_Builtin, Frexp_Scalar_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("frexp", 1_h);
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_THAT(gen.result(), HasSubstr(R"(#version 310 es
#extension GL_AMD_gpu_shader_half_float : require
struct frexp_result_f16 {
float16_t sig;
int exp;
};
frexp_result_f16 tint_frexp(float16_t param_0) {
frexp_result_f16 result;
result.sig = frexp(param_0, result.exp);
return result;
}
void test_function() {
tint_frexp(1.0hf);
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
test_function();
return;
)"));
}
TEST_F(GlslGeneratorImplTest_Builtin, Frexp_Vector_f32) {
auto* call = Call("frexp", vec3<f32>());
WrapInFunction(CallStmt(call));
@ -537,6 +644,42 @@ void main() {
)"));
}
TEST_F(GlslGeneratorImplTest_Builtin, Frexp_Vector_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("frexp", vec3<f16>());
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_THAT(gen.result(), HasSubstr(R"(#version 310 es
#extension GL_AMD_gpu_shader_half_float : require
struct frexp_result_vec3_f16 {
f16vec3 sig;
ivec3 exp;
};
frexp_result_vec3_f16 tint_frexp(f16vec3 param_0) {
frexp_result_vec3_f16 result;
result.sig = frexp(param_0, result.exp);
return result;
}
void test_function() {
tint_frexp(f16vec3(0.0hf));
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
test_function();
return;
}
)"));
}
TEST_F(GlslGeneratorImplTest_Builtin, Degrees_Scalar_f32) {
auto* val = Var("val", ty.f32());
auto* call = Call("degrees", val);

View File

@ -1855,16 +1855,15 @@ bool GeneratorImpl::EmitModfCall(std::ostream& out,
return false;
}
line(b) << "float" << width << " whole;";
line(b) << "float" << width << " fract = modf(" << in << ", whole);";
{
auto l = line(b);
if (!EmitType(l, builtin->ReturnType(), ast::StorageClass::kNone,
ast::Access::kUndefined, "")) {
return false;
}
l << " result = {fract, whole};";
l << " result;";
}
line(b) << "result.fract = modf(" << params[0] << ", result.whole);";
line(b) << "return result;";
return true;
});
@ -1889,8 +1888,15 @@ bool GeneratorImpl::EmitFrexpCall(std::ostream& out,
return false;
}
line(b) << "float" << width << " exp;";
line(b) << "float" << width << " sig = frexp(" << in << ", exp);";
std::string member_type;
if (Is<sem::F16>(sem::Type::DeepestElementOf(ty))) {
member_type = width.empty() ? "float16_t" : ("vector<float16_t, " + width + ">");
} else {
member_type = "float" + width;
}
line(b) << member_type << " exp;";
line(b) << member_type << " sig = frexp(" << in << ", exp);";
{
auto l = line(b);
if (!EmitType(l, builtin->ReturnType(), ast::StorageClass::kNone,

View File

@ -377,7 +377,7 @@ TEST_F(HlslGeneratorImplTest_Builtin, Select_Vector) {
EXPECT_EQ(out.str(), "(bool2(true, false) ? int2(3, 4) : int2(1, 2))");
}
TEST_F(HlslGeneratorImplTest_Builtin, Modf_Scalar) {
TEST_F(HlslGeneratorImplTest_Builtin, Modf_Scalar_f32) {
auto* call = Call("modf", 1_f);
WrapInFunction(CallStmt(call));
@ -389,9 +389,8 @@ TEST_F(HlslGeneratorImplTest_Builtin, Modf_Scalar) {
float whole;
};
modf_result tint_modf(float param_0) {
float whole;
float fract = modf(param_0, whole);
modf_result result = {fract, whole};
modf_result result;
result.fract = modf(param_0, result.whole);
return result;
}
@ -403,7 +402,34 @@ void test_function() {
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Modf_Vector) {
TEST_F(HlslGeneratorImplTest_Builtin, Modf_Scalar_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("modf", 1_h);
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(struct modf_result_f16 {
float16_t fract;
float16_t whole;
};
modf_result_f16 tint_modf(float16_t param_0) {
modf_result_f16 result;
result.fract = modf(param_0, result.whole);
return result;
}
[numthreads(1, 1, 1)]
void test_function() {
tint_modf(float16_t(1.0h));
return;
}
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Modf_Vector_f32) {
auto* call = Call("modf", vec3<f32>());
WrapInFunction(CallStmt(call));
@ -415,9 +441,8 @@ TEST_F(HlslGeneratorImplTest_Builtin, Modf_Vector) {
float3 whole;
};
modf_result_vec3 tint_modf(float3 param_0) {
float3 whole;
float3 fract = modf(param_0, whole);
modf_result_vec3 result = {fract, whole};
modf_result_vec3 result;
result.fract = modf(param_0, result.whole);
return result;
}
@ -429,7 +454,34 @@ void test_function() {
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Frexp_Scalar_i32) {
TEST_F(HlslGeneratorImplTest_Builtin, Modf_Vector_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("modf", vec3<f16>());
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(struct modf_result_vec3_f16 {
vector<float16_t, 3> fract;
vector<float16_t, 3> whole;
};
modf_result_vec3_f16 tint_modf(vector<float16_t, 3> param_0) {
modf_result_vec3_f16 result;
result.fract = modf(param_0, result.whole);
return result;
}
[numthreads(1, 1, 1)]
void test_function() {
tint_modf((float16_t(0.0h)).xxx);
return;
}
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Frexp_Scalar_f32) {
auto* call = Call("frexp", 1_f);
WrapInFunction(CallStmt(call));
@ -455,7 +507,35 @@ void test_function() {
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Frexp_Vector_i32) {
TEST_F(HlslGeneratorImplTest_Builtin, Frexp_Scalar_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("frexp", 1_h);
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(struct frexp_result_f16 {
float16_t sig;
int exp;
};
frexp_result_f16 tint_frexp(float16_t param_0) {
float16_t exp;
float16_t sig = frexp(param_0, exp);
frexp_result_f16 result = {sig, int(exp)};
return result;
}
[numthreads(1, 1, 1)]
void test_function() {
tint_frexp(float16_t(1.0h));
return;
}
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Frexp_Vector_f32) {
auto* call = Call("frexp", vec3<f32>());
WrapInFunction(CallStmt(call));
@ -481,6 +561,34 @@ void test_function() {
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Frexp_Vector_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("frexp", vec3<f16>());
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(struct frexp_result_vec3_f16 {
vector<float16_t, 3> sig;
int3 exp;
};
frexp_result_vec3_f16 tint_frexp(vector<float16_t, 3> param_0) {
vector<float16_t, 3> exp;
vector<float16_t, 3> sig = frexp(param_0, exp);
frexp_result_vec3_f16 result = {sig, int3(exp)};
return result;
}
[numthreads(1, 1, 1)]
void test_function() {
tint_frexp((float16_t(0.0h)).xxx);
return;
}
)");
}
TEST_F(HlslGeneratorImplTest_Builtin, Degrees_Scalar_f32) {
auto* val = Var("val", ty.f32());
auto* call = Call("degrees", val);

View File

@ -1308,9 +1308,9 @@ bool GeneratorImpl::EmitModfCall(std::ostream& out,
return false;
}
line(b) << "float" << width << " whole;";
line(b) << "float" << width << " fract = modf(" << in << ", whole);";
line(b) << "return {fract, whole};";
line(b) << StructName(builtin->ReturnType()->As<sem::Struct>()) << " result;";
line(b) << "result.fract = modf(" << in << ", result.whole);";
line(b) << "return result;";
return true;
});
}
@ -1334,9 +1334,9 @@ bool GeneratorImpl::EmitFrexpCall(std::ostream& out,
return false;
}
line(b) << "int" << width << " exp;";
line(b) << "float" << width << " sig = frexp(" << in << ", exp);";
line(b) << "return {sig, exp};";
line(b) << StructName(builtin->ReturnType()->As<sem::Struct>()) << " result;";
line(b) << "result.sig = frexp(" << in << ", result.exp);";
line(b) << "return result;";
return true;
});
}

View File

@ -405,6 +405,246 @@ TEST_F(MslGeneratorImplTest, WorkgroupBarrier) {
EXPECT_EQ(out.str(), "threadgroup_barrier(mem_flags::mem_threadgroup)");
}
TEST_F(MslGeneratorImplTest, Modf_Scalar_f32) {
auto* call = Call("modf", 1_f);
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(#include <metal_stdlib>
using namespace metal;
struct modf_result {
float fract;
float whole;
};
modf_result tint_modf(float param_0) {
modf_result result;
result.fract = modf(param_0, result.whole);
return result;
}
kernel void test_function() {
tint_modf(1.0f);
return;
}
)");
}
TEST_F(MslGeneratorImplTest, Modf_Scalar_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("modf", 1_h);
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(#include <metal_stdlib>
using namespace metal;
struct modf_result_f16 {
half fract;
half whole;
};
modf_result_f16 tint_modf(half param_0) {
modf_result_f16 result;
result.fract = modf(param_0, result.whole);
return result;
}
kernel void test_function() {
tint_modf(1.0h);
return;
}
)");
}
TEST_F(MslGeneratorImplTest, Modf_Vector_f32) {
auto* call = Call("modf", vec3<f32>());
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(#include <metal_stdlib>
using namespace metal;
struct modf_result_vec3 {
float3 fract;
float3 whole;
};
modf_result_vec3 tint_modf(float3 param_0) {
modf_result_vec3 result;
result.fract = modf(param_0, result.whole);
return result;
}
kernel void test_function() {
tint_modf(float3(0.0f));
return;
}
)");
}
TEST_F(MslGeneratorImplTest, Modf_Vector_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("modf", vec3<f16>());
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(#include <metal_stdlib>
using namespace metal;
struct modf_result_vec3_f16 {
half3 fract;
half3 whole;
};
modf_result_vec3_f16 tint_modf(half3 param_0) {
modf_result_vec3_f16 result;
result.fract = modf(param_0, result.whole);
return result;
}
kernel void test_function() {
tint_modf(half3(0.0h));
return;
}
)");
}
TEST_F(MslGeneratorImplTest, Frexp_Scalar_f32) {
auto* call = Call("frexp", 1_f);
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(#include <metal_stdlib>
using namespace metal;
struct frexp_result {
float sig;
int exp;
};
frexp_result tint_frexp(float param_0) {
frexp_result result;
result.sig = frexp(param_0, result.exp);
return result;
}
kernel void test_function() {
tint_frexp(1.0f);
return;
}
)");
}
TEST_F(MslGeneratorImplTest, Frexp_Scalar_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("frexp", 1_h);
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(#include <metal_stdlib>
using namespace metal;
struct frexp_result_f16 {
half sig;
int exp;
};
frexp_result_f16 tint_frexp(half param_0) {
frexp_result_f16 result;
result.sig = frexp(param_0, result.exp);
return result;
}
kernel void test_function() {
tint_frexp(1.0h);
return;
}
)");
}
TEST_F(MslGeneratorImplTest, Frexp_Vector_f32) {
auto* call = Call("frexp", vec3<f32>());
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(#include <metal_stdlib>
using namespace metal;
struct frexp_result_vec3 {
float3 sig;
int3 exp;
};
frexp_result_vec3 tint_frexp(float3 param_0) {
frexp_result_vec3 result;
result.sig = frexp(param_0, result.exp);
return result;
}
kernel void test_function() {
tint_frexp(float3(0.0f));
return;
}
)");
}
TEST_F(MslGeneratorImplTest, Frexp_Vector_f16) {
Enable(ast::Extension::kF16);
auto* call = Call("frexp", vec3<f16>());
WrapInFunction(CallStmt(call));
GeneratorImpl& gen = SanitizeAndBuild();
ASSERT_TRUE(gen.Generate()) << gen.error();
EXPECT_EQ(gen.result(), R"(#include <metal_stdlib>
using namespace metal;
struct frexp_result_vec3_f16 {
half3 sig;
int3 exp;
};
frexp_result_vec3_f16 tint_frexp(half3 param_0) {
frexp_result_vec3_f16 result;
result.sig = frexp(param_0, result.exp);
return result;
}
kernel void test_function() {
tint_frexp(half3(0.0h));
return;
}
)");
}
TEST_F(MslGeneratorImplTest, Degrees_Scalar_f32) {
auto* val = Var("val", ty.f32());
auto* call = Call("degrees", val);

View File

@ -1651,7 +1651,7 @@ OpFunctionEnd
EXPECT_EQ(got, expect);
}
TEST_F(BuiltinBuilderTest, Call_Modf) {
TEST_F(BuiltinBuilderTest, Call_Modf_f32) {
auto* vec = Var("vec", nullptr, vec2<f32>(1_f, 2_f));
auto* expr = Call("modf", vec);
Func("a_func", utils::Empty, ty.void_(),
@ -1703,7 +1703,65 @@ OpFunctionEnd
Validate(b);
}
TEST_F(BuiltinBuilderTest, Call_Frexp) {
TEST_F(BuiltinBuilderTest, Call_Modf_f16) {
Enable(ast::Extension::kF16);
auto* vec = Var("vec", nullptr, vec2<f16>(1_h, 2_h));
auto* expr = Call("modf", vec);
Func("a_func", utils::Empty, ty.void_(),
utils::Vector{
Decl(vec),
CallStmt(expr),
},
utils::Vector{
Stage(ast::PipelineStage::kFragment),
});
spirv::Builder& b = Build();
ASSERT_TRUE(b.Build()) << b.error();
auto got = DumpBuilder(b);
auto* expect = R"(OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
%15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %3 "a_func"
OpExecutionMode %3 OriginUpperLeft
OpName %3 "a_func"
OpName %10 "vec"
OpName %14 "__modf_result_vec2_f16"
OpMemberName %14 0 "fract"
OpMemberName %14 1 "whole"
OpMemberDecorate %14 0 Offset 0
OpMemberDecorate %14 1 Offset 4
%2 = OpTypeVoid
%1 = OpTypeFunction %2
%6 = OpTypeFloat 16
%5 = OpTypeVector %6 2
%7 = OpConstant %6 0x1p+0
%8 = OpConstant %6 0x1p+1
%9 = OpConstantComposite %5 %7 %8
%11 = OpTypePointer Function %5
%12 = OpConstantNull %5
%14 = OpTypeStruct %5 %5
%3 = OpFunction %2 None %1
%4 = OpLabel
%10 = OpVariable %11 Function %12
OpStore %10 %9
%16 = OpLoad %5 %10
%13 = OpExtInst %14 %15 ModfStruct %16
OpReturn
OpFunctionEnd
)";
EXPECT_EQ(expect, got);
Validate(b);
}
TEST_F(BuiltinBuilderTest, Call_Frexp_f32) {
auto* vec = Var("vec", nullptr, vec2<f32>(1_f, 2_f));
auto* expr = Call("frexp", vec);
Func("a_func", utils::Empty, ty.void_(),
@ -1757,6 +1815,66 @@ OpFunctionEnd
Validate(b);
}
TEST_F(BuiltinBuilderTest, Call_Frexp_f16) {
Enable(ast::Extension::kF16);
auto* vec = Var("vec", nullptr, vec2<f16>(1_h, 2_h));
auto* expr = Call("frexp", vec);
Func("a_func", utils::Empty, ty.void_(),
utils::Vector{
Decl(vec),
CallStmt(expr),
},
utils::Vector{
Stage(ast::PipelineStage::kFragment),
});
spirv::Builder& b = Build();
ASSERT_TRUE(b.Build()) << b.error();
auto got = DumpBuilder(b);
auto* expect = R"(OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
%17 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %3 "a_func"
OpExecutionMode %3 OriginUpperLeft
OpName %3 "a_func"
OpName %10 "vec"
OpName %14 "__frexp_result_vec2_f16"
OpMemberName %14 0 "sig"
OpMemberName %14 1 "exp"
OpMemberDecorate %14 0 Offset 0
OpMemberDecorate %14 1 Offset 8
%2 = OpTypeVoid
%1 = OpTypeFunction %2
%6 = OpTypeFloat 16
%5 = OpTypeVector %6 2
%7 = OpConstant %6 0x1p+0
%8 = OpConstant %6 0x1p+1
%9 = OpConstantComposite %5 %7 %8
%11 = OpTypePointer Function %5
%12 = OpConstantNull %5
%16 = OpTypeInt 32 1
%15 = OpTypeVector %16 2
%14 = OpTypeStruct %5 %15
%3 = OpFunction %2 None %1
%4 = OpLabel
%10 = OpVariable %11 Function %12
OpStore %10 %9
%18 = OpLoad %5 %10
%13 = OpExtInst %14 %17 FrexpStruct %18
OpReturn
OpFunctionEnd
)";
EXPECT_EQ(expect, got);
Validate(b);
}
} // namespace float_builtin_tests
// Tests for Numeric builtins with all integer parameter

View File

@ -3,9 +3,8 @@ struct modf_result {
float whole;
};
modf_result tint_modf(float param_0) {
float whole;
float fract = modf(param_0, whole);
modf_result result = {fract, whole};
modf_result result;
result.fract = modf(param_0, result.whole);
return result;
}

View File

@ -3,9 +3,8 @@ struct modf_result {
float whole;
};
modf_result tint_modf(float param_0) {
float whole;
float fract = modf(param_0, whole);
modf_result result = {fract, whole};
modf_result result;
result.fract = modf(param_0, result.whole);
return result;
}

View File

@ -7,9 +7,9 @@ struct modf_result {
float whole;
};
modf_result tint_modf(float param_0) {
float whole;
float fract = modf(param_0, whole);
return {fract, whole};
modf_result result;
result.fract = modf(param_0, result.whole);
return result;
}
void i() {

View File

@ -7,9 +7,9 @@ struct frexp_result {
int exp;
};
frexp_result tint_frexp(float param_0) {
int exp;
float sig = frexp(param_0, exp);
return {sig, exp};
frexp_result result;
result.sig = frexp(param_0, result.exp);
return result;
}
kernel void tint_symbol() {

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,23 +21,23 @@
////////////////////////////////////////////////////////////////////////////////
// fn frexp(f32) -> __frexp_result
fn frexp_eabd40() {
// fn frexp(f32) -> __frexp_result<f32>
fn frexp_4b2200() {
var res = frexp(1.f);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_eabd40();
frexp_4b2200();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_eabd40();
frexp_4b2200();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_eabd40();
frexp_4b2200();
}

View File

@ -9,7 +9,7 @@ frexp_result tint_frexp(float param_0) {
return result;
}
void frexp_eabd40() {
void frexp_4b2200() {
frexp_result res = tint_frexp(1.0f);
}
@ -18,7 +18,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_eabd40();
frexp_4b2200();
return (0.0f).xxxx;
}
@ -30,12 +30,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_eabd40();
frexp_4b2200();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_eabd40();
frexp_4b2200();
return;
}

View File

@ -9,7 +9,7 @@ frexp_result tint_frexp(float param_0) {
return result;
}
void frexp_eabd40() {
void frexp_4b2200() {
frexp_result res = tint_frexp(1.0f);
}
@ -18,7 +18,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_eabd40();
frexp_4b2200();
return (0.0f).xxxx;
}
@ -30,12 +30,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_eabd40();
frexp_4b2200();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_eabd40();
frexp_4b2200();
return;
}

View File

@ -12,12 +12,12 @@ frexp_result tint_frexp(float param_0) {
}
void frexp_eabd40() {
void frexp_4b2200() {
frexp_result res = tint_frexp(1.0f);
}
vec4 vertex_main() {
frexp_eabd40();
frexp_4b2200();
return vec4(0.0f);
}
@ -44,12 +44,12 @@ frexp_result tint_frexp(float param_0) {
}
void frexp_eabd40() {
void frexp_4b2200() {
frexp_result res = tint_frexp(1.0f);
}
void fragment_main() {
frexp_eabd40();
frexp_4b2200();
}
void main() {
@ -70,12 +70,12 @@ frexp_result tint_frexp(float param_0) {
}
void frexp_eabd40() {
void frexp_4b2200() {
frexp_result res = tint_frexp(1.0f);
}
void compute_main() {
frexp_eabd40();
frexp_4b2200();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct frexp_result {
int exp;
};
frexp_result tint_frexp(float param_0) {
int exp;
float sig = frexp(param_0, exp);
return {sig, exp};
frexp_result result;
result.sig = frexp(param_0, result.exp);
return result;
}
void frexp_eabd40() {
void frexp_4b2200() {
frexp_result res = tint_frexp(1.0f);
}
@ -21,7 +21,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_eabd40();
frexp_4b2200();
return float4(0.0f);
}
@ -33,12 +33,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
frexp_eabd40();
frexp_4b2200();
return;
}
kernel void compute_main() {
frexp_eabd40();
frexp_4b2200();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %frexp_eabd40 "frexp_eabd40"
OpName %frexp_4b2200 "frexp_4b2200"
OpName %__frexp_result "__frexp_result"
OpMemberName %__frexp_result 0 "sig"
OpMemberName %__frexp_result 1 "exp"
@ -42,7 +42,7 @@
%_ptr_Function___frexp_result = OpTypePointer Function %__frexp_result
%20 = OpConstantNull %__frexp_result
%21 = OpTypeFunction %v4float
%frexp_eabd40 = OpFunction %void None %9
%frexp_4b2200 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function___frexp_result Function %20
%13 = OpExtInst %__frexp_result %16 FrexpStruct %float_1
@ -51,7 +51,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %frexp_eabd40
%24 = OpFunctionCall %void %frexp_4b2200
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -63,11 +63,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %frexp_eabd40
%30 = OpFunctionCall %void %frexp_4b2200
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %frexp_eabd40
%33 = OpFunctionCall %void %frexp_4b2200
OpReturn
OpFunctionEnd

View File

@ -1,19 +1,19 @@
fn frexp_eabd40() {
fn frexp_4b2200() {
var res = frexp(1.0f);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_eabd40();
frexp_4b2200();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_eabd40();
frexp_4b2200();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_eabd40();
frexp_4b2200();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,23 +21,23 @@
////////////////////////////////////////////////////////////////////////////////
// fn frexp(vec<4, f32>) -> __frexp_result_vec<4>
fn frexp_3c4f48() {
// fn frexp(vec<4, f32>) -> __frexp_result_vec<4, f32>
fn frexp_77af93() {
var res = frexp(vec4<f32>(1.f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_3c4f48();
frexp_77af93();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_3c4f48();
frexp_77af93();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_3c4f48();
frexp_77af93();
}

View File

@ -9,7 +9,7 @@ frexp_result_vec4 tint_frexp(float4 param_0) {
return result;
}
void frexp_3c4f48() {
void frexp_77af93() {
frexp_result_vec4 res = tint_frexp((1.0f).xxxx);
}
@ -18,7 +18,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_3c4f48();
frexp_77af93();
return (0.0f).xxxx;
}
@ -30,12 +30,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_3c4f48();
frexp_77af93();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_3c4f48();
frexp_77af93();
return;
}

View File

@ -9,7 +9,7 @@ frexp_result_vec4 tint_frexp(float4 param_0) {
return result;
}
void frexp_3c4f48() {
void frexp_77af93() {
frexp_result_vec4 res = tint_frexp((1.0f).xxxx);
}
@ -18,7 +18,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_3c4f48();
frexp_77af93();
return (0.0f).xxxx;
}
@ -30,12 +30,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_3c4f48();
frexp_77af93();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_3c4f48();
frexp_77af93();
return;
}

View File

@ -12,12 +12,12 @@ frexp_result_vec4 tint_frexp(vec4 param_0) {
}
void frexp_3c4f48() {
void frexp_77af93() {
frexp_result_vec4 res = tint_frexp(vec4(1.0f));
}
vec4 vertex_main() {
frexp_3c4f48();
frexp_77af93();
return vec4(0.0f);
}
@ -44,12 +44,12 @@ frexp_result_vec4 tint_frexp(vec4 param_0) {
}
void frexp_3c4f48() {
void frexp_77af93() {
frexp_result_vec4 res = tint_frexp(vec4(1.0f));
}
void fragment_main() {
frexp_3c4f48();
frexp_77af93();
}
void main() {
@ -70,12 +70,12 @@ frexp_result_vec4 tint_frexp(vec4 param_0) {
}
void frexp_3c4f48() {
void frexp_77af93() {
frexp_result_vec4 res = tint_frexp(vec4(1.0f));
}
void compute_main() {
frexp_3c4f48();
frexp_77af93();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct frexp_result_vec4 {
int4 exp;
};
frexp_result_vec4 tint_frexp(float4 param_0) {
int4 exp;
float4 sig = frexp(param_0, exp);
return {sig, exp};
frexp_result_vec4 result;
result.sig = frexp(param_0, result.exp);
return result;
}
void frexp_3c4f48() {
void frexp_77af93() {
frexp_result_vec4 res = tint_frexp(float4(1.0f));
}
@ -21,7 +21,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_3c4f48();
frexp_77af93();
return float4(0.0f);
}
@ -33,12 +33,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
frexp_3c4f48();
frexp_77af93();
return;
}
kernel void compute_main() {
frexp_3c4f48();
frexp_77af93();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %frexp_3c4f48 "frexp_3c4f48"
OpName %frexp_77af93 "frexp_77af93"
OpName %__frexp_result_vec4 "__frexp_result_vec4"
OpMemberName %__frexp_result_vec4 0 "sig"
OpMemberName %__frexp_result_vec4 1 "exp"
@ -44,7 +44,7 @@
%_ptr_Function___frexp_result_vec4 = OpTypePointer Function %__frexp_result_vec4
%22 = OpConstantNull %__frexp_result_vec4
%23 = OpTypeFunction %v4float
%frexp_3c4f48 = OpFunction %void None %9
%frexp_77af93 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function___frexp_result_vec4 Function %22
%13 = OpExtInst %__frexp_result_vec4 %17 FrexpStruct %19
@ -53,7 +53,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %frexp_3c4f48
%26 = OpFunctionCall %void %frexp_77af93
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -65,11 +65,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %frexp_3c4f48
%32 = OpFunctionCall %void %frexp_77af93
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %frexp_3c4f48
%35 = OpFunctionCall %void %frexp_77af93
OpReturn
OpFunctionEnd

View File

@ -1,19 +1,19 @@
fn frexp_3c4f48() {
fn frexp_77af93() {
var res = frexp(vec4<f32>(1.0f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_3c4f48();
frexp_77af93();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_3c4f48();
frexp_77af93();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_3c4f48();
frexp_77af93();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,23 +21,23 @@
////////////////////////////////////////////////////////////////////////////////
// fn frexp(vec<3, f32>) -> __frexp_result_vec<3>
fn frexp_368997() {
// fn frexp(vec<3, f32>) -> __frexp_result_vec<3, f32>
fn frexp_979800() {
var res = frexp(vec3<f32>(1.f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_368997();
frexp_979800();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_368997();
frexp_979800();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_368997();
frexp_979800();
}

View File

@ -9,7 +9,7 @@ frexp_result_vec3 tint_frexp(float3 param_0) {
return result;
}
void frexp_368997() {
void frexp_979800() {
frexp_result_vec3 res = tint_frexp((1.0f).xxx);
}
@ -18,7 +18,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_368997();
frexp_979800();
return (0.0f).xxxx;
}
@ -30,12 +30,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_368997();
frexp_979800();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_368997();
frexp_979800();
return;
}

View File

@ -9,7 +9,7 @@ frexp_result_vec3 tint_frexp(float3 param_0) {
return result;
}
void frexp_368997() {
void frexp_979800() {
frexp_result_vec3 res = tint_frexp((1.0f).xxx);
}
@ -18,7 +18,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_368997();
frexp_979800();
return (0.0f).xxxx;
}
@ -30,12 +30,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_368997();
frexp_979800();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_368997();
frexp_979800();
return;
}

View File

@ -12,12 +12,12 @@ frexp_result_vec3 tint_frexp(vec3 param_0) {
}
void frexp_368997() {
void frexp_979800() {
frexp_result_vec3 res = tint_frexp(vec3(1.0f));
}
vec4 vertex_main() {
frexp_368997();
frexp_979800();
return vec4(0.0f);
}
@ -44,12 +44,12 @@ frexp_result_vec3 tint_frexp(vec3 param_0) {
}
void frexp_368997() {
void frexp_979800() {
frexp_result_vec3 res = tint_frexp(vec3(1.0f));
}
void fragment_main() {
frexp_368997();
frexp_979800();
}
void main() {
@ -70,12 +70,12 @@ frexp_result_vec3 tint_frexp(vec3 param_0) {
}
void frexp_368997() {
void frexp_979800() {
frexp_result_vec3 res = tint_frexp(vec3(1.0f));
}
void compute_main() {
frexp_368997();
frexp_979800();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct frexp_result_vec3 {
int3 exp;
};
frexp_result_vec3 tint_frexp(float3 param_0) {
int3 exp;
float3 sig = frexp(param_0, exp);
return {sig, exp};
frexp_result_vec3 result;
result.sig = frexp(param_0, result.exp);
return result;
}
void frexp_368997() {
void frexp_979800() {
frexp_result_vec3 res = tint_frexp(float3(1.0f));
}
@ -21,7 +21,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_368997();
frexp_979800();
return float4(0.0f);
}
@ -33,12 +33,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
frexp_368997();
frexp_979800();
return;
}
kernel void compute_main() {
frexp_368997();
frexp_979800();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %frexp_368997 "frexp_368997"
OpName %frexp_979800 "frexp_979800"
OpName %__frexp_result_vec3 "__frexp_result_vec3"
OpMemberName %__frexp_result_vec3 0 "sig"
OpMemberName %__frexp_result_vec3 1 "exp"
@ -45,7 +45,7 @@
%_ptr_Function___frexp_result_vec3 = OpTypePointer Function %__frexp_result_vec3
%23 = OpConstantNull %__frexp_result_vec3
%24 = OpTypeFunction %v4float
%frexp_368997 = OpFunction %void None %9
%frexp_979800 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function___frexp_result_vec3 Function %23
%13 = OpExtInst %__frexp_result_vec3 %18 FrexpStruct %20
@ -54,7 +54,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %24
%26 = OpLabel
%27 = OpFunctionCall %void %frexp_368997
%27 = OpFunctionCall %void %frexp_979800
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -66,11 +66,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %frexp_368997
%33 = OpFunctionCall %void %frexp_979800
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%35 = OpLabel
%36 = OpFunctionCall %void %frexp_368997
%36 = OpFunctionCall %void %frexp_979800
OpReturn
OpFunctionEnd

View File

@ -1,19 +1,19 @@
fn frexp_368997() {
fn frexp_979800() {
var res = frexp(vec3<f32>(1.0f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_368997();
frexp_979800();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_368997();
frexp_979800();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_368997();
frexp_979800();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,23 +21,23 @@
////////////////////////////////////////////////////////////////////////////////
// fn frexp(vec<2, f32>) -> __frexp_result_vec<2>
fn frexp_4bdfc7() {
// fn frexp(vec<2, f32>) -> __frexp_result_vec<2, f32>
fn frexp_eb2421() {
var res = frexp(vec2<f32>(1.f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_4bdfc7();
frexp_eb2421();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_4bdfc7();
frexp_eb2421();
}

View File

@ -9,7 +9,7 @@ frexp_result_vec2 tint_frexp(float2 param_0) {
return result;
}
void frexp_4bdfc7() {
void frexp_eb2421() {
frexp_result_vec2 res = tint_frexp((1.0f).xx);
}
@ -18,7 +18,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_4bdfc7();
frexp_eb2421();
return (0.0f).xxxx;
}
@ -30,12 +30,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}

View File

@ -9,7 +9,7 @@ frexp_result_vec2 tint_frexp(float2 param_0) {
return result;
}
void frexp_4bdfc7() {
void frexp_eb2421() {
frexp_result_vec2 res = tint_frexp((1.0f).xx);
}
@ -18,7 +18,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_4bdfc7();
frexp_eb2421();
return (0.0f).xxxx;
}
@ -30,12 +30,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}

View File

@ -12,12 +12,12 @@ frexp_result_vec2 tint_frexp(vec2 param_0) {
}
void frexp_4bdfc7() {
void frexp_eb2421() {
frexp_result_vec2 res = tint_frexp(vec2(1.0f));
}
vec4 vertex_main() {
frexp_4bdfc7();
frexp_eb2421();
return vec4(0.0f);
}
@ -44,12 +44,12 @@ frexp_result_vec2 tint_frexp(vec2 param_0) {
}
void frexp_4bdfc7() {
void frexp_eb2421() {
frexp_result_vec2 res = tint_frexp(vec2(1.0f));
}
void fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
}
void main() {
@ -70,12 +70,12 @@ frexp_result_vec2 tint_frexp(vec2 param_0) {
}
void frexp_4bdfc7() {
void frexp_eb2421() {
frexp_result_vec2 res = tint_frexp(vec2(1.0f));
}
void compute_main() {
frexp_4bdfc7();
frexp_eb2421();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct frexp_result_vec2 {
int2 exp;
};
frexp_result_vec2 tint_frexp(float2 param_0) {
int2 exp;
float2 sig = frexp(param_0, exp);
return {sig, exp};
frexp_result_vec2 result;
result.sig = frexp(param_0, result.exp);
return result;
}
void frexp_4bdfc7() {
void frexp_eb2421() {
frexp_result_vec2 res = tint_frexp(float2(1.0f));
}
@ -21,7 +21,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_4bdfc7();
frexp_eb2421();
return float4(0.0f);
}
@ -33,12 +33,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}
kernel void compute_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %frexp_4bdfc7 "frexp_4bdfc7"
OpName %frexp_eb2421 "frexp_eb2421"
OpName %__frexp_result_vec2 "__frexp_result_vec2"
OpMemberName %__frexp_result_vec2 0 "sig"
OpMemberName %__frexp_result_vec2 1 "exp"
@ -45,7 +45,7 @@
%_ptr_Function___frexp_result_vec2 = OpTypePointer Function %__frexp_result_vec2
%23 = OpConstantNull %__frexp_result_vec2
%24 = OpTypeFunction %v4float
%frexp_4bdfc7 = OpFunction %void None %9
%frexp_eb2421 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function___frexp_result_vec2 Function %23
%13 = OpExtInst %__frexp_result_vec2 %18 FrexpStruct %20
@ -54,7 +54,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %24
%26 = OpLabel
%27 = OpFunctionCall %void %frexp_4bdfc7
%27 = OpFunctionCall %void %frexp_eb2421
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -66,11 +66,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %frexp_4bdfc7
%33 = OpFunctionCall %void %frexp_eb2421
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%35 = OpLabel
%36 = OpFunctionCall %void %frexp_4bdfc7
%36 = OpFunctionCall %void %frexp_eb2421
OpReturn
OpFunctionEnd

View File

@ -1,19 +1,19 @@
fn frexp_4bdfc7() {
fn frexp_eb2421() {
var res = frexp(vec2<f32>(1.0f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_4bdfc7();
frexp_eb2421();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_4bdfc7();
frexp_eb2421();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,23 +21,23 @@
////////////////////////////////////////////////////////////////////////////////
// fn modf(vec<2, f32>) -> __modf_result_vec<2>
fn modf_f5f20d() {
// fn modf(vec<2, f32>) -> __modf_result_vec<2, f32>
fn modf_2d50da() {
var res = modf(vec2<f32>(1.f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
modf_f5f20d();
modf_2d50da();
return vec4<f32>();
}
@fragment
fn fragment_main() {
modf_f5f20d();
modf_2d50da();
}
@compute @workgroup_size(1)
fn compute_main() {
modf_f5f20d();
modf_2d50da();
}

View File

@ -3,13 +3,12 @@ struct modf_result_vec2 {
float2 whole;
};
modf_result_vec2 tint_modf(float2 param_0) {
float2 whole;
float2 fract = modf(param_0, whole);
modf_result_vec2 result = {fract, whole};
modf_result_vec2 result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_f5f20d() {
void modf_2d50da() {
modf_result_vec2 res = tint_modf((1.0f).xx);
}
@ -18,7 +17,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_f5f20d();
modf_2d50da();
return (0.0f).xxxx;
}
@ -30,12 +29,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
modf_f5f20d();
modf_2d50da();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
modf_f5f20d();
modf_2d50da();
return;
}

View File

@ -3,13 +3,12 @@ struct modf_result_vec2 {
float2 whole;
};
modf_result_vec2 tint_modf(float2 param_0) {
float2 whole;
float2 fract = modf(param_0, whole);
modf_result_vec2 result = {fract, whole};
modf_result_vec2 result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_f5f20d() {
void modf_2d50da() {
modf_result_vec2 res = tint_modf((1.0f).xx);
}
@ -18,7 +17,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_f5f20d();
modf_2d50da();
return (0.0f).xxxx;
}
@ -30,12 +29,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
modf_f5f20d();
modf_2d50da();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
modf_f5f20d();
modf_2d50da();
return;
}

View File

@ -12,12 +12,12 @@ modf_result_vec2 tint_modf(vec2 param_0) {
}
void modf_f5f20d() {
void modf_2d50da() {
modf_result_vec2 res = tint_modf(vec2(1.0f));
}
vec4 vertex_main() {
modf_f5f20d();
modf_2d50da();
return vec4(0.0f);
}
@ -44,12 +44,12 @@ modf_result_vec2 tint_modf(vec2 param_0) {
}
void modf_f5f20d() {
void modf_2d50da() {
modf_result_vec2 res = tint_modf(vec2(1.0f));
}
void fragment_main() {
modf_f5f20d();
modf_2d50da();
}
void main() {
@ -70,12 +70,12 @@ modf_result_vec2 tint_modf(vec2 param_0) {
}
void modf_f5f20d() {
void modf_2d50da() {
modf_result_vec2 res = tint_modf(vec2(1.0f));
}
void compute_main() {
modf_f5f20d();
modf_2d50da();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct modf_result_vec2 {
float2 whole;
};
modf_result_vec2 tint_modf(float2 param_0) {
float2 whole;
float2 fract = modf(param_0, whole);
return {fract, whole};
modf_result_vec2 result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_f5f20d() {
void modf_2d50da() {
modf_result_vec2 res = tint_modf(float2(1.0f));
}
@ -21,7 +21,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_f5f20d();
modf_2d50da();
return float4(0.0f);
}
@ -33,12 +33,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
modf_f5f20d();
modf_2d50da();
return;
}
kernel void compute_main() {
modf_f5f20d();
modf_2d50da();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %modf_f5f20d "modf_f5f20d"
OpName %modf_2d50da "modf_2d50da"
OpName %__modf_result_vec2 "__modf_result_vec2"
OpMemberName %__modf_result_vec2 0 "fract"
OpMemberName %__modf_result_vec2 1 "whole"
@ -43,7 +43,7 @@
%_ptr_Function___modf_result_vec2 = OpTypePointer Function %__modf_result_vec2
%21 = OpConstantNull %__modf_result_vec2
%22 = OpTypeFunction %v4float
%modf_f5f20d = OpFunction %void None %9
%modf_2d50da = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function___modf_result_vec2 Function %21
%13 = OpExtInst %__modf_result_vec2 %16 ModfStruct %18
@ -52,7 +52,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %modf_f5f20d
%25 = OpFunctionCall %void %modf_2d50da
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -64,11 +64,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %modf_f5f20d
%31 = OpFunctionCall %void %modf_2d50da
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%33 = OpLabel
%34 = OpFunctionCall %void %modf_f5f20d
%34 = OpFunctionCall %void %modf_2d50da
OpReturn
OpFunctionEnd

View File

@ -1,19 +1,19 @@
fn modf_f5f20d() {
fn modf_2d50da() {
var res = modf(vec2<f32>(1.0f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
modf_f5f20d();
modf_2d50da();
return vec4<f32>();
}
@fragment
fn fragment_main() {
modf_f5f20d();
modf_2d50da();
}
@compute @workgroup_size(1)
fn compute_main() {
modf_f5f20d();
modf_2d50da();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,23 +21,23 @@
////////////////////////////////////////////////////////////////////////////////
// fn modf(vec<4, f32>) -> __modf_result_vec<4>
fn modf_ec2dbc() {
// fn modf(vec<4, f32>) -> __modf_result_vec<4, f32>
fn modf_4bfced() {
var res = modf(vec4<f32>(1.f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
modf_ec2dbc();
modf_4bfced();
return vec4<f32>();
}
@fragment
fn fragment_main() {
modf_ec2dbc();
modf_4bfced();
}
@compute @workgroup_size(1)
fn compute_main() {
modf_ec2dbc();
modf_4bfced();
}

View File

@ -3,13 +3,12 @@ struct modf_result_vec4 {
float4 whole;
};
modf_result_vec4 tint_modf(float4 param_0) {
float4 whole;
float4 fract = modf(param_0, whole);
modf_result_vec4 result = {fract, whole};
modf_result_vec4 result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_ec2dbc() {
void modf_4bfced() {
modf_result_vec4 res = tint_modf((1.0f).xxxx);
}
@ -18,7 +17,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_ec2dbc();
modf_4bfced();
return (0.0f).xxxx;
}
@ -30,12 +29,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
modf_ec2dbc();
modf_4bfced();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
modf_ec2dbc();
modf_4bfced();
return;
}

View File

@ -3,13 +3,12 @@ struct modf_result_vec4 {
float4 whole;
};
modf_result_vec4 tint_modf(float4 param_0) {
float4 whole;
float4 fract = modf(param_0, whole);
modf_result_vec4 result = {fract, whole};
modf_result_vec4 result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_ec2dbc() {
void modf_4bfced() {
modf_result_vec4 res = tint_modf((1.0f).xxxx);
}
@ -18,7 +17,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_ec2dbc();
modf_4bfced();
return (0.0f).xxxx;
}
@ -30,12 +29,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
modf_ec2dbc();
modf_4bfced();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
modf_ec2dbc();
modf_4bfced();
return;
}

View File

@ -12,12 +12,12 @@ modf_result_vec4 tint_modf(vec4 param_0) {
}
void modf_ec2dbc() {
void modf_4bfced() {
modf_result_vec4 res = tint_modf(vec4(1.0f));
}
vec4 vertex_main() {
modf_ec2dbc();
modf_4bfced();
return vec4(0.0f);
}
@ -44,12 +44,12 @@ modf_result_vec4 tint_modf(vec4 param_0) {
}
void modf_ec2dbc() {
void modf_4bfced() {
modf_result_vec4 res = tint_modf(vec4(1.0f));
}
void fragment_main() {
modf_ec2dbc();
modf_4bfced();
}
void main() {
@ -70,12 +70,12 @@ modf_result_vec4 tint_modf(vec4 param_0) {
}
void modf_ec2dbc() {
void modf_4bfced() {
modf_result_vec4 res = tint_modf(vec4(1.0f));
}
void compute_main() {
modf_ec2dbc();
modf_4bfced();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct modf_result_vec4 {
float4 whole;
};
modf_result_vec4 tint_modf(float4 param_0) {
float4 whole;
float4 fract = modf(param_0, whole);
return {fract, whole};
modf_result_vec4 result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_ec2dbc() {
void modf_4bfced() {
modf_result_vec4 res = tint_modf(float4(1.0f));
}
@ -21,7 +21,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_ec2dbc();
modf_4bfced();
return float4(0.0f);
}
@ -33,12 +33,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
modf_ec2dbc();
modf_4bfced();
return;
}
kernel void compute_main() {
modf_ec2dbc();
modf_4bfced();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %modf_ec2dbc "modf_ec2dbc"
OpName %modf_4bfced "modf_4bfced"
OpName %__modf_result_vec4 "__modf_result_vec4"
OpMemberName %__modf_result_vec4 0 "fract"
OpMemberName %__modf_result_vec4 1 "whole"
@ -42,7 +42,7 @@
%_ptr_Function___modf_result_vec4 = OpTypePointer Function %__modf_result_vec4
%20 = OpConstantNull %__modf_result_vec4
%21 = OpTypeFunction %v4float
%modf_ec2dbc = OpFunction %void None %9
%modf_4bfced = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function___modf_result_vec4 Function %20
%13 = OpExtInst %__modf_result_vec4 %15 ModfStruct %17
@ -51,7 +51,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %21
%23 = OpLabel
%24 = OpFunctionCall %void %modf_ec2dbc
%24 = OpFunctionCall %void %modf_4bfced
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -63,11 +63,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%29 = OpLabel
%30 = OpFunctionCall %void %modf_ec2dbc
%30 = OpFunctionCall %void %modf_4bfced
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %modf_ec2dbc
%33 = OpFunctionCall %void %modf_4bfced
OpReturn
OpFunctionEnd

View File

@ -1,19 +1,19 @@
fn modf_ec2dbc() {
fn modf_4bfced() {
var res = modf(vec4<f32>(1.0f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
modf_ec2dbc();
modf_4bfced();
return vec4<f32>();
}
@fragment
fn fragment_main() {
modf_ec2dbc();
modf_4bfced();
}
@compute @workgroup_size(1)
fn compute_main() {
modf_ec2dbc();
modf_4bfced();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,23 +21,23 @@
////////////////////////////////////////////////////////////////////////////////
// fn modf(vec<3, f32>) -> __modf_result_vec<3>
fn modf_9b75f7() {
// fn modf(vec<3, f32>) -> __modf_result_vec<3, f32>
fn modf_5ea256() {
var res = modf(vec3<f32>(1.f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
modf_9b75f7();
modf_5ea256();
return vec4<f32>();
}
@fragment
fn fragment_main() {
modf_9b75f7();
modf_5ea256();
}
@compute @workgroup_size(1)
fn compute_main() {
modf_9b75f7();
modf_5ea256();
}

View File

@ -3,13 +3,12 @@ struct modf_result_vec3 {
float3 whole;
};
modf_result_vec3 tint_modf(float3 param_0) {
float3 whole;
float3 fract = modf(param_0, whole);
modf_result_vec3 result = {fract, whole};
modf_result_vec3 result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_9b75f7() {
void modf_5ea256() {
modf_result_vec3 res = tint_modf((1.0f).xxx);
}
@ -18,7 +17,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_9b75f7();
modf_5ea256();
return (0.0f).xxxx;
}
@ -30,12 +29,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
modf_9b75f7();
modf_5ea256();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
modf_9b75f7();
modf_5ea256();
return;
}

View File

@ -3,13 +3,12 @@ struct modf_result_vec3 {
float3 whole;
};
modf_result_vec3 tint_modf(float3 param_0) {
float3 whole;
float3 fract = modf(param_0, whole);
modf_result_vec3 result = {fract, whole};
modf_result_vec3 result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_9b75f7() {
void modf_5ea256() {
modf_result_vec3 res = tint_modf((1.0f).xxx);
}
@ -18,7 +17,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_9b75f7();
modf_5ea256();
return (0.0f).xxxx;
}
@ -30,12 +29,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
modf_9b75f7();
modf_5ea256();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
modf_9b75f7();
modf_5ea256();
return;
}

View File

@ -12,12 +12,12 @@ modf_result_vec3 tint_modf(vec3 param_0) {
}
void modf_9b75f7() {
void modf_5ea256() {
modf_result_vec3 res = tint_modf(vec3(1.0f));
}
vec4 vertex_main() {
modf_9b75f7();
modf_5ea256();
return vec4(0.0f);
}
@ -44,12 +44,12 @@ modf_result_vec3 tint_modf(vec3 param_0) {
}
void modf_9b75f7() {
void modf_5ea256() {
modf_result_vec3 res = tint_modf(vec3(1.0f));
}
void fragment_main() {
modf_9b75f7();
modf_5ea256();
}
void main() {
@ -70,12 +70,12 @@ modf_result_vec3 tint_modf(vec3 param_0) {
}
void modf_9b75f7() {
void modf_5ea256() {
modf_result_vec3 res = tint_modf(vec3(1.0f));
}
void compute_main() {
modf_9b75f7();
modf_5ea256();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct modf_result_vec3 {
float3 whole;
};
modf_result_vec3 tint_modf(float3 param_0) {
float3 whole;
float3 fract = modf(param_0, whole);
return {fract, whole};
modf_result_vec3 result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_9b75f7() {
void modf_5ea256() {
modf_result_vec3 res = tint_modf(float3(1.0f));
}
@ -21,7 +21,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_9b75f7();
modf_5ea256();
return float4(0.0f);
}
@ -33,12 +33,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
modf_9b75f7();
modf_5ea256();
return;
}
kernel void compute_main() {
modf_9b75f7();
modf_5ea256();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %modf_9b75f7 "modf_9b75f7"
OpName %modf_5ea256 "modf_5ea256"
OpName %__modf_result_vec3 "__modf_result_vec3"
OpMemberName %__modf_result_vec3 0 "fract"
OpMemberName %__modf_result_vec3 1 "whole"
@ -43,7 +43,7 @@
%_ptr_Function___modf_result_vec3 = OpTypePointer Function %__modf_result_vec3
%21 = OpConstantNull %__modf_result_vec3
%22 = OpTypeFunction %v4float
%modf_9b75f7 = OpFunction %void None %9
%modf_5ea256 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function___modf_result_vec3 Function %21
%13 = OpExtInst %__modf_result_vec3 %16 ModfStruct %18
@ -52,7 +52,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %modf_9b75f7
%25 = OpFunctionCall %void %modf_5ea256
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -64,11 +64,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%30 = OpLabel
%31 = OpFunctionCall %void %modf_9b75f7
%31 = OpFunctionCall %void %modf_5ea256
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%33 = OpLabel
%34 = OpFunctionCall %void %modf_9b75f7
%34 = OpFunctionCall %void %modf_5ea256
OpReturn
OpFunctionEnd

View File

@ -1,19 +1,19 @@
fn modf_9b75f7() {
fn modf_5ea256() {
var res = modf(vec3<f32>(1.0f));
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
modf_9b75f7();
modf_5ea256();
return vec4<f32>();
}
@fragment
fn fragment_main() {
modf_9b75f7();
modf_5ea256();
}
@compute @workgroup_size(1)
fn compute_main() {
modf_9b75f7();
modf_5ea256();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,23 +21,23 @@
////////////////////////////////////////////////////////////////////////////////
// fn modf(f32) -> __modf_result
fn modf_180fed() {
// fn modf(f32) -> __modf_result<f32>
fn modf_bbf7f7() {
var res = modf(1.f);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
modf_180fed();
modf_bbf7f7();
return vec4<f32>();
}
@fragment
fn fragment_main() {
modf_180fed();
modf_bbf7f7();
}
@compute @workgroup_size(1)
fn compute_main() {
modf_180fed();
modf_bbf7f7();
}

View File

@ -3,13 +3,12 @@ struct modf_result {
float whole;
};
modf_result tint_modf(float param_0) {
float whole;
float fract = modf(param_0, whole);
modf_result result = {fract, whole};
modf_result result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_180fed() {
void modf_bbf7f7() {
modf_result res = tint_modf(1.0f);
}
@ -18,7 +17,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_180fed();
modf_bbf7f7();
return (0.0f).xxxx;
}
@ -30,12 +29,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
modf_180fed();
modf_bbf7f7();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
modf_180fed();
modf_bbf7f7();
return;
}

View File

@ -3,13 +3,12 @@ struct modf_result {
float whole;
};
modf_result tint_modf(float param_0) {
float whole;
float fract = modf(param_0, whole);
modf_result result = {fract, whole};
modf_result result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_180fed() {
void modf_bbf7f7() {
modf_result res = tint_modf(1.0f);
}
@ -18,7 +17,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_180fed();
modf_bbf7f7();
return (0.0f).xxxx;
}
@ -30,12 +29,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
modf_180fed();
modf_bbf7f7();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
modf_180fed();
modf_bbf7f7();
return;
}

View File

@ -12,12 +12,12 @@ modf_result tint_modf(float param_0) {
}
void modf_180fed() {
void modf_bbf7f7() {
modf_result res = tint_modf(1.0f);
}
vec4 vertex_main() {
modf_180fed();
modf_bbf7f7();
return vec4(0.0f);
}
@ -44,12 +44,12 @@ modf_result tint_modf(float param_0) {
}
void modf_180fed() {
void modf_bbf7f7() {
modf_result res = tint_modf(1.0f);
}
void fragment_main() {
modf_180fed();
modf_bbf7f7();
}
void main() {
@ -70,12 +70,12 @@ modf_result tint_modf(float param_0) {
}
void modf_180fed() {
void modf_bbf7f7() {
modf_result res = tint_modf(1.0f);
}
void compute_main() {
modf_180fed();
modf_bbf7f7();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct modf_result {
float whole;
};
modf_result tint_modf(float param_0) {
float whole;
float fract = modf(param_0, whole);
return {fract, whole};
modf_result result;
result.fract = modf(param_0, result.whole);
return result;
}
void modf_180fed() {
void modf_bbf7f7() {
modf_result res = tint_modf(1.0f);
}
@ -21,7 +21,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
modf_180fed();
modf_bbf7f7();
return float4(0.0f);
}
@ -33,12 +33,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
modf_180fed();
modf_bbf7f7();
return;
}
kernel void compute_main() {
modf_180fed();
modf_bbf7f7();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %modf_180fed "modf_180fed"
OpName %modf_bbf7f7 "modf_bbf7f7"
OpName %__modf_result "__modf_result"
OpMemberName %__modf_result 0 "fract"
OpMemberName %__modf_result 1 "whole"
@ -41,7 +41,7 @@
%_ptr_Function___modf_result = OpTypePointer Function %__modf_result
%19 = OpConstantNull %__modf_result
%20 = OpTypeFunction %v4float
%modf_180fed = OpFunction %void None %9
%modf_bbf7f7 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function___modf_result Function %19
%13 = OpExtInst %__modf_result %15 ModfStruct %float_1
@ -50,7 +50,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %20
%22 = OpLabel
%23 = OpFunctionCall %void %modf_180fed
%23 = OpFunctionCall %void %modf_bbf7f7
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -62,11 +62,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%28 = OpLabel
%29 = OpFunctionCall %void %modf_180fed
%29 = OpFunctionCall %void %modf_bbf7f7
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%31 = OpLabel
%32 = OpFunctionCall %void %modf_180fed
%32 = OpFunctionCall %void %modf_bbf7f7
OpReturn
OpFunctionEnd

View File

@ -1,19 +1,19 @@
fn modf_180fed() {
fn modf_bbf7f7() {
var res = modf(1.0f);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
modf_180fed();
modf_bbf7f7();
return vec4<f32>();
}
@fragment
fn fragment_main() {
modf_180fed();
modf_bbf7f7();
}
@compute @workgroup_size(1)
fn compute_main() {
modf_180fed();
modf_bbf7f7();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,24 +21,24 @@
////////////////////////////////////////////////////////////////////////////////
// fn frexp(f32) -> __frexp_result
fn frexp_eabd40() {
// fn frexp(f32) -> __frexp_result<f32>
fn frexp_4b2200() {
var arg_0 = 1.f;
var res = frexp(arg_0);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_eabd40();
frexp_4b2200();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_eabd40();
frexp_4b2200();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_eabd40();
frexp_4b2200();
}

View File

@ -9,7 +9,7 @@ frexp_result tint_frexp(float param_0) {
return result;
}
void frexp_eabd40() {
void frexp_4b2200() {
float arg_0 = 1.0f;
frexp_result res = tint_frexp(arg_0);
}
@ -19,7 +19,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_eabd40();
frexp_4b2200();
return (0.0f).xxxx;
}
@ -31,12 +31,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_eabd40();
frexp_4b2200();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_eabd40();
frexp_4b2200();
return;
}

View File

@ -9,7 +9,7 @@ frexp_result tint_frexp(float param_0) {
return result;
}
void frexp_eabd40() {
void frexp_4b2200() {
float arg_0 = 1.0f;
frexp_result res = tint_frexp(arg_0);
}
@ -19,7 +19,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_eabd40();
frexp_4b2200();
return (0.0f).xxxx;
}
@ -31,12 +31,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_eabd40();
frexp_4b2200();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_eabd40();
frexp_4b2200();
return;
}

View File

@ -12,13 +12,13 @@ frexp_result tint_frexp(float param_0) {
}
void frexp_eabd40() {
void frexp_4b2200() {
float arg_0 = 1.0f;
frexp_result res = tint_frexp(arg_0);
}
vec4 vertex_main() {
frexp_eabd40();
frexp_4b2200();
return vec4(0.0f);
}
@ -45,13 +45,13 @@ frexp_result tint_frexp(float param_0) {
}
void frexp_eabd40() {
void frexp_4b2200() {
float arg_0 = 1.0f;
frexp_result res = tint_frexp(arg_0);
}
void fragment_main() {
frexp_eabd40();
frexp_4b2200();
}
void main() {
@ -72,13 +72,13 @@ frexp_result tint_frexp(float param_0) {
}
void frexp_eabd40() {
void frexp_4b2200() {
float arg_0 = 1.0f;
frexp_result res = tint_frexp(arg_0);
}
void compute_main() {
frexp_eabd40();
frexp_4b2200();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct frexp_result {
int exp;
};
frexp_result tint_frexp(float param_0) {
int exp;
float sig = frexp(param_0, exp);
return {sig, exp};
frexp_result result;
result.sig = frexp(param_0, result.exp);
return result;
}
void frexp_eabd40() {
void frexp_4b2200() {
float arg_0 = 1.0f;
frexp_result res = tint_frexp(arg_0);
}
@ -22,7 +22,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_eabd40();
frexp_4b2200();
return float4(0.0f);
}
@ -34,12 +34,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
frexp_eabd40();
frexp_4b2200();
return;
}
kernel void compute_main() {
frexp_eabd40();
frexp_4b2200();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %frexp_eabd40 "frexp_eabd40"
OpName %frexp_4b2200 "frexp_4b2200"
OpName %arg_0 "arg_0"
OpName %__frexp_result "__frexp_result"
OpMemberName %__frexp_result 0 "sig"
@ -44,7 +44,7 @@
%_ptr_Function___frexp_result = OpTypePointer Function %__frexp_result
%23 = OpConstantNull %__frexp_result
%24 = OpTypeFunction %v4float
%frexp_eabd40 = OpFunction %void None %9
%frexp_4b2200 = OpFunction %void None %9
%12 = OpLabel
%arg_0 = OpVariable %_ptr_Function_float Function %8
%res = OpVariable %_ptr_Function___frexp_result Function %23
@ -56,7 +56,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %24
%26 = OpLabel
%27 = OpFunctionCall %void %frexp_eabd40
%27 = OpFunctionCall %void %frexp_4b2200
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -68,11 +68,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%32 = OpLabel
%33 = OpFunctionCall %void %frexp_eabd40
%33 = OpFunctionCall %void %frexp_4b2200
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%35 = OpLabel
%36 = OpFunctionCall %void %frexp_eabd40
%36 = OpFunctionCall %void %frexp_4b2200
OpReturn
OpFunctionEnd

View File

@ -1,20 +1,20 @@
fn frexp_eabd40() {
fn frexp_4b2200() {
var arg_0 = 1.0f;
var res = frexp(arg_0);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_eabd40();
frexp_4b2200();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_eabd40();
frexp_4b2200();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_eabd40();
frexp_4b2200();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,24 +21,24 @@
////////////////////////////////////////////////////////////////////////////////
// fn frexp(vec<4, f32>) -> __frexp_result_vec<4>
fn frexp_3c4f48() {
// fn frexp(vec<4, f32>) -> __frexp_result_vec<4, f32>
fn frexp_77af93() {
var arg_0 = vec4<f32>(1.f);
var res = frexp(arg_0);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_3c4f48();
frexp_77af93();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_3c4f48();
frexp_77af93();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_3c4f48();
frexp_77af93();
}

View File

@ -9,7 +9,7 @@ frexp_result_vec4 tint_frexp(float4 param_0) {
return result;
}
void frexp_3c4f48() {
void frexp_77af93() {
float4 arg_0 = (1.0f).xxxx;
frexp_result_vec4 res = tint_frexp(arg_0);
}
@ -19,7 +19,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_3c4f48();
frexp_77af93();
return (0.0f).xxxx;
}
@ -31,12 +31,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_3c4f48();
frexp_77af93();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_3c4f48();
frexp_77af93();
return;
}

View File

@ -9,7 +9,7 @@ frexp_result_vec4 tint_frexp(float4 param_0) {
return result;
}
void frexp_3c4f48() {
void frexp_77af93() {
float4 arg_0 = (1.0f).xxxx;
frexp_result_vec4 res = tint_frexp(arg_0);
}
@ -19,7 +19,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_3c4f48();
frexp_77af93();
return (0.0f).xxxx;
}
@ -31,12 +31,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_3c4f48();
frexp_77af93();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_3c4f48();
frexp_77af93();
return;
}

View File

@ -12,13 +12,13 @@ frexp_result_vec4 tint_frexp(vec4 param_0) {
}
void frexp_3c4f48() {
void frexp_77af93() {
vec4 arg_0 = vec4(1.0f);
frexp_result_vec4 res = tint_frexp(arg_0);
}
vec4 vertex_main() {
frexp_3c4f48();
frexp_77af93();
return vec4(0.0f);
}
@ -45,13 +45,13 @@ frexp_result_vec4 tint_frexp(vec4 param_0) {
}
void frexp_3c4f48() {
void frexp_77af93() {
vec4 arg_0 = vec4(1.0f);
frexp_result_vec4 res = tint_frexp(arg_0);
}
void fragment_main() {
frexp_3c4f48();
frexp_77af93();
}
void main() {
@ -72,13 +72,13 @@ frexp_result_vec4 tint_frexp(vec4 param_0) {
}
void frexp_3c4f48() {
void frexp_77af93() {
vec4 arg_0 = vec4(1.0f);
frexp_result_vec4 res = tint_frexp(arg_0);
}
void compute_main() {
frexp_3c4f48();
frexp_77af93();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct frexp_result_vec4 {
int4 exp;
};
frexp_result_vec4 tint_frexp(float4 param_0) {
int4 exp;
float4 sig = frexp(param_0, exp);
return {sig, exp};
frexp_result_vec4 result;
result.sig = frexp(param_0, result.exp);
return result;
}
void frexp_3c4f48() {
void frexp_77af93() {
float4 arg_0 = float4(1.0f);
frexp_result_vec4 res = tint_frexp(arg_0);
}
@ -22,7 +22,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_3c4f48();
frexp_77af93();
return float4(0.0f);
}
@ -34,12 +34,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
frexp_3c4f48();
frexp_77af93();
return;
}
kernel void compute_main() {
frexp_3c4f48();
frexp_77af93();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %frexp_3c4f48 "frexp_3c4f48"
OpName %frexp_77af93 "frexp_77af93"
OpName %arg_0 "arg_0"
OpName %__frexp_result_vec4 "__frexp_result_vec4"
OpMemberName %__frexp_result_vec4 0 "sig"
@ -46,7 +46,7 @@
%_ptr_Function___frexp_result_vec4 = OpTypePointer Function %__frexp_result_vec4
%25 = OpConstantNull %__frexp_result_vec4
%26 = OpTypeFunction %v4float
%frexp_3c4f48 = OpFunction %void None %9
%frexp_77af93 = OpFunction %void None %9
%12 = OpLabel
%arg_0 = OpVariable %_ptr_Function_v4float Function %5
%res = OpVariable %_ptr_Function___frexp_result_vec4 Function %25
@ -58,7 +58,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %26
%28 = OpLabel
%29 = OpFunctionCall %void %frexp_3c4f48
%29 = OpFunctionCall %void %frexp_77af93
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -70,11 +70,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%34 = OpLabel
%35 = OpFunctionCall %void %frexp_3c4f48
%35 = OpFunctionCall %void %frexp_77af93
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%37 = OpLabel
%38 = OpFunctionCall %void %frexp_3c4f48
%38 = OpFunctionCall %void %frexp_77af93
OpReturn
OpFunctionEnd

View File

@ -1,20 +1,20 @@
fn frexp_3c4f48() {
fn frexp_77af93() {
var arg_0 = vec4<f32>(1.0f);
var res = frexp(arg_0);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_3c4f48();
frexp_77af93();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_3c4f48();
frexp_77af93();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_3c4f48();
frexp_77af93();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,24 +21,24 @@
////////////////////////////////////////////////////////////////////////////////
// fn frexp(vec<3, f32>) -> __frexp_result_vec<3>
fn frexp_368997() {
// fn frexp(vec<3, f32>) -> __frexp_result_vec<3, f32>
fn frexp_979800() {
var arg_0 = vec3<f32>(1.f);
var res = frexp(arg_0);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_368997();
frexp_979800();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_368997();
frexp_979800();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_368997();
frexp_979800();
}

View File

@ -9,7 +9,7 @@ frexp_result_vec3 tint_frexp(float3 param_0) {
return result;
}
void frexp_368997() {
void frexp_979800() {
float3 arg_0 = (1.0f).xxx;
frexp_result_vec3 res = tint_frexp(arg_0);
}
@ -19,7 +19,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_368997();
frexp_979800();
return (0.0f).xxxx;
}
@ -31,12 +31,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_368997();
frexp_979800();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_368997();
frexp_979800();
return;
}

View File

@ -9,7 +9,7 @@ frexp_result_vec3 tint_frexp(float3 param_0) {
return result;
}
void frexp_368997() {
void frexp_979800() {
float3 arg_0 = (1.0f).xxx;
frexp_result_vec3 res = tint_frexp(arg_0);
}
@ -19,7 +19,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_368997();
frexp_979800();
return (0.0f).xxxx;
}
@ -31,12 +31,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_368997();
frexp_979800();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_368997();
frexp_979800();
return;
}

View File

@ -12,13 +12,13 @@ frexp_result_vec3 tint_frexp(vec3 param_0) {
}
void frexp_368997() {
void frexp_979800() {
vec3 arg_0 = vec3(1.0f);
frexp_result_vec3 res = tint_frexp(arg_0);
}
vec4 vertex_main() {
frexp_368997();
frexp_979800();
return vec4(0.0f);
}
@ -45,13 +45,13 @@ frexp_result_vec3 tint_frexp(vec3 param_0) {
}
void frexp_368997() {
void frexp_979800() {
vec3 arg_0 = vec3(1.0f);
frexp_result_vec3 res = tint_frexp(arg_0);
}
void fragment_main() {
frexp_368997();
frexp_979800();
}
void main() {
@ -72,13 +72,13 @@ frexp_result_vec3 tint_frexp(vec3 param_0) {
}
void frexp_368997() {
void frexp_979800() {
vec3 arg_0 = vec3(1.0f);
frexp_result_vec3 res = tint_frexp(arg_0);
}
void compute_main() {
frexp_368997();
frexp_979800();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct frexp_result_vec3 {
int3 exp;
};
frexp_result_vec3 tint_frexp(float3 param_0) {
int3 exp;
float3 sig = frexp(param_0, exp);
return {sig, exp};
frexp_result_vec3 result;
result.sig = frexp(param_0, result.exp);
return result;
}
void frexp_368997() {
void frexp_979800() {
float3 arg_0 = float3(1.0f);
frexp_result_vec3 res = tint_frexp(arg_0);
}
@ -22,7 +22,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_368997();
frexp_979800();
return float4(0.0f);
}
@ -34,12 +34,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
frexp_368997();
frexp_979800();
return;
}
kernel void compute_main() {
frexp_368997();
frexp_979800();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %frexp_368997 "frexp_368997"
OpName %frexp_979800 "frexp_979800"
OpName %arg_0 "arg_0"
OpName %__frexp_result_vec3 "__frexp_result_vec3"
OpMemberName %__frexp_result_vec3 0 "sig"
@ -48,7 +48,7 @@
%_ptr_Function___frexp_result_vec3 = OpTypePointer Function %__frexp_result_vec3
%27 = OpConstantNull %__frexp_result_vec3
%28 = OpTypeFunction %v4float
%frexp_368997 = OpFunction %void None %9
%frexp_979800 = OpFunction %void None %9
%12 = OpLabel
%arg_0 = OpVariable %_ptr_Function_v3float Function %18
%res = OpVariable %_ptr_Function___frexp_result_vec3 Function %27
@ -60,7 +60,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %28
%30 = OpLabel
%31 = OpFunctionCall %void %frexp_368997
%31 = OpFunctionCall %void %frexp_979800
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -72,11 +72,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%36 = OpLabel
%37 = OpFunctionCall %void %frexp_368997
%37 = OpFunctionCall %void %frexp_979800
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%39 = OpLabel
%40 = OpFunctionCall %void %frexp_368997
%40 = OpFunctionCall %void %frexp_979800
OpReturn
OpFunctionEnd

View File

@ -1,20 +1,20 @@
fn frexp_368997() {
fn frexp_979800() {
var arg_0 = vec3<f32>(1.0f);
var res = frexp(arg_0);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_368997();
frexp_979800();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_368997();
frexp_979800();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_368997();
frexp_979800();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,24 +21,24 @@
////////////////////////////////////////////////////////////////////////////////
// fn frexp(vec<2, f32>) -> __frexp_result_vec<2>
fn frexp_4bdfc7() {
// fn frexp(vec<2, f32>) -> __frexp_result_vec<2, f32>
fn frexp_eb2421() {
var arg_0 = vec2<f32>(1.f);
var res = frexp(arg_0);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_4bdfc7();
frexp_eb2421();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_4bdfc7();
frexp_eb2421();
}

View File

@ -9,7 +9,7 @@ frexp_result_vec2 tint_frexp(float2 param_0) {
return result;
}
void frexp_4bdfc7() {
void frexp_eb2421() {
float2 arg_0 = (1.0f).xx;
frexp_result_vec2 res = tint_frexp(arg_0);
}
@ -19,7 +19,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_4bdfc7();
frexp_eb2421();
return (0.0f).xxxx;
}
@ -31,12 +31,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}

View File

@ -9,7 +9,7 @@ frexp_result_vec2 tint_frexp(float2 param_0) {
return result;
}
void frexp_4bdfc7() {
void frexp_eb2421() {
float2 arg_0 = (1.0f).xx;
frexp_result_vec2 res = tint_frexp(arg_0);
}
@ -19,7 +19,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_4bdfc7();
frexp_eb2421();
return (0.0f).xxxx;
}
@ -31,12 +31,12 @@ tint_symbol vertex_main() {
}
void fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}
[numthreads(1, 1, 1)]
void compute_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}

View File

@ -12,13 +12,13 @@ frexp_result_vec2 tint_frexp(vec2 param_0) {
}
void frexp_4bdfc7() {
void frexp_eb2421() {
vec2 arg_0 = vec2(1.0f);
frexp_result_vec2 res = tint_frexp(arg_0);
}
vec4 vertex_main() {
frexp_4bdfc7();
frexp_eb2421();
return vec4(0.0f);
}
@ -45,13 +45,13 @@ frexp_result_vec2 tint_frexp(vec2 param_0) {
}
void frexp_4bdfc7() {
void frexp_eb2421() {
vec2 arg_0 = vec2(1.0f);
frexp_result_vec2 res = tint_frexp(arg_0);
}
void fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
}
void main() {
@ -72,13 +72,13 @@ frexp_result_vec2 tint_frexp(vec2 param_0) {
}
void frexp_4bdfc7() {
void frexp_eb2421() {
vec2 arg_0 = vec2(1.0f);
frexp_result_vec2 res = tint_frexp(arg_0);
}
void compute_main() {
frexp_4bdfc7();
frexp_eb2421();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;

View File

@ -7,12 +7,12 @@ struct frexp_result_vec2 {
int2 exp;
};
frexp_result_vec2 tint_frexp(float2 param_0) {
int2 exp;
float2 sig = frexp(param_0, exp);
return {sig, exp};
frexp_result_vec2 result;
result.sig = frexp(param_0, result.exp);
return result;
}
void frexp_4bdfc7() {
void frexp_eb2421() {
float2 arg_0 = float2(1.0f);
frexp_result_vec2 res = tint_frexp(arg_0);
}
@ -22,7 +22,7 @@ struct tint_symbol {
};
float4 vertex_main_inner() {
frexp_4bdfc7();
frexp_eb2421();
return float4(0.0f);
}
@ -34,12 +34,12 @@ vertex tint_symbol vertex_main() {
}
fragment void fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}
kernel void compute_main() {
frexp_4bdfc7();
frexp_eb2421();
return;
}

View File

@ -13,7 +13,7 @@
OpExecutionMode %compute_main LocalSize 1 1 1
OpName %value "value"
OpName %vertex_point_size "vertex_point_size"
OpName %frexp_4bdfc7 "frexp_4bdfc7"
OpName %frexp_eb2421 "frexp_eb2421"
OpName %arg_0 "arg_0"
OpName %__frexp_result_vec2 "__frexp_result_vec2"
OpMemberName %__frexp_result_vec2 0 "sig"
@ -48,7 +48,7 @@
%_ptr_Function___frexp_result_vec2 = OpTypePointer Function %__frexp_result_vec2
%27 = OpConstantNull %__frexp_result_vec2
%28 = OpTypeFunction %v4float
%frexp_4bdfc7 = OpFunction %void None %9
%frexp_eb2421 = OpFunction %void None %9
%12 = OpLabel
%arg_0 = OpVariable %_ptr_Function_v2float Function %18
%res = OpVariable %_ptr_Function___frexp_result_vec2 Function %27
@ -60,7 +60,7 @@
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %28
%30 = OpLabel
%31 = OpFunctionCall %void %frexp_4bdfc7
%31 = OpFunctionCall %void %frexp_eb2421
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
@ -72,11 +72,11 @@
OpFunctionEnd
%fragment_main = OpFunction %void None %9
%36 = OpLabel
%37 = OpFunctionCall %void %frexp_4bdfc7
%37 = OpFunctionCall %void %frexp_eb2421
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
%39 = OpLabel
%40 = OpFunctionCall %void %frexp_4bdfc7
%40 = OpFunctionCall %void %frexp_eb2421
OpReturn
OpFunctionEnd

View File

@ -1,20 +1,20 @@
fn frexp_4bdfc7() {
fn frexp_eb2421() {
var arg_0 = vec2<f32>(1.0f);
var res = frexp(arg_0);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
frexp_4bdfc7();
frexp_eb2421();
return vec4<f32>();
}
@fragment
fn fragment_main() {
frexp_4bdfc7();
frexp_eb2421();
}
@compute @workgroup_size(1)
fn compute_main() {
frexp_4bdfc7();
frexp_eb2421();
}

View File

@ -1,4 +1,4 @@
// Copyright 2021 The Tint Authors.
// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -21,24 +21,24 @@
////////////////////////////////////////////////////////////////////////////////
// fn modf(vec<2, f32>) -> __modf_result_vec<2>
fn modf_f5f20d() {
// fn modf(vec<2, f32>) -> __modf_result_vec<2, f32>
fn modf_2d50da() {
var arg_0 = vec2<f32>(1.f);
var res = modf(arg_0);
}
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
modf_f5f20d();
modf_2d50da();
return vec4<f32>();
}
@fragment
fn fragment_main() {
modf_f5f20d();
modf_2d50da();
}
@compute @workgroup_size(1)
fn compute_main() {
modf_f5f20d();
modf_2d50da();
}

Some files were not shown because too many files have changed in this diff Show More