Add const-eval for `sin` and `sinh`
This CL adds const-eval for `sin` and `sinh`.
Bug: tint:1581
Change-Id: I96345378c826e2c49ffae688b5185764019967d5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109560
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
diff --git a/src/tint/intrinsics.def b/src/tint/intrinsics.def
index 226144c..0a7fe52 100644
--- a/src/tint/intrinsics.def
+++ b/src/tint/intrinsics.def
@@ -531,10 +531,10 @@
@const("select_boolvec") fn select<N: num, T: scalar>(vec<N, T>, vec<N, T>, vec<N, bool>) -> vec<N, T>
@const fn sign<T: fa_f32_f16>(T) -> T
@const fn sign<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
-fn sin<T: f32_f16>(T) -> T
-fn sin<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
-fn sinh<T: f32_f16>(T) -> T
-fn sinh<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
+@const fn sin<T: fa_f32_f16>(T) -> T
+@const fn sin<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
+@const fn sinh<T: fa_f32_f16>(T) -> T
+@const fn sinh<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
fn smoothstep<T: f32_f16>(T, T, T) -> T
fn smoothstep<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, vec<N, T>) -> vec<N, T>
fn sqrt<T: f32_f16>(T) -> T
diff --git a/src/tint/resolver/const_eval.cc b/src/tint/resolver/const_eval.cc
index c349150..504c64e 100644
--- a/src/tint/resolver/const_eval.cc
+++ b/src/tint/resolver/const_eval.cc
@@ -2285,6 +2285,32 @@
return TransformElements(builder, ty, transform, args[0]);
}
+ConstEval::Result ConstEval::sin(const sem::Type* ty,
+ utils::VectorRef<const sem::Constant*> args,
+ const Source&) {
+ auto transform = [&](const sem::Constant* c0) {
+ auto create = [&](auto i) -> ImplResult {
+ using NumberT = decltype(i);
+ return CreateElement(builder, c0->Type(), NumberT(std::sin(i.value)));
+ };
+ return Dispatch_fa_f32_f16(create, c0);
+ };
+ return TransformElements(builder, ty, transform, args[0]);
+}
+
+ConstEval::Result ConstEval::sinh(const sem::Type* ty,
+ utils::VectorRef<const sem::Constant*> args,
+ const Source&) {
+ auto transform = [&](const sem::Constant* c0) {
+ auto create = [&](auto i) -> ImplResult {
+ using NumberT = decltype(i);
+ return CreateElement(builder, c0->Type(), NumberT(std::sinh(i.value)));
+ };
+ return Dispatch_fa_f32_f16(create, c0);
+ };
+ return TransformElements(builder, ty, transform, args[0]);
+}
+
ConstEval::Result ConstEval::step(const sem::Type* ty,
utils::VectorRef<const sem::Constant*> args,
const Source&) {
diff --git a/src/tint/resolver/const_eval.h b/src/tint/resolver/const_eval.h
index d1e53cf..1d1be15 100644
--- a/src/tint/resolver/const_eval.h
+++ b/src/tint/resolver/const_eval.h
@@ -656,6 +656,24 @@
utils::VectorRef<const sem::Constant*> args,
const Source& source);
+ /// sin builtin
+ /// @param ty the expression type
+ /// @param args the input arguments
+ /// @param source the source location of the conversion
+ /// @return the result value, or null if the value cannot be calculated
+ Result sin(const sem::Type* ty,
+ utils::VectorRef<const sem::Constant*> args,
+ const Source& source);
+
+ /// sinh builtin
+ /// @param ty the expression type
+ /// @param args the input arguments
+ /// @param source the source location of the conversion
+ /// @return the result value, or null if the value cannot be calculated
+ Result sinh(const sem::Type* ty,
+ utils::VectorRef<const sem::Constant*> args,
+ const Source& source);
+
/// step builtin
/// @param ty the expression type
/// @param args the input arguments
diff --git a/src/tint/resolver/const_eval_builtin_test.cc b/src/tint/resolver/const_eval_builtin_test.cc
index 491bc2a..10e1d66 100644
--- a/src/tint/resolver/const_eval_builtin_test.cc
+++ b/src/tint/resolver/const_eval_builtin_test.cc
@@ -1487,6 +1487,50 @@
SignCases<f16>()))));
template <typename T>
+std::vector<Case> SinCases() {
+ std::vector<Case> cases = {
+ C({-T(0)}, -T(0)),
+ C({T(0)}, T(0)),
+ C({T(0.75)}, T(0.68163876)).FloatComp(),
+ C({-T(0.75)}, -T(0.68163876)).FloatComp(),
+
+ // Vector test
+ C({Vec(T(0), -T(0), T(0.75))}, Vec(T(0), -T(0), T(0.68163876))).FloatComp(),
+ };
+
+ return cases;
+}
+INSTANTIATE_TEST_SUITE_P( //
+ Sin,
+ ResolverConstEvalBuiltinTest,
+ testing::Combine(testing::Values(sem::BuiltinType::kSin),
+ testing::ValuesIn(Concat(SinCases<AFloat>(), //
+ SinCases<f32>(),
+ SinCases<f16>()))));
+
+template <typename T>
+std::vector<Case> SinhCases() {
+ std::vector<Case> cases = {
+ C({T(0)}, T(0)),
+ C({-T(0)}, -T(0)),
+ C({T(1)}, T(1.1752012)).FloatComp(),
+ C({T(-1)}, -T(1.1752012)).FloatComp(),
+
+ // Vector tests
+ C({Vec(T(0), -T(0), T(1))}, Vec(T(0), -T(0), T(1.1752012))).FloatComp(),
+ };
+
+ return cases;
+}
+INSTANTIATE_TEST_SUITE_P( //
+ Sinh,
+ ResolverConstEvalBuiltinTest,
+ testing::Combine(testing::Values(sem::BuiltinType::kSinh),
+ testing::ValuesIn(Concat(SinhCases<AFloat>(), //
+ SinhCases<f32>(),
+ SinhCases<f16>()))));
+
+template <typename T>
std::vector<Case> StepCases() {
return {
C({T(0), T(0)}, T(1.0)),
diff --git a/src/tint/resolver/intrinsic_table.inl b/src/tint/resolver/intrinsic_table.inl
index 1fe0d9e..d6df7d5 100644
--- a/src/tint/resolver/intrinsic_table.inl
+++ b/src/tint/resolver/intrinsic_table.inl
@@ -12513,48 +12513,48 @@
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[25],
+ /* template types */ &kTemplateTypes[24],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[908],
/* return matcher indices */ &kMatcherIndices[1],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* const eval */ nullptr,
+ /* const eval */ &ConstEval::sin,
},
{
/* [349] */
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[25],
+ /* template types */ &kTemplateTypes[24],
/* template numbers */ &kTemplateNumbers[5],
/* parameters */ &kParameters[909],
/* return matcher indices */ &kMatcherIndices[30],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* const eval */ nullptr,
+ /* const eval */ &ConstEval::sin,
},
{
/* [350] */
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 0,
- /* template types */ &kTemplateTypes[25],
+ /* template types */ &kTemplateTypes[24],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[910],
/* return matcher indices */ &kMatcherIndices[1],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* const eval */ nullptr,
+ /* const eval */ &ConstEval::sinh,
},
{
/* [351] */
/* num parameters */ 1,
/* num template types */ 1,
/* num template numbers */ 1,
- /* template types */ &kTemplateTypes[25],
+ /* template types */ &kTemplateTypes[24],
/* template numbers */ &kTemplateNumbers[5],
/* parameters */ &kParameters[911],
/* return matcher indices */ &kMatcherIndices[30],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
- /* const eval */ nullptr,
+ /* const eval */ &ConstEval::sinh,
},
{
/* [352] */
@@ -14490,15 +14490,15 @@
},
{
/* [70] */
- /* fn sin<T : f32_f16>(T) -> T */
- /* fn sin<N : num, T : f32_f16>(vec<N, T>) -> vec<N, T> */
+ /* fn sin<T : fa_f32_f16>(T) -> T */
+ /* fn sin<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
/* num overloads */ 2,
/* overloads */ &kOverloads[348],
},
{
/* [71] */
- /* fn sinh<T : f32_f16>(T) -> T */
- /* fn sinh<N : num, T : f32_f16>(vec<N, T>) -> vec<N, T> */
+ /* fn sinh<T : fa_f32_f16>(T) -> T */
+ /* fn sinh<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
/* num overloads */ 2,
/* overloads */ &kOverloads[350],
},
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.dxc.hlsl
index 7593cd8..399d934 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sin_01f241() {
- float3 res = sin((1.0f).xxx);
+ float3 res = (0.841470957f).xxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.fxc.hlsl
index 7593cd8..399d934 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void sin_01f241() {
- float3 res = sin((1.0f).xxx);
+ float3 res = (0.841470957f).xxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.glsl
index 5fe78bf..56aae66 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
void sin_01f241() {
- vec3 res = sin(vec3(1.0f));
+ vec3 res = vec3(0.841470957f);
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@
precision mediump float;
void sin_01f241() {
- vec3 res = sin(vec3(1.0f));
+ vec3 res = vec3(0.841470957f);
}
void fragment_main() {
@@ -35,7 +35,7 @@
#version 310 es
void sin_01f241() {
- vec3 res = sin(vec3(1.0f));
+ vec3 res = vec3(0.841470957f);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.msl
index 197815b..ac708b6 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sin_01f241() {
- float3 res = sin(float3(1.0f));
+ float3 res = float3(0.841470957f);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.spvasm
index 284f417..403f714 100644
--- a/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/01f241.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 33
; Schema: 0
OpCapability Shader
- %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -32,37 +31,37 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %float_1 = OpConstant %float 1
- %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+%float_0_841470957 = OpConstant %float 0.841470957
+ %15 = OpConstantComposite %v3float %float_0_841470957 %float_0_841470957 %float_0_841470957
%_ptr_Function_v3float = OpTypePointer Function %v3float
- %20 = OpConstantNull %v3float
- %21 = OpTypeFunction %v4float
+ %18 = OpConstantNull %v3float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
%sin_01f241 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %20
- %13 = OpExtInst %v3float %15 Sin %17
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_v3float Function %18
+ OpStore %res %15
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
- %23 = OpLabel
- %24 = OpFunctionCall %void %sin_01f241
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sin_01f241
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %27
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %sin_01f241
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sin_01f241
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %sin_01f241
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sin_01f241
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/15b2c6.wgsl b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl
new file mode 100644
index 0000000..999bfaa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl
@@ -0,0 +1,43 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sin(vec<4, fa>) -> vec<4, fa>
+fn sin_15b2c6() {
+ var res = sin(vec4(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_15b2c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_15b2c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_15b2c6();
+}
diff --git a/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8b97a9d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sin_15b2c6() {
+ float4 res = (0.841470957f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_15b2c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_15b2c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_15b2c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8b97a9d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sin_15b2c6() {
+ float4 res = (0.841470957f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_15b2c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_15b2c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_15b2c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.glsl
new file mode 100644
index 0000000..2ba8b10
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sin_15b2c6() {
+ vec4 res = vec4(0.841470957f);
+}
+
+vec4 vertex_main() {
+ sin_15b2c6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sin_15b2c6() {
+ vec4 res = vec4(0.841470957f);
+}
+
+void fragment_main() {
+ sin_15b2c6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sin_15b2c6() {
+ vec4 res = vec4(0.841470957f);
+}
+
+void compute_main() {
+ sin_15b2c6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.msl
new file mode 100644
index 0000000..4f69b5b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_15b2c6() {
+ float4 res = float4(0.841470957f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sin_15b2c6();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sin_15b2c6();
+ return;
+}
+
+kernel void compute_main() {
+ sin_15b2c6();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.spvasm
new file mode 100644
index 0000000..7e73f04
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sin_15b2c6 "sin_15b2c6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%float_0_841470957 = OpConstant %float 0.841470957
+ %14 = OpConstantComposite %v4float %float_0_841470957 %float_0_841470957 %float_0_841470957 %float_0_841470957
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %sin_15b2c6 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %17
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %sin_15b2c6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ %23 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %23
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %sin_15b2c6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sin_15b2c6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.wgsl
new file mode 100644
index 0000000..813a579
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/15b2c6.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn sin_15b2c6() {
+ var res = sin(vec4(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_15b2c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_15b2c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_15b2c6();
+}
diff --git a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.dxc.hlsl
index be59f65..7992f1d 100644
--- a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sin_2c903b() {
- vector<float16_t, 3> res = sin((float16_t(1.0h)).xxx);
+ vector<float16_t, 3> res = (float16_t(0.841308594h)).xxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.glsl
index 73bd0a8..88e3bc9 100644
--- a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.glsl
@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sin_2c903b() {
- f16vec3 res = sin(f16vec3(1.0hf));
+ f16vec3 res = f16vec3(0.841308594hf);
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@
precision mediump float;
void sin_2c903b() {
- f16vec3 res = sin(f16vec3(1.0hf));
+ f16vec3 res = f16vec3(0.841308594hf);
}
void fragment_main() {
@@ -38,7 +38,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sin_2c903b() {
- f16vec3 res = sin(f16vec3(1.0hf));
+ f16vec3 res = f16vec3(0.841308594hf);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.msl
index 908d21b..ee6759b 100644
--- a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sin_2c903b() {
- half3 res = sin(half3(1.0h));
+ half3 res = half3(0.841308594h);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.spvasm
index 1c24923..b33742a 100644
--- a/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/2c903b.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
- %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,38 +36,37 @@
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v3half = OpTypeVector %half 3
-%half_0x1p_0 = OpConstant %half 0x1p+0
- %18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+%half_0x1_aecpn1 = OpConstant %half 0x1.aecp-1
+ %16 = OpConstantComposite %v3half %half_0x1_aecpn1 %half_0x1_aecpn1 %half_0x1_aecpn1
%_ptr_Function_v3half = OpTypePointer Function %v3half
- %21 = OpConstantNull %v3half
- %22 = OpTypeFunction %v4float
+ %19 = OpConstantNull %v3half
+ %20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%sin_2c903b = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_v3half Function %21
- %13 = OpExtInst %v3half %16 Sin %18
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_v3half Function %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %sin_2c903b
+%vertex_main_inner = OpFunction %v4float None %20
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %sin_2c903b
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
+ %25 = OpLabel
+ %26 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %sin_2c903b
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sin_2c903b
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %34 = OpLabel
- %35 = OpFunctionCall %void %sin_2c903b
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sin_2c903b
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.dxc.hlsl
index 63a1b74..f203c72 100644
--- a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sin_3cca11() {
- vector<float16_t, 2> res = sin((float16_t(1.0h)).xx);
+ vector<float16_t, 2> res = (float16_t(0.841308594h)).xx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.glsl
index 9681333..b76cc11 100644
--- a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.glsl
@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sin_3cca11() {
- f16vec2 res = sin(f16vec2(1.0hf));
+ f16vec2 res = f16vec2(0.841308594hf);
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@
precision mediump float;
void sin_3cca11() {
- f16vec2 res = sin(f16vec2(1.0hf));
+ f16vec2 res = f16vec2(0.841308594hf);
}
void fragment_main() {
@@ -38,7 +38,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sin_3cca11() {
- f16vec2 res = sin(f16vec2(1.0hf));
+ f16vec2 res = f16vec2(0.841308594hf);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.msl
index 6606e7e..ea8f224 100644
--- a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sin_3cca11() {
- half2 res = sin(half2(1.0h));
+ half2 res = half2(0.841308594h);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.spvasm
index 3b56d50..d048b86 100644
--- a/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/3cca11.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
- %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,38 +36,37 @@
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v2half = OpTypeVector %half 2
-%half_0x1p_0 = OpConstant %half 0x1p+0
- %18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+%half_0x1_aecpn1 = OpConstant %half 0x1.aecp-1
+ %16 = OpConstantComposite %v2half %half_0x1_aecpn1 %half_0x1_aecpn1
%_ptr_Function_v2half = OpTypePointer Function %v2half
- %21 = OpConstantNull %v2half
- %22 = OpTypeFunction %v4float
+ %19 = OpConstantNull %v2half
+ %20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%sin_3cca11 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_v2half Function %21
- %13 = OpExtInst %v2half %16 Sin %18
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_v2half Function %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %sin_3cca11
+%vertex_main_inner = OpFunction %v4float None %20
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %sin_3cca11
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
+ %25 = OpLabel
+ %26 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %sin_3cca11
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sin_3cca11
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %34 = OpLabel
- %35 = OpFunctionCall %void %sin_3cca11
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sin_3cca11
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.dxc.hlsl
index 016064b..a047b7e 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sin_4e3979() {
- float4 res = sin((1.0f).xxxx);
+ float4 res = (0.841470957f).xxxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.fxc.hlsl
index 016064b..a047b7e 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void sin_4e3979() {
- float4 res = sin((1.0f).xxxx);
+ float4 res = (0.841470957f).xxxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.glsl
index f5f7946..18cdaba 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
void sin_4e3979() {
- vec4 res = sin(vec4(1.0f));
+ vec4 res = vec4(0.841470957f);
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@
precision mediump float;
void sin_4e3979() {
- vec4 res = sin(vec4(1.0f));
+ vec4 res = vec4(0.841470957f);
}
void fragment_main() {
@@ -35,7 +35,7 @@
#version 310 es
void sin_4e3979() {
- vec4 res = sin(vec4(1.0f));
+ vec4 res = vec4(0.841470957f);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.msl
index 08239ea..49514f3 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sin_4e3979() {
- float4 res = sin(float4(1.0f));
+ float4 res = float4(0.841470957f);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.spvasm
index a6eb84e..dbb70fb 100644
--- a/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/4e3979.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 31
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -31,36 +30,36 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
- %float_1 = OpConstant %float 1
- %16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%float_0_841470957 = OpConstant %float 0.841470957
+ %14 = OpConstantComposite %v4float %float_0_841470957 %float_0_841470957 %float_0_841470957 %float_0_841470957
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %19 = OpTypeFunction %v4float
+ %17 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
%sin_4e3979 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5
- %13 = OpExtInst %v4float %14 Sin %16
- OpStore %res %13
+ OpStore %res %14
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
- %21 = OpLabel
- %22 = OpFunctionCall %void %sin_4e3979
+%vertex_main_inner = OpFunction %v4float None %17
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %sin_4e3979
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %25
+ %22 = OpLabel
+ %23 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %23
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %sin_4e3979
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %sin_4e3979
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %sin_4e3979
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sin_4e3979
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.dxc.hlsl
index d80cc2c..157c610 100644
--- a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sin_5c0712() {
- vector<float16_t, 4> res = sin((float16_t(1.0h)).xxxx);
+ vector<float16_t, 4> res = (float16_t(0.841308594h)).xxxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.glsl
index 51b1238..f62212d 100644
--- a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.glsl
@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sin_5c0712() {
- f16vec4 res = sin(f16vec4(1.0hf));
+ f16vec4 res = f16vec4(0.841308594hf);
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@
precision mediump float;
void sin_5c0712() {
- f16vec4 res = sin(f16vec4(1.0hf));
+ f16vec4 res = f16vec4(0.841308594hf);
}
void fragment_main() {
@@ -38,7 +38,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sin_5c0712() {
- f16vec4 res = sin(f16vec4(1.0hf));
+ f16vec4 res = f16vec4(0.841308594hf);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.msl
index 2ca221f..5ba7f1e 100644
--- a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sin_5c0712() {
- half4 res = sin(half4(1.0h));
+ half4 res = half4(0.841308594h);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.spvasm
index bb518bd..c0f21df 100644
--- a/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/5c0712.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
- %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,38 +36,37 @@
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v4half = OpTypeVector %half 4
-%half_0x1p_0 = OpConstant %half 0x1p+0
- %18 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+%half_0x1_aecpn1 = OpConstant %half 0x1.aecp-1
+ %16 = OpConstantComposite %v4half %half_0x1_aecpn1 %half_0x1_aecpn1 %half_0x1_aecpn1 %half_0x1_aecpn1
%_ptr_Function_v4half = OpTypePointer Function %v4half
- %21 = OpConstantNull %v4half
- %22 = OpTypeFunction %v4float
+ %19 = OpConstantNull %v4half
+ %20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%sin_5c0712 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_v4half Function %21
- %13 = OpExtInst %v4half %16 Sin %18
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_v4half Function %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %sin_5c0712
+%vertex_main_inner = OpFunction %v4float None %20
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %sin_5c0712
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
+ %25 = OpLabel
+ %26 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %sin_5c0712
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sin_5c0712
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %34 = OpLabel
- %35 = OpFunctionCall %void %sin_5c0712
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sin_5c0712
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.dxc.hlsl
index 111f1b5..4309c66 100644
--- a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sin_66a59f() {
- float16_t res = sin(float16_t(1.0h));
+ float16_t res = float16_t(0.841308594h);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.glsl
index 68bffdd..ab2032d 100644
--- a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.glsl
@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sin_66a59f() {
- float16_t res = sin(1.0hf);
+ float16_t res = 0.841308594hf;
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@
precision mediump float;
void sin_66a59f() {
- float16_t res = sin(1.0hf);
+ float16_t res = 0.841308594hf;
}
void fragment_main() {
@@ -38,7 +38,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sin_66a59f() {
- float16_t res = sin(1.0hf);
+ float16_t res = 0.841308594hf;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.msl
index 9c32a94..0eb26eb 100644
--- a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sin_66a59f() {
- half res = sin(1.0h);
+ half res = 0.841308594h;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.spvasm
index 00d3618..3084682 100644
--- a/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/66a59f.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 32
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
- %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -36,37 +35,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
-%half_0x1p_0 = OpConstant %half 0x1p+0
+%half_0x1_aecpn1 = OpConstant %half 0x1.aecp-1
%_ptr_Function_half = OpTypePointer Function %half
- %19 = OpConstantNull %half
- %20 = OpTypeFunction %v4float
+ %17 = OpConstantNull %half
+ %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%sin_66a59f = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_half Function %19
- %13 = OpExtInst %half %15 Sin %half_0x1p_0
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_half Function %17
+ OpStore %res %half_0x1_aecpn1
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
- %22 = OpLabel
- %23 = OpFunctionCall %void %sin_66a59f
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sin_66a59f
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %26
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %sin_66a59f
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %sin_66a59f
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %sin_66a59f
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %sin_66a59f
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/67b03c.wgsl b/test/tint/builtins/gen/literal/sin/67b03c.wgsl
new file mode 100644
index 0000000..7d7a15a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/67b03c.wgsl
@@ -0,0 +1,43 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sin(vec<3, fa>) -> vec<3, fa>
+fn sin_67b03c() {
+ var res = sin(vec3(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_67b03c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_67b03c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_67b03c();
+}
diff --git a/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..90603d1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sin_67b03c() {
+ float3 res = (0.841470957f).xxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_67b03c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_67b03c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_67b03c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..90603d1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sin_67b03c() {
+ float3 res = (0.841470957f).xxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_67b03c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_67b03c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_67b03c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.glsl
new file mode 100644
index 0000000..aa3e311
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sin_67b03c() {
+ vec3 res = vec3(0.841470957f);
+}
+
+vec4 vertex_main() {
+ sin_67b03c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sin_67b03c() {
+ vec3 res = vec3(0.841470957f);
+}
+
+void fragment_main() {
+ sin_67b03c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sin_67b03c() {
+ vec3 res = vec3(0.841470957f);
+}
+
+void compute_main() {
+ sin_67b03c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.msl
new file mode 100644
index 0000000..8b83077
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_67b03c() {
+ float3 res = float3(0.841470957f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sin_67b03c();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sin_67b03c();
+ return;
+}
+
+kernel void compute_main() {
+ sin_67b03c();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.spvasm
new file mode 100644
index 0000000..78483fe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sin_67b03c "sin_67b03c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+%float_0_841470957 = OpConstant %float 0.841470957
+ %15 = OpConstantComposite %v3float %float_0_841470957 %float_0_841470957 %float_0_841470957
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %18 = OpConstantNull %v3float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %sin_67b03c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %18
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sin_67b03c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sin_67b03c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sin_67b03c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.wgsl
new file mode 100644
index 0000000..16abcc6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/67b03c.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn sin_67b03c() {
+ var res = sin(vec3(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_67b03c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_67b03c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_67b03c();
+}
diff --git a/test/tint/builtins/gen/literal/sin/68d3ab.wgsl b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl
new file mode 100644
index 0000000..365edfe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl
@@ -0,0 +1,43 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sin(vec<2, fa>) -> vec<2, fa>
+fn sin_68d3ab() {
+ var res = sin(vec2(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_68d3ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_68d3ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_68d3ab();
+}
diff --git a/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e6a7d5a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sin_68d3ab() {
+ float2 res = (0.841470957f).xx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_68d3ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_68d3ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_68d3ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e6a7d5a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sin_68d3ab() {
+ float2 res = (0.841470957f).xx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_68d3ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_68d3ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_68d3ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.glsl
new file mode 100644
index 0000000..6735f51
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sin_68d3ab() {
+ vec2 res = vec2(0.841470957f);
+}
+
+vec4 vertex_main() {
+ sin_68d3ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sin_68d3ab() {
+ vec2 res = vec2(0.841470957f);
+}
+
+void fragment_main() {
+ sin_68d3ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sin_68d3ab() {
+ vec2 res = vec2(0.841470957f);
+}
+
+void compute_main() {
+ sin_68d3ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.msl
new file mode 100644
index 0000000..e10514f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_68d3ab() {
+ float2 res = float2(0.841470957f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sin_68d3ab();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sin_68d3ab();
+ return;
+}
+
+kernel void compute_main() {
+ sin_68d3ab();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..32dd535
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sin_68d3ab "sin_68d3ab"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+%float_0_841470957 = OpConstant %float 0.841470957
+ %15 = OpConstantComposite %v2float %float_0_841470957 %float_0_841470957
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %18 = OpConstantNull %v2float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %sin_68d3ab = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %18
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sin_68d3ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sin_68d3ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sin_68d3ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..2411b26
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/68d3ab.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn sin_68d3ab() {
+ var res = sin(vec2(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_68d3ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_68d3ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_68d3ab();
+}
diff --git a/test/tint/builtins/gen/literal/sin/a9ab19.wgsl b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl
new file mode 100644
index 0000000..029bb48
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl
@@ -0,0 +1,43 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sin(fa) -> fa
+fn sin_a9ab19() {
+ var res = sin(1.);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_a9ab19();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_a9ab19();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_a9ab19();
+}
diff --git a/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f36fe78
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_a9ab19();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_a9ab19();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_a9ab19();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f36fe78
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_a9ab19();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_a9ab19();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_a9ab19();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.glsl
new file mode 100644
index 0000000..f6a5e5a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+vec4 vertex_main() {
+ sin_a9ab19();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+void fragment_main() {
+ sin_a9ab19();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+void compute_main() {
+ sin_a9ab19();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.msl
new file mode 100644
index 0000000..3c5cb44
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sin_a9ab19();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sin_a9ab19();
+ return;
+}
+
+kernel void compute_main() {
+ sin_a9ab19();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.spvasm
new file mode 100644
index 0000000..f340597
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sin_a9ab19 "sin_a9ab19"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%float_0_841470957 = OpConstant %float 0.841470957
+%_ptr_Function_float = OpTypePointer Function %float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %sin_a9ab19 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ OpStore %res %float_0_841470957
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %sin_a9ab19
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %sin_a9ab19
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sin_a9ab19
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.wgsl
new file mode 100644
index 0000000..5e8b038
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sin/a9ab19.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn sin_a9ab19() {
+ var res = sin(1.0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_a9ab19();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_a9ab19();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_a9ab19();
+}
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.dxc.hlsl
index 830387c..e7d7d5b 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sin_b78c91() {
- float res = sin(1.0f);
+ float res = 0.841470957f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.fxc.hlsl
index 830387c..e7d7d5b 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void sin_b78c91() {
- float res = sin(1.0f);
+ float res = 0.841470957f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.glsl
index e28e887..f4b82c9 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
void sin_b78c91() {
- float res = sin(1.0f);
+ float res = 0.841470957f;
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@
precision mediump float;
void sin_b78c91() {
- float res = sin(1.0f);
+ float res = 0.841470957f;
}
void fragment_main() {
@@ -35,7 +35,7 @@
#version 310 es
void sin_b78c91() {
- float res = sin(1.0f);
+ float res = 0.841470957f;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.msl
index 7acd0e6..6bfccd0 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sin_b78c91() {
- float res = sin(1.0f);
+ float res = 0.841470957f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.spvasm
index 574e10b..354c0be 100644
--- a/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/b78c91.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 30
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -31,35 +30,35 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
- %float_1 = OpConstant %float 1
+%float_0_841470957 = OpConstant %float 0.841470957
%_ptr_Function_float = OpTypePointer Function %float
- %18 = OpTypeFunction %v4float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
%sin_b78c91 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
- %13 = OpExtInst %float %14 Sin %float_1
- OpStore %res %13
+ OpStore %res %float_0_841470957
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
- %20 = OpLabel
- %21 = OpFunctionCall %void %sin_b78c91
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %sin_b78c91
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %24
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %sin_b78c91
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %sin_b78c91
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %sin_b78c91
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sin_b78c91
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.dxc.hlsl
index 6334daf..f3522fa 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sin_fc8bc4() {
- float2 res = sin((1.0f).xx);
+ float2 res = (0.841470957f).xx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.fxc.hlsl
index 6334daf..f3522fa 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void sin_fc8bc4() {
- float2 res = sin((1.0f).xx);
+ float2 res = (0.841470957f).xx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.glsl
index 58c95b8..07a0e81 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
void sin_fc8bc4() {
- vec2 res = sin(vec2(1.0f));
+ vec2 res = vec2(0.841470957f);
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@
precision mediump float;
void sin_fc8bc4() {
- vec2 res = sin(vec2(1.0f));
+ vec2 res = vec2(0.841470957f);
}
void fragment_main() {
@@ -35,7 +35,7 @@
#version 310 es
void sin_fc8bc4() {
- vec2 res = sin(vec2(1.0f));
+ vec2 res = vec2(0.841470957f);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.msl b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.msl
index 82021b4..20e905e 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sin_fc8bc4() {
- float2 res = sin(float2(1.0f));
+ float2 res = float2(0.841470957f);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.spvasm
index fbed393..abba398 100644
--- a/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sin/fc8bc4.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 33
; Schema: 0
OpCapability Shader
- %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -32,37 +31,37 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %float_1 = OpConstant %float 1
- %17 = OpConstantComposite %v2float %float_1 %float_1
+%float_0_841470957 = OpConstant %float 0.841470957
+ %15 = OpConstantComposite %v2float %float_0_841470957 %float_0_841470957
%_ptr_Function_v2float = OpTypePointer Function %v2float
- %20 = OpConstantNull %v2float
- %21 = OpTypeFunction %v4float
+ %18 = OpConstantNull %v2float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
%sin_fc8bc4 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %20
- %13 = OpExtInst %v2float %15 Sin %17
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_v2float Function %18
+ OpStore %res %15
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
- %23 = OpLabel
- %24 = OpFunctionCall %void %sin_fc8bc4
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sin_fc8bc4
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %27
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %sin_fc8bc4
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sin_fc8bc4
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %sin_fc8bc4
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sin_fc8bc4
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.dxc.hlsl
index 1f06f77..cba9089 100644
--- a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sinh_0908c1() {
- vector<float16_t, 3> res = sinh((float16_t(1.0h)).xxx);
+ vector<float16_t, 3> res = (float16_t(1.174804688h)).xxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.glsl
index 2c61420..637d66a 100644
--- a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.glsl
@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sinh_0908c1() {
- f16vec3 res = sinh(f16vec3(1.0hf));
+ f16vec3 res = f16vec3(1.174804688hf);
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@
precision mediump float;
void sinh_0908c1() {
- f16vec3 res = sinh(f16vec3(1.0hf));
+ f16vec3 res = f16vec3(1.174804688hf);
}
void fragment_main() {
@@ -38,7 +38,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sinh_0908c1() {
- f16vec3 res = sinh(f16vec3(1.0hf));
+ f16vec3 res = f16vec3(1.174804688hf);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.msl
index 54d1892..ae2eac9 100644
--- a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sinh_0908c1() {
- half3 res = sinh(half3(1.0h));
+ half3 res = half3(1.174804688h);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.spvasm
index 3a1f92c..c50a8ff 100644
--- a/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/0908c1.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
- %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,38 +36,37 @@
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v3half = OpTypeVector %half 3
-%half_0x1p_0 = OpConstant %half 0x1p+0
- %18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+%half_0x1_2ccp_0 = OpConstant %half 0x1.2ccp+0
+ %16 = OpConstantComposite %v3half %half_0x1_2ccp_0 %half_0x1_2ccp_0 %half_0x1_2ccp_0
%_ptr_Function_v3half = OpTypePointer Function %v3half
- %21 = OpConstantNull %v3half
- %22 = OpTypeFunction %v4float
+ %19 = OpConstantNull %v3half
+ %20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%sinh_0908c1 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_v3half Function %21
- %13 = OpExtInst %v3half %16 Sinh %18
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_v3half Function %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %sinh_0908c1
+%vertex_main_inner = OpFunction %v4float None %20
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %sinh_0908c1
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
+ %25 = OpLabel
+ %26 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %sinh_0908c1
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sinh_0908c1
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %34 = OpLabel
- %35 = OpFunctionCall %void %sinh_0908c1
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sinh_0908c1
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.dxc.hlsl
index 678cef4..2fffd3e 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sinh_445e33() {
- float4 res = sinh((1.0f).xxxx);
+ float4 res = (1.175201178f).xxxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.fxc.hlsl
index 678cef4..2fffd3e 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void sinh_445e33() {
- float4 res = sinh((1.0f).xxxx);
+ float4 res = (1.175201178f).xxxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.glsl
index 2d90f50..3dcdacd 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
void sinh_445e33() {
- vec4 res = sinh(vec4(1.0f));
+ vec4 res = vec4(1.175201178f);
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@
precision mediump float;
void sinh_445e33() {
- vec4 res = sinh(vec4(1.0f));
+ vec4 res = vec4(1.175201178f);
}
void fragment_main() {
@@ -35,7 +35,7 @@
#version 310 es
void sinh_445e33() {
- vec4 res = sinh(vec4(1.0f));
+ vec4 res = vec4(1.175201178f);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.msl
index 4f0fdbc..412a087 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sinh_445e33() {
- float4 res = sinh(float4(1.0f));
+ float4 res = float4(1.175201178f);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.spvasm
index 1d1c9f6..bd640f7 100644
--- a/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/445e33.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 31
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -31,36 +30,36 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
- %float_1 = OpConstant %float 1
- %16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%float_1_17520118 = OpConstant %float 1.17520118
+ %14 = OpConstantComposite %v4float %float_1_17520118 %float_1_17520118 %float_1_17520118 %float_1_17520118
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %19 = OpTypeFunction %v4float
+ %17 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
%sinh_445e33 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5
- %13 = OpExtInst %v4float %14 Sinh %16
- OpStore %res %13
+ OpStore %res %14
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
- %21 = OpLabel
- %22 = OpFunctionCall %void %sinh_445e33
+%vertex_main_inner = OpFunction %v4float None %17
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %sinh_445e33
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %24 = OpLabel
- %25 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %25
+ %22 = OpLabel
+ %23 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %23
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %void %sinh_445e33
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %sinh_445e33
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %30 = OpLabel
- %31 = OpFunctionCall %void %sinh_445e33
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sinh_445e33
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.dxc.hlsl
index 7b8e6ce..451e9cf 100644
--- a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sinh_69cce2() {
- float16_t res = sinh(float16_t(1.0h));
+ float16_t res = float16_t(1.174804688h);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.glsl
index a64c8dd..7e42f16 100644
--- a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.glsl
@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sinh_69cce2() {
- float16_t res = sinh(1.0hf);
+ float16_t res = 1.174804688hf;
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@
precision mediump float;
void sinh_69cce2() {
- float16_t res = sinh(1.0hf);
+ float16_t res = 1.174804688hf;
}
void fragment_main() {
@@ -38,7 +38,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sinh_69cce2() {
- float16_t res = sinh(1.0hf);
+ float16_t res = 1.174804688hf;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.msl
index ae6c123..61ee6d4 100644
--- a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sinh_69cce2() {
- half res = sinh(1.0h);
+ half res = 1.174804688h;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.spvasm
index af0bf6f..27ce56b 100644
--- a/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/69cce2.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 32
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
- %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -36,37 +35,36 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
-%half_0x1p_0 = OpConstant %half 0x1p+0
+%half_0x1_2ccp_0 = OpConstant %half 0x1.2ccp+0
%_ptr_Function_half = OpTypePointer Function %half
- %19 = OpConstantNull %half
- %20 = OpTypeFunction %v4float
+ %17 = OpConstantNull %half
+ %18 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%sinh_69cce2 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_half Function %19
- %13 = OpExtInst %half %15 Sinh %half_0x1p_0
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_half Function %17
+ OpStore %res %half_0x1_2ccp_0
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
- %22 = OpLabel
- %23 = OpFunctionCall %void %sinh_69cce2
+%vertex_main_inner = OpFunction %v4float None %18
+ %20 = OpLabel
+ %21 = OpFunctionCall %void %sinh_69cce2
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %25 = OpLabel
- %26 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %26
+ %23 = OpLabel
+ %24 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %24
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %sinh_69cce2
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %sinh_69cce2
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %sinh_69cce2
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %sinh_69cce2
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl
new file mode 100644
index 0000000..2d938bb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl
@@ -0,0 +1,43 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sinh(vec<3, fa>) -> vec<3, fa>
+fn sinh_77a2a3() {
+ var res = sinh(vec3(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_77a2a3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_77a2a3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_77a2a3();
+}
diff --git a/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..cc0e402
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_77a2a3() {
+ float3 res = (1.175201178f).xxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_77a2a3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_77a2a3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_77a2a3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..cc0e402
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_77a2a3() {
+ float3 res = (1.175201178f).xxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_77a2a3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_77a2a3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_77a2a3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.glsl
new file mode 100644
index 0000000..4853046
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sinh_77a2a3() {
+ vec3 res = vec3(1.175201178f);
+}
+
+vec4 vertex_main() {
+ sinh_77a2a3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sinh_77a2a3() {
+ vec3 res = vec3(1.175201178f);
+}
+
+void fragment_main() {
+ sinh_77a2a3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sinh_77a2a3() {
+ vec3 res = vec3(1.175201178f);
+}
+
+void compute_main() {
+ sinh_77a2a3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.msl
new file mode 100644
index 0000000..2370cd2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_77a2a3() {
+ float3 res = float3(1.175201178f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sinh_77a2a3();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sinh_77a2a3();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_77a2a3();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.spvasm
new file mode 100644
index 0000000..b255da3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sinh_77a2a3 "sinh_77a2a3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+%float_1_17520118 = OpConstant %float 1.17520118
+ %15 = OpConstantComposite %v3float %float_1_17520118 %float_1_17520118 %float_1_17520118
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %18 = OpConstantNull %v3float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%sinh_77a2a3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %18
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sinh_77a2a3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sinh_77a2a3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sinh_77a2a3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.wgsl
new file mode 100644
index 0000000..af08099
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/77a2a3.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn sinh_77a2a3() {
+ var res = sinh(vec3(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_77a2a3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_77a2a3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_77a2a3();
+}
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.dxc.hlsl
index ead4827..fc2f01c 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sinh_7bb598() {
- float res = sinh(1.0f);
+ float res = 1.175201178f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.fxc.hlsl
index ead4827..fc2f01c 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void sinh_7bb598() {
- float res = sinh(1.0f);
+ float res = 1.175201178f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.glsl
index a30194b..cac34fc 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
void sinh_7bb598() {
- float res = sinh(1.0f);
+ float res = 1.175201178f;
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@
precision mediump float;
void sinh_7bb598() {
- float res = sinh(1.0f);
+ float res = 1.175201178f;
}
void fragment_main() {
@@ -35,7 +35,7 @@
#version 310 es
void sinh_7bb598() {
- float res = sinh(1.0f);
+ float res = 1.175201178f;
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.msl
index 208c381..d52eeca 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sinh_7bb598() {
- float res = sinh(1.0f);
+ float res = 1.175201178f;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.spvasm
index 746f01c..f9828f1 100644
--- a/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/7bb598.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 30
; Schema: 0
OpCapability Shader
- %14 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -31,35 +30,35 @@
%vertex_point_size = OpVariable %_ptr_Output_float Output %8
%void = OpTypeVoid
%9 = OpTypeFunction %void
- %float_1 = OpConstant %float 1
+%float_1_17520118 = OpConstant %float 1.17520118
%_ptr_Function_float = OpTypePointer Function %float
- %18 = OpTypeFunction %v4float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
%sinh_7bb598 = OpFunction %void None %9
%12 = OpLabel
%res = OpVariable %_ptr_Function_float Function %8
- %13 = OpExtInst %float %14 Sinh %float_1
- OpStore %res %13
+ OpStore %res %float_1_17520118
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
- %20 = OpLabel
- %21 = OpFunctionCall %void %sinh_7bb598
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %sinh_7bb598
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %23 = OpLabel
- %24 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %24
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %void %sinh_7bb598
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %sinh_7bb598
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %sinh_7bb598
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sinh_7bb598
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.dxc.hlsl
index cdcc434..051609e 100644
--- a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sinh_924f19() {
- vector<float16_t, 2> res = sinh((float16_t(1.0h)).xx);
+ vector<float16_t, 2> res = (float16_t(1.174804688h)).xx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.glsl
index fd2eb90..c651991 100644
--- a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.glsl
@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sinh_924f19() {
- f16vec2 res = sinh(f16vec2(1.0hf));
+ f16vec2 res = f16vec2(1.174804688hf);
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@
precision mediump float;
void sinh_924f19() {
- f16vec2 res = sinh(f16vec2(1.0hf));
+ f16vec2 res = f16vec2(1.174804688hf);
}
void fragment_main() {
@@ -38,7 +38,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sinh_924f19() {
- f16vec2 res = sinh(f16vec2(1.0hf));
+ f16vec2 res = f16vec2(1.174804688hf);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.msl
index 64fe921..db1590e 100644
--- a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sinh_924f19() {
- half2 res = sinh(half2(1.0h));
+ half2 res = half2(1.174804688h);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.spvasm
index 59e22b3..d57f22e 100644
--- a/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/924f19.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
- %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,38 +36,37 @@
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v2half = OpTypeVector %half 2
-%half_0x1p_0 = OpConstant %half 0x1p+0
- %18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+%half_0x1_2ccp_0 = OpConstant %half 0x1.2ccp+0
+ %16 = OpConstantComposite %v2half %half_0x1_2ccp_0 %half_0x1_2ccp_0
%_ptr_Function_v2half = OpTypePointer Function %v2half
- %21 = OpConstantNull %v2half
- %22 = OpTypeFunction %v4float
+ %19 = OpConstantNull %v2half
+ %20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%sinh_924f19 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_v2half Function %21
- %13 = OpExtInst %v2half %16 Sinh %18
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_v2half Function %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %sinh_924f19
+%vertex_main_inner = OpFunction %v4float None %20
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %sinh_924f19
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
+ %25 = OpLabel
+ %26 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %sinh_924f19
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sinh_924f19
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %34 = OpLabel
- %35 = OpFunctionCall %void %sinh_924f19
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sinh_924f19
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/9c1092.wgsl b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl
new file mode 100644
index 0000000..26faf82
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl
@@ -0,0 +1,43 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sinh(vec<2, fa>) -> vec<2, fa>
+fn sinh_9c1092() {
+ var res = sinh(vec2(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_9c1092();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_9c1092();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_9c1092();
+}
diff --git a/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9aef2e9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_9c1092() {
+ float2 res = (1.175201178f).xx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_9c1092();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_9c1092();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_9c1092();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9aef2e9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_9c1092() {
+ float2 res = (1.175201178f).xx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_9c1092();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_9c1092();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_9c1092();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.glsl
new file mode 100644
index 0000000..f6a45bd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sinh_9c1092() {
+ vec2 res = vec2(1.175201178f);
+}
+
+vec4 vertex_main() {
+ sinh_9c1092();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sinh_9c1092() {
+ vec2 res = vec2(1.175201178f);
+}
+
+void fragment_main() {
+ sinh_9c1092();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sinh_9c1092() {
+ vec2 res = vec2(1.175201178f);
+}
+
+void compute_main() {
+ sinh_9c1092();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.msl
new file mode 100644
index 0000000..04d9187
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_9c1092() {
+ float2 res = float2(1.175201178f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sinh_9c1092();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sinh_9c1092();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_9c1092();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.spvasm
new file mode 100644
index 0000000..6ac0c69
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sinh_9c1092 "sinh_9c1092"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+%float_1_17520118 = OpConstant %float 1.17520118
+ %15 = OpConstantComposite %v2float %float_1_17520118 %float_1_17520118
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %18 = OpConstantNull %v2float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%sinh_9c1092 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %18
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sinh_9c1092
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sinh_9c1092
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sinh_9c1092
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.wgsl
new file mode 100644
index 0000000..cee9cf6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/9c1092.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn sinh_9c1092() {
+ var res = sinh(vec2(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_9c1092();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_9c1092();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_9c1092();
+}
diff --git a/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl
new file mode 100644
index 0000000..20558b8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl
@@ -0,0 +1,43 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sinh(vec<4, fa>) -> vec<4, fa>
+fn sinh_a3da7c() {
+ var res = sinh(vec4(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_a3da7c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_a3da7c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_a3da7c();
+}
diff --git a/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..32eaad5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_a3da7c() {
+ float4 res = (1.175201178f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_a3da7c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_a3da7c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_a3da7c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..32eaad5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_a3da7c() {
+ float4 res = (1.175201178f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_a3da7c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_a3da7c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_a3da7c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.glsl
new file mode 100644
index 0000000..d0068d8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sinh_a3da7c() {
+ vec4 res = vec4(1.175201178f);
+}
+
+vec4 vertex_main() {
+ sinh_a3da7c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sinh_a3da7c() {
+ vec4 res = vec4(1.175201178f);
+}
+
+void fragment_main() {
+ sinh_a3da7c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sinh_a3da7c() {
+ vec4 res = vec4(1.175201178f);
+}
+
+void compute_main() {
+ sinh_a3da7c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.msl
new file mode 100644
index 0000000..2e9d194
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_a3da7c() {
+ float4 res = float4(1.175201178f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sinh_a3da7c();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sinh_a3da7c();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_a3da7c();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.spvasm
new file mode 100644
index 0000000..0c80b67
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sinh_a3da7c "sinh_a3da7c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%float_1_17520118 = OpConstant %float 1.17520118
+ %14 = OpConstantComposite %v4float %float_1_17520118 %float_1_17520118 %float_1_17520118 %float_1_17520118
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%sinh_a3da7c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %17
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %sinh_a3da7c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ %23 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %23
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %sinh_a3da7c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sinh_a3da7c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.wgsl
new file mode 100644
index 0000000..42da3ab
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/a3da7c.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn sinh_a3da7c() {
+ var res = sinh(vec4(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_a3da7c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_a3da7c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_a3da7c();
+}
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.dxc.hlsl
index 9961a6a..2f9bb17 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sinh_b9860e() {
- float2 res = sinh((1.0f).xx);
+ float2 res = (1.175201178f).xx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.fxc.hlsl
index 9961a6a..2f9bb17 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void sinh_b9860e() {
- float2 res = sinh((1.0f).xx);
+ float2 res = (1.175201178f).xx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.glsl
index 83d01b7..b52b933 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
void sinh_b9860e() {
- vec2 res = sinh(vec2(1.0f));
+ vec2 res = vec2(1.175201178f);
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@
precision mediump float;
void sinh_b9860e() {
- vec2 res = sinh(vec2(1.0f));
+ vec2 res = vec2(1.175201178f);
}
void fragment_main() {
@@ -35,7 +35,7 @@
#version 310 es
void sinh_b9860e() {
- vec2 res = sinh(vec2(1.0f));
+ vec2 res = vec2(1.175201178f);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.msl
index 0b99457..3d4fb9b 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sinh_b9860e() {
- float2 res = sinh(float2(1.0f));
+ float2 res = float2(1.175201178f);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.spvasm
index f09ce35..d8a3618 100644
--- a/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/b9860e.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 33
; Schema: 0
OpCapability Shader
- %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -32,37 +31,37 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v2float = OpTypeVector %float 2
- %float_1 = OpConstant %float 1
- %17 = OpConstantComposite %v2float %float_1 %float_1
+%float_1_17520118 = OpConstant %float 1.17520118
+ %15 = OpConstantComposite %v2float %float_1_17520118 %float_1_17520118
%_ptr_Function_v2float = OpTypePointer Function %v2float
- %20 = OpConstantNull %v2float
- %21 = OpTypeFunction %v4float
+ %18 = OpConstantNull %v2float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
%sinh_b9860e = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_v2float Function %20
- %13 = OpExtInst %v2float %15 Sinh %17
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_v2float Function %18
+ OpStore %res %15
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
- %23 = OpLabel
- %24 = OpFunctionCall %void %sinh_b9860e
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sinh_b9860e
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %27
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %sinh_b9860e
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sinh_b9860e
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %sinh_b9860e
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sinh_b9860e
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.dxc.hlsl
index a5b5e1c..3e7ff80 100644
--- a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sinh_ba7e25() {
- vector<float16_t, 4> res = sinh((float16_t(1.0h)).xxxx);
+ vector<float16_t, 4> res = (float16_t(1.174804688h)).xxxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.glsl
index f404443..6a9a369 100644
--- a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.glsl
@@ -2,7 +2,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sinh_ba7e25() {
- f16vec4 res = sinh(f16vec4(1.0hf));
+ f16vec4 res = f16vec4(1.174804688hf);
}
vec4 vertex_main() {
@@ -23,7 +23,7 @@
precision mediump float;
void sinh_ba7e25() {
- f16vec4 res = sinh(f16vec4(1.0hf));
+ f16vec4 res = f16vec4(1.174804688hf);
}
void fragment_main() {
@@ -38,7 +38,7 @@
#extension GL_AMD_gpu_shader_half_float : require
void sinh_ba7e25() {
- f16vec4 res = sinh(f16vec4(1.0hf));
+ f16vec4 res = f16vec4(1.174804688hf);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.msl
index bd5ec4c..897d183 100644
--- a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sinh_ba7e25() {
- half4 res = sinh(half4(1.0h));
+ half4 res = half4(1.174804688h);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.spvasm
index 51403b1..647555d 100644
--- a/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/ba7e25.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
; Schema: 0
OpCapability Shader
OpCapability Float16
OpCapability UniformAndStorageBuffer16BitAccess
OpCapability StorageBuffer16BitAccess
OpCapability StorageInputOutput16
- %16 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,38 +36,37 @@
%9 = OpTypeFunction %void
%half = OpTypeFloat 16
%v4half = OpTypeVector %half 4
-%half_0x1p_0 = OpConstant %half 0x1p+0
- %18 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+%half_0x1_2ccp_0 = OpConstant %half 0x1.2ccp+0
+ %16 = OpConstantComposite %v4half %half_0x1_2ccp_0 %half_0x1_2ccp_0 %half_0x1_2ccp_0 %half_0x1_2ccp_0
%_ptr_Function_v4half = OpTypePointer Function %v4half
- %21 = OpConstantNull %v4half
- %22 = OpTypeFunction %v4float
+ %19 = OpConstantNull %v4half
+ %20 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%sinh_ba7e25 = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_v4half Function %21
- %13 = OpExtInst %v4half %16 Sinh %18
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_v4half Function %19
+ OpStore %res %16
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %sinh_ba7e25
+%vertex_main_inner = OpFunction %v4float None %20
+ %22 = OpLabel
+ %23 = OpFunctionCall %void %sinh_ba7e25
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
+ %25 = OpLabel
+ %26 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %26
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %31 = OpLabel
- %32 = OpFunctionCall %void %sinh_ba7e25
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sinh_ba7e25
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %34 = OpLabel
- %35 = OpFunctionCall %void %sinh_ba7e25
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %sinh_ba7e25
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/c4df74.wgsl b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl
new file mode 100644
index 0000000..c91c0d6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl
@@ -0,0 +1,43 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sinh(fa) -> fa
+fn sinh_c4df74() {
+ var res = sinh(1.);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_c4df74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_c4df74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_c4df74();
+}
diff --git a/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..05a1561
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_c4df74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_c4df74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_c4df74();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..05a1561
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_c4df74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_c4df74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_c4df74();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.glsl
new file mode 100644
index 0000000..49d4879
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+vec4 vertex_main() {
+ sinh_c4df74();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+void fragment_main() {
+ sinh_c4df74();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+void compute_main() {
+ sinh_c4df74();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.msl
new file mode 100644
index 0000000..9cfbeae
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sinh_c4df74();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sinh_c4df74();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_c4df74();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.spvasm
new file mode 100644
index 0000000..8eb5089
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sinh_c4df74 "sinh_c4df74"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%float_1_17520118 = OpConstant %float 1.17520118
+%_ptr_Function_float = OpTypePointer Function %float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%sinh_c4df74 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ OpStore %res %float_1_17520118
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %sinh_c4df74
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %sinh_c4df74
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sinh_c4df74
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.wgsl
new file mode 100644
index 0000000..8475861
--- /dev/null
+++ b/test/tint/builtins/gen/literal/sinh/c4df74.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn sinh_c4df74() {
+ var res = sinh(1.0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_c4df74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_c4df74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_c4df74();
+}
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.dxc.hlsl
index 201111f..d3d4751 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
void sinh_c9a5eb() {
- float3 res = sinh((1.0f).xxx);
+ float3 res = (1.175201178f).xxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.fxc.hlsl
index 201111f..d3d4751 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
void sinh_c9a5eb() {
- float3 res = sinh((1.0f).xxx);
+ float3 res = (1.175201178f).xxx;
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.glsl
index 36f42dc..f497e71 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.glsl
@@ -1,7 +1,7 @@
#version 310 es
void sinh_c9a5eb() {
- vec3 res = sinh(vec3(1.0f));
+ vec3 res = vec3(1.175201178f);
}
vec4 vertex_main() {
@@ -21,7 +21,7 @@
precision mediump float;
void sinh_c9a5eb() {
- vec3 res = sinh(vec3(1.0f));
+ vec3 res = vec3(1.175201178f);
}
void fragment_main() {
@@ -35,7 +35,7 @@
#version 310 es
void sinh_c9a5eb() {
- vec3 res = sinh(vec3(1.0f));
+ vec3 res = vec3(1.175201178f);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.msl b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.msl
index de40db2..4991e13 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
void sinh_c9a5eb() {
- float3 res = sinh(float3(1.0f));
+ float3 res = float3(1.175201178f);
}
struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.spvasm
index 3e1041a..bf1af9e 100644
--- a/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/sinh/c9a5eb.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 33
; Schema: 0
OpCapability Shader
- %15 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -32,37 +31,37 @@
%void = OpTypeVoid
%9 = OpTypeFunction %void
%v3float = OpTypeVector %float 3
- %float_1 = OpConstant %float 1
- %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+%float_1_17520118 = OpConstant %float 1.17520118
+ %15 = OpConstantComposite %v3float %float_1_17520118 %float_1_17520118 %float_1_17520118
%_ptr_Function_v3float = OpTypePointer Function %v3float
- %20 = OpConstantNull %v3float
- %21 = OpTypeFunction %v4float
+ %18 = OpConstantNull %v3float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
%sinh_c9a5eb = OpFunction %void None %9
%12 = OpLabel
- %res = OpVariable %_ptr_Function_v3float Function %20
- %13 = OpExtInst %v3float %15 Sinh %17
- OpStore %res %13
+ %res = OpVariable %_ptr_Function_v3float Function %18
+ OpStore %res %15
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %21
- %23 = OpLabel
- %24 = OpFunctionCall %void %sinh_c9a5eb
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sinh_c9a5eb
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %9
- %26 = OpLabel
- %27 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %27
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %9
- %29 = OpLabel
- %30 = OpFunctionCall %void %sinh_c9a5eb
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sinh_c9a5eb
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %9
- %32 = OpLabel
- %33 = OpFunctionCall %void %sinh_c9a5eb
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sinh_c9a5eb
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/15b2c6.wgsl b/test/tint/builtins/gen/var/sin/15b2c6.wgsl
new file mode 100644
index 0000000..8d53440
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/15b2c6.wgsl
@@ -0,0 +1,44 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sin(vec<4, fa>) -> vec<4, fa>
+fn sin_15b2c6() {
+ const arg_0 = vec4(1.);
+ var res = sin(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_15b2c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_15b2c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_15b2c6();
+}
diff --git a/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8b97a9d
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sin_15b2c6() {
+ float4 res = (0.841470957f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_15b2c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_15b2c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_15b2c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8b97a9d
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sin_15b2c6() {
+ float4 res = (0.841470957f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_15b2c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_15b2c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_15b2c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.glsl
new file mode 100644
index 0000000..2ba8b10
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sin_15b2c6() {
+ vec4 res = vec4(0.841470957f);
+}
+
+vec4 vertex_main() {
+ sin_15b2c6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sin_15b2c6() {
+ vec4 res = vec4(0.841470957f);
+}
+
+void fragment_main() {
+ sin_15b2c6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sin_15b2c6() {
+ vec4 res = vec4(0.841470957f);
+}
+
+void compute_main() {
+ sin_15b2c6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.msl
new file mode 100644
index 0000000..4f69b5b
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_15b2c6() {
+ float4 res = float4(0.841470957f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sin_15b2c6();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sin_15b2c6();
+ return;
+}
+
+kernel void compute_main() {
+ sin_15b2c6();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.spvasm
new file mode 100644
index 0000000..7e73f04
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sin_15b2c6 "sin_15b2c6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%float_0_841470957 = OpConstant %float 0.841470957
+ %14 = OpConstantComposite %v4float %float_0_841470957 %float_0_841470957 %float_0_841470957 %float_0_841470957
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %sin_15b2c6 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %17
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %sin_15b2c6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ %23 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %23
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %sin_15b2c6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sin_15b2c6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.wgsl
new file mode 100644
index 0000000..bf5e782
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/15b2c6.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn sin_15b2c6() {
+ const arg_0 = vec4(1.0);
+ var res = sin(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_15b2c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_15b2c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_15b2c6();
+}
diff --git a/test/tint/builtins/gen/var/sin/67b03c.wgsl b/test/tint/builtins/gen/var/sin/67b03c.wgsl
new file mode 100644
index 0000000..da705d3
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/67b03c.wgsl
@@ -0,0 +1,44 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sin(vec<3, fa>) -> vec<3, fa>
+fn sin_67b03c() {
+ const arg_0 = vec3(1.);
+ var res = sin(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_67b03c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_67b03c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_67b03c();
+}
diff --git a/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..90603d1
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sin_67b03c() {
+ float3 res = (0.841470957f).xxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_67b03c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_67b03c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_67b03c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..90603d1
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sin_67b03c() {
+ float3 res = (0.841470957f).xxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_67b03c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_67b03c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_67b03c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.glsl
new file mode 100644
index 0000000..aa3e311
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sin_67b03c() {
+ vec3 res = vec3(0.841470957f);
+}
+
+vec4 vertex_main() {
+ sin_67b03c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sin_67b03c() {
+ vec3 res = vec3(0.841470957f);
+}
+
+void fragment_main() {
+ sin_67b03c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sin_67b03c() {
+ vec3 res = vec3(0.841470957f);
+}
+
+void compute_main() {
+ sin_67b03c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.msl
new file mode 100644
index 0000000..8b83077
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_67b03c() {
+ float3 res = float3(0.841470957f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sin_67b03c();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sin_67b03c();
+ return;
+}
+
+kernel void compute_main() {
+ sin_67b03c();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.spvasm
new file mode 100644
index 0000000..78483fe
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sin_67b03c "sin_67b03c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+%float_0_841470957 = OpConstant %float 0.841470957
+ %15 = OpConstantComposite %v3float %float_0_841470957 %float_0_841470957 %float_0_841470957
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %18 = OpConstantNull %v3float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %sin_67b03c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %18
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sin_67b03c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sin_67b03c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sin_67b03c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.wgsl
new file mode 100644
index 0000000..a7c2a90
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/67b03c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn sin_67b03c() {
+ const arg_0 = vec3(1.0);
+ var res = sin(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_67b03c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_67b03c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_67b03c();
+}
diff --git a/test/tint/builtins/gen/var/sin/68d3ab.wgsl b/test/tint/builtins/gen/var/sin/68d3ab.wgsl
new file mode 100644
index 0000000..4c1ee6b
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/68d3ab.wgsl
@@ -0,0 +1,44 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sin(vec<2, fa>) -> vec<2, fa>
+fn sin_68d3ab() {
+ const arg_0 = vec2(1.);
+ var res = sin(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_68d3ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_68d3ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_68d3ab();
+}
diff --git a/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e6a7d5a
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sin_68d3ab() {
+ float2 res = (0.841470957f).xx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_68d3ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_68d3ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_68d3ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e6a7d5a
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sin_68d3ab() {
+ float2 res = (0.841470957f).xx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_68d3ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_68d3ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_68d3ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.glsl
new file mode 100644
index 0000000..6735f51
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sin_68d3ab() {
+ vec2 res = vec2(0.841470957f);
+}
+
+vec4 vertex_main() {
+ sin_68d3ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sin_68d3ab() {
+ vec2 res = vec2(0.841470957f);
+}
+
+void fragment_main() {
+ sin_68d3ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sin_68d3ab() {
+ vec2 res = vec2(0.841470957f);
+}
+
+void compute_main() {
+ sin_68d3ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.msl
new file mode 100644
index 0000000..e10514f
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_68d3ab() {
+ float2 res = float2(0.841470957f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sin_68d3ab();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sin_68d3ab();
+ return;
+}
+
+kernel void compute_main() {
+ sin_68d3ab();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..32dd535
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sin_68d3ab "sin_68d3ab"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+%float_0_841470957 = OpConstant %float 0.841470957
+ %15 = OpConstantComposite %v2float %float_0_841470957 %float_0_841470957
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %18 = OpConstantNull %v2float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %sin_68d3ab = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %18
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sin_68d3ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sin_68d3ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sin_68d3ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..26fc3f9
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/68d3ab.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn sin_68d3ab() {
+ const arg_0 = vec2(1.0);
+ var res = sin(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_68d3ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_68d3ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_68d3ab();
+}
diff --git a/test/tint/builtins/gen/var/sin/a9ab19.wgsl b/test/tint/builtins/gen/var/sin/a9ab19.wgsl
new file mode 100644
index 0000000..88e9aad
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/a9ab19.wgsl
@@ -0,0 +1,44 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sin(fa) -> fa
+fn sin_a9ab19() {
+ const arg_0 = 1.;
+ var res = sin(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_a9ab19();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_a9ab19();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_a9ab19();
+}
diff --git a/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f36fe78
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_a9ab19();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_a9ab19();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_a9ab19();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f36fe78
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sin_a9ab19();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sin_a9ab19();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sin_a9ab19();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.glsl b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.glsl
new file mode 100644
index 0000000..f6a5e5a
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+vec4 vertex_main() {
+ sin_a9ab19();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+void fragment_main() {
+ sin_a9ab19();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+void compute_main() {
+ sin_a9ab19();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.msl b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.msl
new file mode 100644
index 0000000..3c5cb44
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sin_a9ab19() {
+ float res = 0.841470957f;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sin_a9ab19();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sin_a9ab19();
+ return;
+}
+
+kernel void compute_main() {
+ sin_a9ab19();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.spvasm
new file mode 100644
index 0000000..f340597
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sin_a9ab19 "sin_a9ab19"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%float_0_841470957 = OpConstant %float 0.841470957
+%_ptr_Function_float = OpTypePointer Function %float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+ %sin_a9ab19 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ OpStore %res %float_0_841470957
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %sin_a9ab19
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %sin_a9ab19
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sin_a9ab19
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.wgsl
new file mode 100644
index 0000000..1bcc280
--- /dev/null
+++ b/test/tint/builtins/gen/var/sin/a9ab19.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn sin_a9ab19() {
+ const arg_0 = 1.0;
+ var res = sin(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sin_a9ab19();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sin_a9ab19();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sin_a9ab19();
+}
diff --git a/test/tint/builtins/gen/var/sinh/77a2a3.wgsl b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl
new file mode 100644
index 0000000..522bef7
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl
@@ -0,0 +1,44 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sinh(vec<3, fa>) -> vec<3, fa>
+fn sinh_77a2a3() {
+ const arg_0 = vec3(1.);
+ var res = sinh(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_77a2a3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_77a2a3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_77a2a3();
+}
diff --git a/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..cc0e402
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_77a2a3() {
+ float3 res = (1.175201178f).xxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_77a2a3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_77a2a3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_77a2a3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..cc0e402
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_77a2a3() {
+ float3 res = (1.175201178f).xxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_77a2a3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_77a2a3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_77a2a3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.glsl
new file mode 100644
index 0000000..4853046
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sinh_77a2a3() {
+ vec3 res = vec3(1.175201178f);
+}
+
+vec4 vertex_main() {
+ sinh_77a2a3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sinh_77a2a3() {
+ vec3 res = vec3(1.175201178f);
+}
+
+void fragment_main() {
+ sinh_77a2a3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sinh_77a2a3() {
+ vec3 res = vec3(1.175201178f);
+}
+
+void compute_main() {
+ sinh_77a2a3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.msl
new file mode 100644
index 0000000..2370cd2
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_77a2a3() {
+ float3 res = float3(1.175201178f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sinh_77a2a3();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sinh_77a2a3();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_77a2a3();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.spvasm
new file mode 100644
index 0000000..b255da3
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sinh_77a2a3 "sinh_77a2a3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v3float = OpTypeVector %float 3
+%float_1_17520118 = OpConstant %float 1.17520118
+ %15 = OpConstantComposite %v3float %float_1_17520118 %float_1_17520118 %float_1_17520118
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+ %18 = OpConstantNull %v3float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%sinh_77a2a3 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v3float Function %18
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sinh_77a2a3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sinh_77a2a3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sinh_77a2a3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.wgsl
new file mode 100644
index 0000000..20f48bc
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/77a2a3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn sinh_77a2a3() {
+ const arg_0 = vec3(1.0);
+ var res = sinh(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_77a2a3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_77a2a3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_77a2a3();
+}
diff --git a/test/tint/builtins/gen/var/sinh/9c1092.wgsl b/test/tint/builtins/gen/var/sinh/9c1092.wgsl
new file mode 100644
index 0000000..8de44c6
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/9c1092.wgsl
@@ -0,0 +1,44 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sinh(vec<2, fa>) -> vec<2, fa>
+fn sinh_9c1092() {
+ const arg_0 = vec2(1.);
+ var res = sinh(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_9c1092();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_9c1092();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_9c1092();
+}
diff --git a/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9aef2e9
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_9c1092() {
+ float2 res = (1.175201178f).xx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_9c1092();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_9c1092();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_9c1092();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9aef2e9
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_9c1092() {
+ float2 res = (1.175201178f).xx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_9c1092();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_9c1092();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_9c1092();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.glsl
new file mode 100644
index 0000000..f6a45bd
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sinh_9c1092() {
+ vec2 res = vec2(1.175201178f);
+}
+
+vec4 vertex_main() {
+ sinh_9c1092();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sinh_9c1092() {
+ vec2 res = vec2(1.175201178f);
+}
+
+void fragment_main() {
+ sinh_9c1092();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sinh_9c1092() {
+ vec2 res = vec2(1.175201178f);
+}
+
+void compute_main() {
+ sinh_9c1092();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.msl
new file mode 100644
index 0000000..04d9187
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_9c1092() {
+ float2 res = float2(1.175201178f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sinh_9c1092();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sinh_9c1092();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_9c1092();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.spvasm
new file mode 100644
index 0000000..6ac0c69
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sinh_9c1092 "sinh_9c1092"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+ %v2float = OpTypeVector %float 2
+%float_1_17520118 = OpConstant %float 1.17520118
+ %15 = OpConstantComposite %v2float %float_1_17520118 %float_1_17520118
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+ %18 = OpConstantNull %v2float
+ %19 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%sinh_9c1092 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v2float Function %18
+ OpStore %res %15
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %19
+ %21 = OpLabel
+ %22 = OpFunctionCall %void %sinh_9c1092
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %24 = OpLabel
+ %25 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %25
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sinh_9c1092
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %sinh_9c1092
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.wgsl
new file mode 100644
index 0000000..0cd233a
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/9c1092.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn sinh_9c1092() {
+ const arg_0 = vec2(1.0);
+ var res = sinh(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_9c1092();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_9c1092();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_9c1092();
+}
diff --git a/test/tint/builtins/gen/var/sinh/a3da7c.wgsl b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl
new file mode 100644
index 0000000..894a494
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl
@@ -0,0 +1,44 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sinh(vec<4, fa>) -> vec<4, fa>
+fn sinh_a3da7c() {
+ const arg_0 = vec4(1.);
+ var res = sinh(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_a3da7c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_a3da7c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_a3da7c();
+}
diff --git a/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..32eaad5
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_a3da7c() {
+ float4 res = (1.175201178f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_a3da7c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_a3da7c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_a3da7c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..32eaad5
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_a3da7c() {
+ float4 res = (1.175201178f).xxxx;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_a3da7c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_a3da7c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_a3da7c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.glsl
new file mode 100644
index 0000000..d0068d8
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sinh_a3da7c() {
+ vec4 res = vec4(1.175201178f);
+}
+
+vec4 vertex_main() {
+ sinh_a3da7c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sinh_a3da7c() {
+ vec4 res = vec4(1.175201178f);
+}
+
+void fragment_main() {
+ sinh_a3da7c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sinh_a3da7c() {
+ vec4 res = vec4(1.175201178f);
+}
+
+void compute_main() {
+ sinh_a3da7c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.msl
new file mode 100644
index 0000000..2e9d194
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_a3da7c() {
+ float4 res = float4(1.175201178f);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sinh_a3da7c();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sinh_a3da7c();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_a3da7c();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.spvasm
new file mode 100644
index 0000000..0c80b67
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sinh_a3da7c "sinh_a3da7c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%float_1_17520118 = OpConstant %float 1.17520118
+ %14 = OpConstantComposite %v4float %float_1_17520118 %float_1_17520118 %float_1_17520118 %float_1_17520118
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+ %17 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%sinh_a3da7c = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_v4float Function %5
+ OpStore %res %14
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %17
+ %19 = OpLabel
+ %20 = OpFunctionCall %void %sinh_a3da7c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %22 = OpLabel
+ %23 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %23
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %sinh_a3da7c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %sinh_a3da7c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.wgsl
new file mode 100644
index 0000000..d54c4bc
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/a3da7c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn sinh_a3da7c() {
+ const arg_0 = vec4(1.0);
+ var res = sinh(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_a3da7c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_a3da7c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_a3da7c();
+}
diff --git a/test/tint/builtins/gen/var/sinh/c4df74.wgsl b/test/tint/builtins/gen/var/sinh/c4df74.wgsl
new file mode 100644
index 0000000..38d7789
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/c4df74.wgsl
@@ -0,0 +1,44 @@
+// 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.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+
+// fn sinh(fa) -> fa
+fn sinh_c4df74() {
+ const arg_0 = 1.;
+ var res = sinh(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_c4df74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_c4df74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_c4df74();
+}
diff --git a/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..05a1561
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_c4df74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_c4df74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_c4df74();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..05a1561
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ sinh_c4df74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ sinh_c4df74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ sinh_c4df74();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.glsl b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.glsl
new file mode 100644
index 0000000..49d4879
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+vec4 vertex_main() {
+ sinh_c4df74();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+void fragment_main() {
+ sinh_c4df74();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+void compute_main() {
+ sinh_c4df74();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.msl b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.msl
new file mode 100644
index 0000000..9cfbeae
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void sinh_c4df74() {
+ float res = 1.175201178f;
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+ sinh_c4df74();
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main() {
+ float4 const inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main() {
+ sinh_c4df74();
+ return;
+}
+
+kernel void compute_main() {
+ sinh_c4df74();
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.spvasm b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.spvasm
new file mode 100644
index 0000000..8eb5089
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.spvasm
@@ -0,0 +1,64 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 30
+; Schema: 0
+ OpCapability Shader
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %sinh_c4df74 "sinh_c4df74"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %void = OpTypeVoid
+ %9 = OpTypeFunction %void
+%float_1_17520118 = OpConstant %float 1.17520118
+%_ptr_Function_float = OpTypePointer Function %float
+ %16 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%sinh_c4df74 = OpFunction %void None %9
+ %12 = OpLabel
+ %res = OpVariable %_ptr_Function_float Function %8
+ OpStore %res %float_1_17520118
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+ %18 = OpLabel
+ %19 = OpFunctionCall %void %sinh_c4df74
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+ %21 = OpLabel
+ %22 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %22
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %sinh_c4df74
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %9
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %sinh_c4df74
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.wgsl b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.wgsl
new file mode 100644
index 0000000..c0e5f50
--- /dev/null
+++ b/test/tint/builtins/gen/var/sinh/c4df74.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn sinh_c4df74() {
+ const arg_0 = 1.0;
+ var res = sinh(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ sinh_c4df74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ sinh_c4df74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ sinh_c4df74();
+}