Const eval for `inverseSqrt`

This CL adds const-eval for the `inverseSqrt` builtin.

Bug: tint:1581
Change-Id: Ieef063416a8033b5fac9396e30c76c20b3360a90
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/111581
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 2a04575..11e1a3c 100644
--- a/src/tint/intrinsics.def
+++ b/src/tint/intrinsics.def
@@ -487,8 +487,8 @@
 @stage("fragment") fn fwidthFine<N: num>(vec<N, f32>) -> vec<N, f32>
 @const fn insertBits<T: iu32>(T, T, u32, u32) -> T
 @const fn insertBits<N: num, T: iu32>(vec<N, T>, vec<N, T>, u32, u32) -> vec<N, T>
-fn inverseSqrt<T: f32_f16>(T) -> T
-fn inverseSqrt<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
+@const fn inverseSqrt<T: fa_f32_f16>(T) -> T
+@const fn inverseSqrt<N: num, T: fa_f32_f16>(vec<N, T>) -> vec<N, T>
 fn ldexp<T: f32_f16>(T, i32) -> T
 fn ldexp<N: num, T: f32_f16>(vec<N, T>, vec<N, i32>) -> vec<N, T>
 @const fn length<T: fa_f32_f16>(@test_value(0.0) T) -> T
diff --git a/src/tint/resolver/const_eval.cc b/src/tint/resolver/const_eval.cc
index 4e92704..27630c7 100644
--- a/src/tint/resolver/const_eval.cc
+++ b/src/tint/resolver/const_eval.cc
@@ -2529,6 +2529,40 @@
     return TransformElements(builder, ty, transform, args[0], args[1]);
 }
 
+ConstEval::Result ConstEval::inverseSqrt(const sem::Type* ty,
+                                         utils::VectorRef<const sem::Constant*> args,
+                                         const Source& source) {
+    auto transform = [&](const sem::Constant* c0) {
+        auto create = [&](auto e) -> ImplResult {
+            using NumberT = decltype(e);
+
+            if (e <= NumberT(0)) {
+                AddError("inverseSqrt must be called with a value > 0", source);
+                return utils::Failure;
+            }
+
+            auto err = [&] {
+                AddNote("when calculating inverseSqrt", source);
+                return utils::Failure;
+            };
+
+            auto s = Sqrt(source, e);
+            if (!s) {
+                return err();
+            }
+            auto div = Div(source, NumberT(1), s.Get());
+            if (!div) {
+                return err();
+            }
+
+            return CreateElement(builder, source, c0->Type(), div.Get());
+        };
+        return Dispatch_fa_f32_f16(create, c0);
+    };
+
+    return TransformElements(builder, ty, transform, args[0]);
+}
+
 ConstEval::Result ConstEval::length(const sem::Type* ty,
                                     utils::VectorRef<const sem::Constant*> args,
                                     const Source& source) {
diff --git a/src/tint/resolver/const_eval.h b/src/tint/resolver/const_eval.h
index b79270a..6f46ef2 100644
--- a/src/tint/resolver/const_eval.h
+++ b/src/tint/resolver/const_eval.h
@@ -638,6 +638,15 @@
                       utils::VectorRef<const sem::Constant*> args,
                       const Source& source);
 
+    /// inverseSqrt builtin
+    /// @param ty the expression type
+    /// @param args the input arguments
+    /// @param source the source location
+    /// @return the result value, or null if the value cannot be calculated
+    Result inverseSqrt(const sem::Type* ty,
+                       utils::VectorRef<const sem::Constant*> args,
+                       const Source& source);
+
     /// length 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 3c2e3c7..d031a35 100644
--- a/src/tint/resolver/const_eval_builtin_test.cc
+++ b/src/tint/resolver/const_eval_builtin_test.cc
@@ -1184,6 +1184,28 @@
                                               InsertBitsCases<u32>()))));
 
 template <typename T>
+std::vector<Case> InverseSqrtCases() {
+    std::vector<Case> cases = {
+        C({T(25)}, T(.2)),
+
+        // Vector tests
+        C({Vec(T(25), T(100))}, Vec(T(.2), T(.1))),
+
+        E({T(0)}, "12:34 error: inverseSqrt must be called with a value > 0"),
+        E({-T(0)}, "12:34 error: inverseSqrt must be called with a value > 0"),
+        E({-T(25)}, "12:34 error: inverseSqrt must be called with a value > 0"),
+    };
+    return cases;
+}
+INSTANTIATE_TEST_SUITE_P(  //
+    InverseSqrt,
+    ResolverConstEvalBuiltinTest,
+    testing::Combine(testing::Values(sem::BuiltinType::kInverseSqrt),
+                     testing::ValuesIn(Concat(InverseSqrtCases<AFloat>(),  //
+                                              InverseSqrtCases<f32>(),
+                                              InverseSqrtCases<f16>()))));
+
+template <typename T>
 std::vector<Case> DegreesAFloatCases() {
     return std::vector<Case>{
         C({T(0)}, T(0)),                             //
diff --git a/src/tint/resolver/intrinsic_table.inl b/src/tint/resolver/intrinsic_table.inl
index f7126b1..3ee8aca 100644
--- a/src/tint/resolver/intrinsic_table.inl
+++ b/src/tint/resolver/intrinsic_table.inl
@@ -12678,24 +12678,24 @@
     /* num parameters */ 1,
     /* num template types */ 1,
     /* num template numbers */ 0,
-    /* template types */ &kTemplateTypes[26],
+    /* template types */ &kTemplateTypes[23],
     /* template numbers */ &kTemplateNumbers[10],
     /* parameters */ &kParameters[870],
     /* return matcher indices */ &kMatcherIndices[3],
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
-    /* const eval */ nullptr,
+    /* const eval */ &ConstEval::inverseSqrt,
   },
   {
     /* [364] */
     /* num parameters */ 1,
     /* num template types */ 1,
     /* num template numbers */ 1,
-    /* template types */ &kTemplateTypes[26],
+    /* template types */ &kTemplateTypes[23],
     /* template numbers */ &kTemplateNumbers[4],
     /* parameters */ &kParameters[871],
     /* return matcher indices */ &kMatcherIndices[30],
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
-    /* const eval */ nullptr,
+    /* const eval */ &ConstEval::inverseSqrt,
   },
   {
     /* [365] */
@@ -14294,8 +14294,8 @@
   },
   {
     /* [45] */
-    /* fn inverseSqrt<T : f32_f16>(T) -> T */
-    /* fn inverseSqrt<N : num, T : f32_f16>(vec<N, T>) -> vec<N, T> */
+    /* fn inverseSqrt<T : fa_f32_f16>(T) -> T */
+    /* fn inverseSqrt<N : num, T : fa_f32_f16>(vec<N, T>) -> vec<N, T> */
     /* num overloads */ 2,
     /* overloads */ &kOverloads[363],
   },
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl
new file mode 100644
index 0000000..6cea8be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.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 inverseSqrt(vec<4, fa>) -> vec<4, fa>
+fn inverseSqrt_07a6fe() {
+  var res = inverseSqrt(vec4(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_07a6fe();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_07a6fe();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_07a6fe();
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5068619
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_07a6fe() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_07a6fe();
+  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() {
+  inverseSqrt_07a6fe();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_07a6fe();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5068619
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_07a6fe() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_07a6fe();
+  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() {
+  inverseSqrt_07a6fe();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_07a6fe();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.glsl
new file mode 100644
index 0000000..bc25b44
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void inverseSqrt_07a6fe() {
+  vec4 res = vec4(1.0f);
+}
+
+vec4 vertex_main() {
+  inverseSqrt_07a6fe();
+  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 inverseSqrt_07a6fe() {
+  vec4 res = vec4(1.0f);
+}
+
+void fragment_main() {
+  inverseSqrt_07a6fe();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void inverseSqrt_07a6fe() {
+  vec4 res = vec4(1.0f);
+}
+
+void compute_main() {
+  inverseSqrt_07a6fe();
+}
+
+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/inverseSqrt/07a6fe.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.msl
new file mode 100644
index 0000000..51f4827
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_07a6fe() {
+  float4 res = float4(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_07a6fe();
+  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() {
+  inverseSqrt_07a6fe();
+  return;
+}
+
+kernel void compute_main() {
+  inverseSqrt_07a6fe();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.spvasm
new file mode 100644
index 0000000..d9958fdd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.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 %inverseSqrt_07a6fe "inverseSqrt_07a6fe"
+               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 = OpConstant %float 1
+         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+         %17 = OpTypeFunction %v4float
+%inverseSqrt_07a6fe = 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 %inverseSqrt_07a6fe
+               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
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %inverseSqrt_07a6fe
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %inverseSqrt_07a6fe
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.wgsl
new file mode 100644
index 0000000..e2e7bdb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/07a6fe.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn inverseSqrt_07a6fe() {
+  var res = inverseSqrt(vec4(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_07a6fe();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_07a6fe();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_07a6fe();
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.dxc.hlsl
index 147b2ec..ea9d0d1 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_440300() {
-  float16_t res = rsqrt(float16_t(1.0h));
+  float16_t res = float16_t(1.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.glsl
index 9f1eaf6..6c6c2d9 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void inverseSqrt_440300() {
-  float16_t res = inversesqrt(1.0hf);
+  float16_t res = 1.0hf;
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void inverseSqrt_440300() {
-  float16_t res = inversesqrt(1.0hf);
+  float16_t res = 1.0hf;
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void inverseSqrt_440300() {
-  float16_t res = inversesqrt(1.0hf);
+  float16_t res = 1.0hf;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.msl
index 0b73e38..7f4e0ad 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void inverseSqrt_440300() {
-  half res = rsqrt(1.0h);
+  half res = 1.0h;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.spvasm
index d2b8dc4..fa3bb0e 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/440300.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/440300.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"
@@ -38,35 +37,34 @@
        %half = OpTypeFloat 16
 %half_0x1p_0 = OpConstant %half 0x1p+0
 %_ptr_Function_half = OpTypePointer Function %half
-         %19 = OpConstantNull %half
-         %20 = OpTypeFunction %v4float
+         %17 = OpConstantNull %half
+         %18 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %inverseSqrt_440300 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %19
-         %13 = OpExtInst %half %15 InverseSqrt %half_0x1p_0
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %half_0x1p_0
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %inverseSqrt_440300
+%vertex_main_inner = OpFunction %v4float None %18
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %inverseSqrt_440300
                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 %inverseSqrt_440300
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %inverseSqrt_440300
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %inverseSqrt_440300
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %inverseSqrt_440300
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl
new file mode 100644
index 0000000..a795517
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.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 inverseSqrt(fa) -> fa
+fn inverseSqrt_4ca6d6() {
+  var res = inverseSqrt(1.);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_4ca6d6();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_4ca6d6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_4ca6d6();
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9dc23af
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_4ca6d6();
+  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() {
+  inverseSqrt_4ca6d6();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_4ca6d6();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9dc23af
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_4ca6d6();
+  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() {
+  inverseSqrt_4ca6d6();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_4ca6d6();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.glsl
new file mode 100644
index 0000000..5f7e5e4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+vec4 vertex_main() {
+  inverseSqrt_4ca6d6();
+  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 inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+void fragment_main() {
+  inverseSqrt_4ca6d6();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+void compute_main() {
+  inverseSqrt_4ca6d6();
+}
+
+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/inverseSqrt/4ca6d6.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.msl
new file mode 100644
index 0000000..9309f00
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_4ca6d6();
+  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() {
+  inverseSqrt_4ca6d6();
+  return;
+}
+
+kernel void compute_main() {
+  inverseSqrt_4ca6d6();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.spvasm
new file mode 100644
index 0000000..5228d5b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; 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 %inverseSqrt_4ca6d6 "inverseSqrt_4ca6d6"
+               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 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+         %16 = OpTypeFunction %v4float
+%inverseSqrt_4ca6d6 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %8
+               OpStore %res %float_1
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+         %18 = OpLabel
+         %19 = OpFunctionCall %void %inverseSqrt_4ca6d6
+               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
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %inverseSqrt_4ca6d6
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %inverseSqrt_4ca6d6
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.wgsl
new file mode 100644
index 0000000..47d382e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/4ca6d6.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn inverseSqrt_4ca6d6() {
+  var res = inverseSqrt(1.0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_4ca6d6();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_4ca6d6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_4ca6d6();
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl
index c84c61d..9604298 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_5f51f8() {
-  vector<float16_t, 2> res = rsqrt((float16_t(1.0h)).xx);
+  vector<float16_t, 2> res = (float16_t(1.0h)).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.glsl
index 3b37871..16ffe9d 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void inverseSqrt_5f51f8() {
-  f16vec2 res = inversesqrt(f16vec2(1.0hf));
+  f16vec2 res = f16vec2(1.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void inverseSqrt_5f51f8() {
-  f16vec2 res = inversesqrt(f16vec2(1.0hf));
+  f16vec2 res = f16vec2(1.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void inverseSqrt_5f51f8() {
-  f16vec2 res = inversesqrt(f16vec2(1.0hf));
+  f16vec2 res = f16vec2(1.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.msl
index d396e65..938bf4b 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void inverseSqrt_5f51f8() {
-  half2 res = rsqrt(half2(1.0h));
+  half2 res = half2(1.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.spvasm
index 10e31d2..2cf9ebd 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/5f51f8.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"
@@ -38,37 +37,36 @@
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
 %half_0x1p_0 = OpConstant %half 0x1p+0
-         %18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %21 = OpConstantNull %v2half
-         %22 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v2half
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %inverseSqrt_5f51f8 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %21
-         %13 = OpExtInst %v2half %16 InverseSqrt %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 %inverseSqrt_5f51f8
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %inverseSqrt_5f51f8
                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 %inverseSqrt_5f51f8
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %inverseSqrt_5f51f8
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %inverseSqrt_5f51f8
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %inverseSqrt_5f51f8
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl
new file mode 100644
index 0000000..3fc562b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.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 inverseSqrt(vec<3, fa>) -> vec<3, fa>
+fn inverseSqrt_6d0783() {
+  var res = inverseSqrt(vec3(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_6d0783();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_6d0783();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_6d0783();
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..23ea6a39
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_6d0783() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_6d0783();
+  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() {
+  inverseSqrt_6d0783();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_6d0783();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..23ea6a39
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_6d0783() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_6d0783();
+  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() {
+  inverseSqrt_6d0783();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_6d0783();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.glsl
new file mode 100644
index 0000000..a8ccaba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void inverseSqrt_6d0783() {
+  vec3 res = vec3(1.0f);
+}
+
+vec4 vertex_main() {
+  inverseSqrt_6d0783();
+  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 inverseSqrt_6d0783() {
+  vec3 res = vec3(1.0f);
+}
+
+void fragment_main() {
+  inverseSqrt_6d0783();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void inverseSqrt_6d0783() {
+  vec3 res = vec3(1.0f);
+}
+
+void compute_main() {
+  inverseSqrt_6d0783();
+}
+
+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/inverseSqrt/6d0783.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.msl
new file mode 100644
index 0000000..5ceb221
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_6d0783() {
+  float3 res = float3(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_6d0783();
+  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() {
+  inverseSqrt_6d0783();
+  return;
+}
+
+kernel void compute_main() {
+  inverseSqrt_6d0783();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.spvasm
new file mode 100644
index 0000000..439383d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; 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 %inverseSqrt_6d0783 "inverseSqrt_6d0783"
+               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 = OpConstant %float 1
+         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+         %18 = OpConstantNull %v3float
+         %19 = OpTypeFunction %v4float
+%inverseSqrt_6d0783 = 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 %inverseSqrt_6d0783
+               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
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %inverseSqrt_6d0783
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %inverseSqrt_6d0783
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.wgsl
new file mode 100644
index 0000000..08862ba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/6d0783.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn inverseSqrt_6d0783() {
+  var res = inverseSqrt(vec3(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_6d0783();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_6d0783();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_6d0783();
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.dxc.hlsl
index 4a3e57e..51f00ab 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_84407e() {
-  float res = rsqrt(1.0f);
+  float res = 1.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.fxc.hlsl
index 4a3e57e..51f00ab 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_84407e() {
-  float res = rsqrt(1.0f);
+  float res = 1.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.glsl
index eef230f..c916c26 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void inverseSqrt_84407e() {
-  float res = inversesqrt(1.0f);
+  float res = 1.0f;
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void inverseSqrt_84407e() {
-  float res = inversesqrt(1.0f);
+  float res = 1.0f;
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void inverseSqrt_84407e() {
-  float res = inversesqrt(1.0f);
+  float res = 1.0f;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.msl
index 35b0239..ba05bad 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void inverseSqrt_84407e() {
-  float res = rsqrt(1.0f);
+  float res = 1.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.spvasm
index 2027c7e..fb86daa 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/84407e.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 29
 ; 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"
@@ -33,33 +32,32 @@
           %9 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
 %_ptr_Function_float = OpTypePointer Function %float
-         %18 = OpTypeFunction %v4float
+         %16 = OpTypeFunction %v4float
 %inverseSqrt_84407e = OpFunction %void None %9
          %12 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %13 = OpExtInst %float %14 InverseSqrt %float_1
-               OpStore %res %13
+               OpStore %res %float_1
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %inverseSqrt_84407e
+%vertex_main_inner = OpFunction %v4float None %16
+         %18 = OpLabel
+         %19 = OpFunctionCall %void %inverseSqrt_84407e
                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 %inverseSqrt_84407e
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %inverseSqrt_84407e
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %inverseSqrt_84407e
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %inverseSqrt_84407e
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl
index c0487c4..9dec115 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_8f2bd2() {
-  float2 res = rsqrt((1.0f).xx);
+  float2 res = (1.0f).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl
index c0487c4..9dec115 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_8f2bd2() {
-  float2 res = rsqrt((1.0f).xx);
+  float2 res = (1.0f).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.glsl
index 7a9a429..07b6be3 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void inverseSqrt_8f2bd2() {
-  vec2 res = inversesqrt(vec2(1.0f));
+  vec2 res = vec2(1.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void inverseSqrt_8f2bd2() {
-  vec2 res = inversesqrt(vec2(1.0f));
+  vec2 res = vec2(1.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void inverseSqrt_8f2bd2() {
-  vec2 res = inversesqrt(vec2(1.0f));
+  vec2 res = vec2(1.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.msl
index c4436e3..13e1fcd 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void inverseSqrt_8f2bd2() {
-  float2 res = rsqrt(float2(1.0f));
+  float2 res = float2(1.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.spvasm
index 5e60aea..7dbff4a 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/8f2bd2.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 32
 ; 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"
@@ -33,36 +32,35 @@
           %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
     %float_1 = OpConstant %float 1
-         %17 = OpConstantComposite %v2float %float_1 %float_1
+         %15 = OpConstantComposite %v2float %float_1 %float_1
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %20 = OpConstantNull %v2float
-         %21 = OpTypeFunction %v4float
+         %18 = OpConstantNull %v2float
+         %19 = OpTypeFunction %v4float
 %inverseSqrt_8f2bd2 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %20
-         %13 = OpExtInst %v2float %15 InverseSqrt %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 %inverseSqrt_8f2bd2
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %inverseSqrt_8f2bd2
                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 %inverseSqrt_8f2bd2
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %inverseSqrt_8f2bd2
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %inverseSqrt_8f2bd2
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %inverseSqrt_8f2bd2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl
index e9b4090..037015c 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_b197b1() {
-  float3 res = rsqrt((1.0f).xxx);
+  float3 res = (1.0f).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl
index e9b4090..037015c 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_b197b1() {
-  float3 res = rsqrt((1.0f).xxx);
+  float3 res = (1.0f).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.glsl
index 266b109..51e05ed 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void inverseSqrt_b197b1() {
-  vec3 res = inversesqrt(vec3(1.0f));
+  vec3 res = vec3(1.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void inverseSqrt_b197b1() {
-  vec3 res = inversesqrt(vec3(1.0f));
+  vec3 res = vec3(1.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void inverseSqrt_b197b1() {
-  vec3 res = inversesqrt(vec3(1.0f));
+  vec3 res = vec3(1.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.msl
index e8f6fa1..d2a6c8d 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void inverseSqrt_b197b1() {
-  float3 res = rsqrt(float3(1.0f));
+  float3 res = float3(1.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.spvasm
index 88ee7d3..25e90d3 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b197b1.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 32
 ; 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"
@@ -33,36 +32,35 @@
           %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
     %float_1 = OpConstant %float 1
-         %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %20 = OpConstantNull %v3float
-         %21 = OpTypeFunction %v4float
+         %18 = OpConstantNull %v3float
+         %19 = OpTypeFunction %v4float
 %inverseSqrt_b197b1 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %20
-         %13 = OpExtInst %v3float %15 InverseSqrt %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 %inverseSqrt_b197b1
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %inverseSqrt_b197b1
                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 %inverseSqrt_b197b1
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %inverseSqrt_b197b1
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %inverseSqrt_b197b1
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %inverseSqrt_b197b1
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl
index bf7a098..9eca601 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_b85ebd() {
-  vector<float16_t, 3> res = rsqrt((float16_t(1.0h)).xxx);
+  vector<float16_t, 3> res = (float16_t(1.0h)).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.glsl
index ee6af34..b9ea92f 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void inverseSqrt_b85ebd() {
-  f16vec3 res = inversesqrt(f16vec3(1.0hf));
+  f16vec3 res = f16vec3(1.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void inverseSqrt_b85ebd() {
-  f16vec3 res = inversesqrt(f16vec3(1.0hf));
+  f16vec3 res = f16vec3(1.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void inverseSqrt_b85ebd() {
-  f16vec3 res = inversesqrt(f16vec3(1.0hf));
+  f16vec3 res = f16vec3(1.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.msl
index d5823b9..3c62a0f 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void inverseSqrt_b85ebd() {
-  half3 res = rsqrt(half3(1.0h));
+  half3 res = half3(1.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.spvasm
index 76557ce..a8f788b 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/b85ebd.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"
@@ -38,37 +37,36 @@
        %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
+         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %21 = OpConstantNull %v3half
-         %22 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v3half
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %inverseSqrt_b85ebd = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %21
-         %13 = OpExtInst %v3half %16 InverseSqrt %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 %inverseSqrt_b85ebd
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %inverseSqrt_b85ebd
                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 %inverseSqrt_b85ebd
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %inverseSqrt_b85ebd
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %inverseSqrt_b85ebd
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %inverseSqrt_b85ebd
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.dxc.hlsl
index 3cddf65..44658f1 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_c22347() {
-  float4 res = rsqrt((1.0f).xxxx);
+  float4 res = (1.0f).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.fxc.hlsl
index 3cddf65..44658f1 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_c22347() {
-  float4 res = rsqrt((1.0f).xxxx);
+  float4 res = (1.0f).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.glsl
index a788f74..da480d2 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void inverseSqrt_c22347() {
-  vec4 res = inversesqrt(vec4(1.0f));
+  vec4 res = vec4(1.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void inverseSqrt_c22347() {
-  vec4 res = inversesqrt(vec4(1.0f));
+  vec4 res = vec4(1.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void inverseSqrt_c22347() {
-  vec4 res = inversesqrt(vec4(1.0f));
+  vec4 res = vec4(1.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.msl
index afad412..ac90098 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void inverseSqrt_c22347() {
-  float4 res = rsqrt(float4(1.0f));
+  float4 res = float4(1.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.spvasm
index f487a3b..b3194e7 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/c22347.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; 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"
@@ -32,35 +31,34 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
     %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %19 = OpTypeFunction %v4float
+         %17 = OpTypeFunction %v4float
 %inverseSqrt_c22347 = OpFunction %void None %9
          %12 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %13 = OpExtInst %v4float %14 InverseSqrt %16
-               OpStore %res %13
+               OpStore %res %14
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %inverseSqrt_c22347
+%vertex_main_inner = OpFunction %v4float None %17
+         %19 = OpLabel
+         %20 = OpFunctionCall %void %inverseSqrt_c22347
                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 %inverseSqrt_c22347
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %inverseSqrt_c22347
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %inverseSqrt_c22347
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %inverseSqrt_c22347
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl
index 1f6b955..1eee4b3 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void inverseSqrt_cbdc70() {
-  vector<float16_t, 4> res = rsqrt((float16_t(1.0h)).xxxx);
+  vector<float16_t, 4> res = (float16_t(1.0h)).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.glsl
index f0261cd..b96052a 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void inverseSqrt_cbdc70() {
-  f16vec4 res = inversesqrt(f16vec4(1.0hf));
+  f16vec4 res = f16vec4(1.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void inverseSqrt_cbdc70() {
-  f16vec4 res = inversesqrt(f16vec4(1.0hf));
+  f16vec4 res = f16vec4(1.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void inverseSqrt_cbdc70() {
-  f16vec4 res = inversesqrt(f16vec4(1.0hf));
+  f16vec4 res = f16vec4(1.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.msl
index f1f1cc1..896e7f6 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void inverseSqrt_cbdc70() {
-  half4 res = rsqrt(half4(1.0h));
+  half4 res = half4(1.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.spvasm
index f27f99c..369740c 100644
--- a/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/inverseSqrt/cbdc70.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"
@@ -38,37 +37,36 @@
        %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
+         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %21 = OpConstantNull %v4half
-         %22 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v4half
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %inverseSqrt_cbdc70 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %21
-         %13 = OpExtInst %v4half %16 InverseSqrt %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 %inverseSqrt_cbdc70
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %inverseSqrt_cbdc70
                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 %inverseSqrt_cbdc70
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %inverseSqrt_cbdc70
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %inverseSqrt_cbdc70
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %inverseSqrt_cbdc70
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl
new file mode 100644
index 0000000..21275a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.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 inverseSqrt(vec<2, fa>) -> vec<2, fa>
+fn inverseSqrt_f60c1c() {
+  var res = inverseSqrt(vec2(1.));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_f60c1c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_f60c1c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_f60c1c();
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7318b17
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_f60c1c() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_f60c1c();
+  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() {
+  inverseSqrt_f60c1c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_f60c1c();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7318b17
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_f60c1c() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_f60c1c();
+  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() {
+  inverseSqrt_f60c1c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_f60c1c();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.glsl
new file mode 100644
index 0000000..53b0371
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void inverseSqrt_f60c1c() {
+  vec2 res = vec2(1.0f);
+}
+
+vec4 vertex_main() {
+  inverseSqrt_f60c1c();
+  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 inverseSqrt_f60c1c() {
+  vec2 res = vec2(1.0f);
+}
+
+void fragment_main() {
+  inverseSqrt_f60c1c();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void inverseSqrt_f60c1c() {
+  vec2 res = vec2(1.0f);
+}
+
+void compute_main() {
+  inverseSqrt_f60c1c();
+}
+
+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/inverseSqrt/f60c1c.wgsl.expected.msl b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.msl
new file mode 100644
index 0000000..093fa3d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_f60c1c() {
+  float2 res = float2(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_f60c1c();
+  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() {
+  inverseSqrt_f60c1c();
+  return;
+}
+
+kernel void compute_main() {
+  inverseSqrt_f60c1c();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.spvasm
new file mode 100644
index 0000000..c4fc1cb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; 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 %inverseSqrt_f60c1c "inverseSqrt_f60c1c"
+               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 = OpConstant %float 1
+         %15 = OpConstantComposite %v2float %float_1 %float_1
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+         %18 = OpConstantNull %v2float
+         %19 = OpTypeFunction %v4float
+%inverseSqrt_f60c1c = 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 %inverseSqrt_f60c1c
+               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
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %inverseSqrt_f60c1c
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %inverseSqrt_f60c1c
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.wgsl
new file mode 100644
index 0000000..c596291
--- /dev/null
+++ b/test/tint/builtins/gen/literal/inverseSqrt/f60c1c.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn inverseSqrt_f60c1c() {
+  var res = inverseSqrt(vec2(1.0));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_f60c1c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_f60c1c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_f60c1c();
+}
diff --git a/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3202766
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void determinant_1bf6e7() {
+  float res = 0.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  determinant_1bf6e7();
+  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() {
+  determinant_1bf6e7();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  determinant_1bf6e7();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3202766
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void determinant_1bf6e7() {
+  float res = 0.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  determinant_1bf6e7();
+  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() {
+  determinant_1bf6e7();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  determinant_1bf6e7();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.glsl b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.glsl
new file mode 100644
index 0000000..d5b27a9
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void determinant_1bf6e7() {
+  float res = 0.0f;
+}
+
+vec4 vertex_main() {
+  determinant_1bf6e7();
+  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 determinant_1bf6e7() {
+  float res = 0.0f;
+}
+
+void fragment_main() {
+  determinant_1bf6e7();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void determinant_1bf6e7() {
+  float res = 0.0f;
+}
+
+void compute_main() {
+  determinant_1bf6e7();
+}
+
+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/determinant/1bf6e7.wgsl.expected.msl b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.msl
new file mode 100644
index 0000000..3e3494c
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void determinant_1bf6e7() {
+  float res = 0.0f;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  determinant_1bf6e7();
+  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() {
+  determinant_1bf6e7();
+  return;
+}
+
+kernel void compute_main() {
+  determinant_1bf6e7();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.spvasm
new file mode 100644
index 0000000..b5f4f68
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; 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 %determinant_1bf6e7 "determinant_1bf6e7"
+               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
+%_ptr_Function_float = OpTypePointer Function %float
+         %15 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+%determinant_1bf6e7 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %8
+               OpStore %res %8
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %15
+         %17 = OpLabel
+         %18 = OpFunctionCall %void %determinant_1bf6e7
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %20 = OpLabel
+         %21 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %21
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %determinant_1bf6e7
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %determinant_1bf6e7
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.wgsl
new file mode 100644
index 0000000..3b5997b
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/1bf6e7.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn determinant_1bf6e7() {
+  const arg_0 = mat2x2(1.0, 1.0, 1.0, 1.0);
+  var res = determinant(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  determinant_1bf6e7();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  determinant_1bf6e7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  determinant_1bf6e7();
+}
diff --git a/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8415cb1
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void determinant_c8251d() {
+  float res = 0.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  determinant_c8251d();
+  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() {
+  determinant_c8251d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  determinant_c8251d();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8415cb1
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void determinant_c8251d() {
+  float res = 0.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  determinant_c8251d();
+  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() {
+  determinant_c8251d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  determinant_c8251d();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.glsl b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.glsl
new file mode 100644
index 0000000..fb8d99d
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void determinant_c8251d() {
+  float res = 0.0f;
+}
+
+vec4 vertex_main() {
+  determinant_c8251d();
+  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 determinant_c8251d() {
+  float res = 0.0f;
+}
+
+void fragment_main() {
+  determinant_c8251d();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void determinant_c8251d() {
+  float res = 0.0f;
+}
+
+void compute_main() {
+  determinant_c8251d();
+}
+
+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/determinant/c8251d.wgsl.expected.msl b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.msl
new file mode 100644
index 0000000..7132d6f
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void determinant_c8251d() {
+  float res = 0.0f;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  determinant_c8251d();
+  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() {
+  determinant_c8251d();
+  return;
+}
+
+kernel void compute_main() {
+  determinant_c8251d();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.spvasm
new file mode 100644
index 0000000..23a1e6d
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; 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 %determinant_c8251d "determinant_c8251d"
+               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
+%_ptr_Function_float = OpTypePointer Function %float
+         %15 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+%determinant_c8251d = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %8
+               OpStore %res %8
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %15
+         %17 = OpLabel
+         %18 = OpFunctionCall %void %determinant_c8251d
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %20 = OpLabel
+         %21 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %21
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %determinant_c8251d
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %determinant_c8251d
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.wgsl
new file mode 100644
index 0000000..3430391
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/c8251d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn determinant_c8251d() {
+  const arg_0 = mat3x3(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0);
+  var res = determinant(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  determinant_c8251d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  determinant_c8251d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  determinant_c8251d();
+}
diff --git a/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ff28608
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void determinant_cefdf3() {
+  float res = 0.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  determinant_cefdf3();
+  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() {
+  determinant_cefdf3();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  determinant_cefdf3();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ff28608
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void determinant_cefdf3() {
+  float res = 0.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  determinant_cefdf3();
+  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() {
+  determinant_cefdf3();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  determinant_cefdf3();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.glsl b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.glsl
new file mode 100644
index 0000000..488869b
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void determinant_cefdf3() {
+  float res = 0.0f;
+}
+
+vec4 vertex_main() {
+  determinant_cefdf3();
+  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 determinant_cefdf3() {
+  float res = 0.0f;
+}
+
+void fragment_main() {
+  determinant_cefdf3();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void determinant_cefdf3() {
+  float res = 0.0f;
+}
+
+void compute_main() {
+  determinant_cefdf3();
+}
+
+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/determinant/cefdf3.wgsl.expected.msl b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.msl
new file mode 100644
index 0000000..f687f25
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void determinant_cefdf3() {
+  float res = 0.0f;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  determinant_cefdf3();
+  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() {
+  determinant_cefdf3();
+  return;
+}
+
+kernel void compute_main() {
+  determinant_cefdf3();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.spvasm
new file mode 100644
index 0000000..39854c3
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; 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 %determinant_cefdf3 "determinant_cefdf3"
+               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
+%_ptr_Function_float = OpTypePointer Function %float
+         %15 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+%determinant_cefdf3 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %8
+               OpStore %res %8
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %15
+         %17 = OpLabel
+         %18 = OpFunctionCall %void %determinant_cefdf3
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %20 = OpLabel
+         %21 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %21
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %determinant_cefdf3
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %determinant_cefdf3
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.wgsl
new file mode 100644
index 0000000..2646c87
--- /dev/null
+++ b/test/tint/builtins/gen/var/determinant/cefdf3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn determinant_cefdf3() {
+  const arg_0 = mat4x4(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0);
+  var res = determinant(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  determinant_cefdf3();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  determinant_cefdf3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  determinant_cefdf3();
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl
new file mode 100644
index 0000000..a63b143
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.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 inverseSqrt(vec<4, fa>) -> vec<4, fa>
+fn inverseSqrt_07a6fe() {
+  const arg_0 = vec4(1.);
+  var res = inverseSqrt(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_07a6fe();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_07a6fe();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_07a6fe();
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5068619
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_07a6fe() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_07a6fe();
+  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() {
+  inverseSqrt_07a6fe();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_07a6fe();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5068619
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_07a6fe() {
+  float4 res = (1.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_07a6fe();
+  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() {
+  inverseSqrt_07a6fe();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_07a6fe();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.glsl
new file mode 100644
index 0000000..bc25b44
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void inverseSqrt_07a6fe() {
+  vec4 res = vec4(1.0f);
+}
+
+vec4 vertex_main() {
+  inverseSqrt_07a6fe();
+  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 inverseSqrt_07a6fe() {
+  vec4 res = vec4(1.0f);
+}
+
+void fragment_main() {
+  inverseSqrt_07a6fe();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void inverseSqrt_07a6fe() {
+  vec4 res = vec4(1.0f);
+}
+
+void compute_main() {
+  inverseSqrt_07a6fe();
+}
+
+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/inverseSqrt/07a6fe.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.msl
new file mode 100644
index 0000000..51f4827
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_07a6fe() {
+  float4 res = float4(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_07a6fe();
+  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() {
+  inverseSqrt_07a6fe();
+  return;
+}
+
+kernel void compute_main() {
+  inverseSqrt_07a6fe();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.spvasm
new file mode 100644
index 0000000..d9958fdd
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.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 %inverseSqrt_07a6fe "inverseSqrt_07a6fe"
+               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 = OpConstant %float 1
+         %14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+         %17 = OpTypeFunction %v4float
+%inverseSqrt_07a6fe = 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 %inverseSqrt_07a6fe
+               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
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %inverseSqrt_07a6fe
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %inverseSqrt_07a6fe
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.wgsl
new file mode 100644
index 0000000..47572d3
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/07a6fe.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn inverseSqrt_07a6fe() {
+  const arg_0 = vec4(1.0);
+  var res = inverseSqrt(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_07a6fe();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_07a6fe();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_07a6fe();
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl
new file mode 100644
index 0000000..ca09f89
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.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 inverseSqrt(fa) -> fa
+fn inverseSqrt_4ca6d6() {
+  const arg_0 = 1.;
+  var res = inverseSqrt(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_4ca6d6();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_4ca6d6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_4ca6d6();
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9dc23af
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_4ca6d6();
+  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() {
+  inverseSqrt_4ca6d6();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_4ca6d6();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9dc23af
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_4ca6d6();
+  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() {
+  inverseSqrt_4ca6d6();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_4ca6d6();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.glsl
new file mode 100644
index 0000000..5f7e5e4
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+vec4 vertex_main() {
+  inverseSqrt_4ca6d6();
+  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 inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+void fragment_main() {
+  inverseSqrt_4ca6d6();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+void compute_main() {
+  inverseSqrt_4ca6d6();
+}
+
+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/inverseSqrt/4ca6d6.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.msl
new file mode 100644
index 0000000..9309f00
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_4ca6d6() {
+  float res = 1.0f;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_4ca6d6();
+  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() {
+  inverseSqrt_4ca6d6();
+  return;
+}
+
+kernel void compute_main() {
+  inverseSqrt_4ca6d6();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.spvasm
new file mode 100644
index 0000000..5228d5b
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.spvasm
@@ -0,0 +1,63 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 29
+; 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 %inverseSqrt_4ca6d6 "inverseSqrt_4ca6d6"
+               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 = OpConstant %float 1
+%_ptr_Function_float = OpTypePointer Function %float
+         %16 = OpTypeFunction %v4float
+%inverseSqrt_4ca6d6 = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %8
+               OpStore %res %float_1
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+         %18 = OpLabel
+         %19 = OpFunctionCall %void %inverseSqrt_4ca6d6
+               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
+         %24 = OpLabel
+         %25 = OpFunctionCall %void %inverseSqrt_4ca6d6
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %inverseSqrt_4ca6d6
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.wgsl
new file mode 100644
index 0000000..51abef2
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/4ca6d6.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn inverseSqrt_4ca6d6() {
+  const arg_0 = 1.0;
+  var res = inverseSqrt(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_4ca6d6();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_4ca6d6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_4ca6d6();
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl
new file mode 100644
index 0000000..bc3f3ee
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/6d0783.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 inverseSqrt(vec<3, fa>) -> vec<3, fa>
+fn inverseSqrt_6d0783() {
+  const arg_0 = vec3(1.);
+  var res = inverseSqrt(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_6d0783();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_6d0783();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_6d0783();
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..23ea6a39
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_6d0783() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_6d0783();
+  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() {
+  inverseSqrt_6d0783();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_6d0783();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..23ea6a39
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_6d0783() {
+  float3 res = (1.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_6d0783();
+  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() {
+  inverseSqrt_6d0783();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_6d0783();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.glsl
new file mode 100644
index 0000000..a8ccaba
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void inverseSqrt_6d0783() {
+  vec3 res = vec3(1.0f);
+}
+
+vec4 vertex_main() {
+  inverseSqrt_6d0783();
+  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 inverseSqrt_6d0783() {
+  vec3 res = vec3(1.0f);
+}
+
+void fragment_main() {
+  inverseSqrt_6d0783();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void inverseSqrt_6d0783() {
+  vec3 res = vec3(1.0f);
+}
+
+void compute_main() {
+  inverseSqrt_6d0783();
+}
+
+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/inverseSqrt/6d0783.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.msl
new file mode 100644
index 0000000..5ceb221
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_6d0783() {
+  float3 res = float3(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_6d0783();
+  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() {
+  inverseSqrt_6d0783();
+  return;
+}
+
+kernel void compute_main() {
+  inverseSqrt_6d0783();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.spvasm
new file mode 100644
index 0000000..439383d
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; 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 %inverseSqrt_6d0783 "inverseSqrt_6d0783"
+               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 = OpConstant %float 1
+         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+         %18 = OpConstantNull %v3float
+         %19 = OpTypeFunction %v4float
+%inverseSqrt_6d0783 = 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 %inverseSqrt_6d0783
+               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
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %inverseSqrt_6d0783
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %inverseSqrt_6d0783
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.wgsl
new file mode 100644
index 0000000..d0fdf1d
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/6d0783.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn inverseSqrt_6d0783() {
+  const arg_0 = vec3(1.0);
+  var res = inverseSqrt(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_6d0783();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_6d0783();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_6d0783();
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl
new file mode 100644
index 0000000..4196cc8
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.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 inverseSqrt(vec<2, fa>) -> vec<2, fa>
+fn inverseSqrt_f60c1c() {
+  const arg_0 = vec2(1.);
+  var res = inverseSqrt(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_f60c1c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_f60c1c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_f60c1c();
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7318b17
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_f60c1c() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_f60c1c();
+  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() {
+  inverseSqrt_f60c1c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_f60c1c();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7318b17
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void inverseSqrt_f60c1c() {
+  float2 res = (1.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_f60c1c();
+  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() {
+  inverseSqrt_f60c1c();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  inverseSqrt_f60c1c();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.glsl b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.glsl
new file mode 100644
index 0000000..53b0371
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void inverseSqrt_f60c1c() {
+  vec2 res = vec2(1.0f);
+}
+
+vec4 vertex_main() {
+  inverseSqrt_f60c1c();
+  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 inverseSqrt_f60c1c() {
+  vec2 res = vec2(1.0f);
+}
+
+void fragment_main() {
+  inverseSqrt_f60c1c();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void inverseSqrt_f60c1c() {
+  vec2 res = vec2(1.0f);
+}
+
+void compute_main() {
+  inverseSqrt_f60c1c();
+}
+
+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/inverseSqrt/f60c1c.wgsl.expected.msl b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.msl
new file mode 100644
index 0000000..093fa3d
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void inverseSqrt_f60c1c() {
+  float2 res = float2(1.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  inverseSqrt_f60c1c();
+  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() {
+  inverseSqrt_f60c1c();
+  return;
+}
+
+kernel void compute_main() {
+  inverseSqrt_f60c1c();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.spvasm
new file mode 100644
index 0000000..c4fc1cb
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.spvasm
@@ -0,0 +1,66 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 32
+; 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 %inverseSqrt_f60c1c "inverseSqrt_f60c1c"
+               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 = OpConstant %float 1
+         %15 = OpConstantComposite %v2float %float_1 %float_1
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+         %18 = OpConstantNull %v2float
+         %19 = OpTypeFunction %v4float
+%inverseSqrt_f60c1c = 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 %inverseSqrt_f60c1c
+               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
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %inverseSqrt_f60c1c
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %inverseSqrt_f60c1c
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.wgsl
new file mode 100644
index 0000000..e3b14d9
--- /dev/null
+++ b/test/tint/builtins/gen/var/inverseSqrt/f60c1c.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn inverseSqrt_f60c1c() {
+  const arg_0 = vec2(1.0);
+  var res = inverseSqrt(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  inverseSqrt_f60c1c();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  inverseSqrt_f60c1c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  inverseSqrt_f60c1c();
+}