Add const-eval for `round`

This CL adds const-eval for `round`.

Bug: tint:1581
Change-Id: I16ebb2010969debb8de50479235d9d9f5433c0a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110175
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 c368566..abf4dce 100644
--- a/src/tint/intrinsics.def
+++ b/src/tint/intrinsics.def
@@ -522,8 +522,8 @@
 fn refract<N: num, T: f32_f16>(vec<N, T>, vec<N, T>, T) -> vec<N, T>
 @const fn reverseBits<T: iu32>(T) -> T
 @const fn reverseBits<N: num, T: iu32>(vec<N, T>) -> vec<N, T>
-fn round<T: f32_f16>(T) -> T
-fn round<N: num, T: f32_f16>(vec<N, T>) -> vec<N, T>
+@const fn round<T: fa_f32_f16>(@test_value(3.4) T) -> T
+@const fn round<N: num, T: fa_f32_f16>(@test_value(3.4) vec<N, T>) -> vec<N, T>
 @const fn saturate<T: fa_f32_f16>(@test_value(2) T) -> T
 @const fn saturate<T: fa_f32_f16, N: num>(@test_value(2) vec<N, T>) -> vec<N, T>
 @const("select_bool") fn select<T: scalar>(T, T, bool) -> T
diff --git a/src/tint/resolver/const_eval.cc b/src/tint/resolver/const_eval.cc
index fa5506d..a83d331 100644
--- a/src/tint/resolver/const_eval.cc
+++ b/src/tint/resolver/const_eval.cc
@@ -2270,6 +2270,42 @@
     return TransformElements(builder, ty, transform, args[0]);
 }
 
+ConstEval::Result ConstEval::round(const sem::Type* ty,
+                                   utils::VectorRef<const sem::Constant*> args,
+                                   const Source&) {
+    auto transform = [&](const sem::Constant* c0) {
+        auto create = [&](auto e) {
+            using NumberT = decltype(e);
+            using T = UnwrapNumber<NumberT>;
+
+            auto integral = NumberT(0);
+            auto fract = std::abs(std::modf(e.value, &(integral.value)));
+            // When e lies halfway between integers k and k + 1, the result is k when k is even,
+            // and k + 1 when k is odd.
+            NumberT result = NumberT(0.0);
+            if (fract == NumberT(0.5)) {
+                // If the integral value is negative, then we need to subtract one in order to move
+                // to the correct `k`. The half way check is `k` and `k + 1` which in the positive
+                // case is `x` and `x + 1` but in the negative case is `x - 1` and `x`.
+                T integral_val = integral.value;
+                if (std::signbit(integral_val)) {
+                    integral_val = std::abs(integral_val - 1);
+                }
+                if (uint64_t(integral_val) % 2 == 0) {
+                    result = NumberT(std::floor(e.value));
+                } else {
+                    result = NumberT(std::ceil(e.value));
+                }
+            } else {
+                result = NumberT(std::round(e.value));
+            }
+            return CreateElement(builder, c0->Type(), result);
+        };
+        return Dispatch_fa_f32_f16(create, c0);
+    };
+    return TransformElements(builder, ty, transform, args[0]);
+}
+
 ConstEval::Result ConstEval::saturate(const sem::Type* ty,
                                       utils::VectorRef<const sem::Constant*> args,
                                       const Source&) {
diff --git a/src/tint/resolver/const_eval.h b/src/tint/resolver/const_eval.h
index 269fc40..aa8dc2d 100644
--- a/src/tint/resolver/const_eval.h
+++ b/src/tint/resolver/const_eval.h
@@ -656,6 +656,15 @@
                        utils::VectorRef<const sem::Constant*> args,
                        const Source& source);
 
+    /// round builtin
+    /// @param ty the expression type
+    /// @param args the input arguments
+    /// @param source the source location of the conversion
+    /// @return the result value, or null if the value cannot be calculated
+    Result round(const sem::Type* ty,
+                 utils::VectorRef<const sem::Constant*> args,
+                 const Source& source);
+
     /// saturate 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 d3e3ca0..c893a29 100644
--- a/src/tint/resolver/const_eval_builtin_test.cc
+++ b/src/tint/resolver/const_eval_builtin_test.cc
@@ -1478,6 +1478,36 @@
                                               ReverseBitsCases<u32>()))));
 
 template <typename T>
+std::vector<Case> RoundCases() {
+    std::vector<Case> cases = {
+        C({T(0.0)}, T(0.0)),      //
+        C({-T(0.0)}, -T(0.0)),    //
+        C({T(1.5)}, T(2.0)),      //
+        C({T(2.5)}, T(2.0)),      //
+        C({T(2.4)}, T(2.0)),      //
+        C({T(2.6)}, T(3.0)),      //
+        C({T(1.49999)}, T(1.0)),  //
+        C({T(1.50001)}, T(2.0)),  //
+        C({-T(1.5)}, -T(2.0)),    //
+        C({-T(2.5)}, -T(2.0)),    //
+        C({-T(2.6)}, -T(3.0)),    //
+        C({-T(2.4)}, -T(2.0)),    //
+
+        // Vector tests
+        C({Vec(T(0.0), T(1.5), T(2.5))}, Vec(T(0.0), T(2.0), T(2.0))),
+    };
+
+    return cases;
+}
+INSTANTIATE_TEST_SUITE_P(  //
+    Round,
+    ResolverConstEvalBuiltinTest,
+    testing::Combine(testing::Values(sem::BuiltinType::kRound),
+                     testing::ValuesIn(Concat(RoundCases<AFloat>(),  //
+                                              RoundCases<f32>(),
+                                              RoundCases<f16>()))));
+
+template <typename T>
 std::vector<Case> SaturateCases() {
     return {
         C({T(0)}, T(0)),
diff --git a/src/tint/resolver/intrinsic_table.inl b/src/tint/resolver/intrinsic_table.inl
index 0acced1..d65dc5d 100644
--- a/src/tint/resolver/intrinsic_table.inl
+++ b/src/tint/resolver/intrinsic_table.inl
@@ -12993,24 +12993,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[895],
     /* return matcher indices */ &kMatcherIndices[3],
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
-    /* const eval */ nullptr,
+    /* const eval */ &ConstEval::round,
   },
   {
     /* [389] */
     /* 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[896],
     /* return matcher indices */ &kMatcherIndices[30],
     /* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
-    /* const eval */ nullptr,
+    /* const eval */ &ConstEval::round,
   },
   {
     /* [390] */
@@ -14461,8 +14461,8 @@
   },
   {
     /* [66] */
-    /* fn round<T : f32_f16>(T) -> T */
-    /* fn round<N : num, T : f32_f16>(vec<N, T>) -> vec<N, T> */
+    /* fn round<T : fa_f32_f16>(@test_value(3.4) T) -> T */
+    /* fn round<N : num, T : fa_f32_f16>(@test_value(3.4) vec<N, T>) -> vec<N, T> */
     /* num overloads */ 2,
     /* overloads */ &kOverloads[388],
   },
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl b/test/tint/builtins/gen/literal/round/106c0b.wgsl
index bb4b131..31e76ba 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl
@@ -23,7 +23,7 @@
 
 // fn round(vec<4, f32>) -> vec<4, f32>
 fn round_106c0b() {
-  var res: vec4<f32> = round(vec4<f32>(1.f));
+  var res: vec4<f32> = round(vec4<f32>(3.4f));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.dxc.hlsl
index cbcc5cf..3bdb1e3 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_106c0b() {
-  float4 res = round((1.0f).xxxx);
+  float4 res = (3.0f).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.fxc.hlsl
index cbcc5cf..3bdb1e3 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void round_106c0b() {
-  float4 res = round((1.0f).xxxx);
+  float4 res = (3.0f).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.glsl
index 476bb4c..39b7333 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void round_106c0b() {
-  vec4 res = round(vec4(1.0f));
+  vec4 res = vec4(3.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void round_106c0b() {
-  vec4 res = round(vec4(1.0f));
+  vec4 res = vec4(3.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void round_106c0b() {
-  vec4 res = round(vec4(1.0f));
+  vec4 res = vec4(3.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.msl
index 89a1522..cfa1d57 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_106c0b() {
-  float4 res = rint(float4(1.0f));
+  float4 res = float4(3.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.spvasm
index 8c44d7c..878880c 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 32
+; Bound: 31
 ; Schema: 0
                OpCapability Shader
-         %14 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -31,36 +30,36 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
-    %float_1 = OpConstant %float 1
-         %16 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
+    %float_3 = OpConstant %float 3
+         %14 = OpConstantComposite %v4float %float_3 %float_3 %float_3 %float_3
 %_ptr_Function_v4float = OpTypePointer Function %v4float
-         %19 = OpTypeFunction %v4float
+         %17 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
 %round_106c0b = OpFunction %void None %9
          %12 = OpLabel
         %res = OpVariable %_ptr_Function_v4float Function %5
-         %13 = OpExtInst %v4float %14 RoundEven %16
-               OpStore %res %13
+               OpStore %res %14
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %19
-         %21 = OpLabel
-         %22 = OpFunctionCall %void %round_106c0b
+%vertex_main_inner = OpFunction %v4float None %17
+         %19 = OpLabel
+         %20 = OpFunctionCall %void %round_106c0b
                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 %round_106c0b
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %round_106c0b
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %30 = OpLabel
-         %31 = OpFunctionCall %void %round_106c0b
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %round_106c0b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.wgsl
index 4bf6403..be86d16 100644
--- a/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/106c0b.wgsl.expected.wgsl
@@ -1,5 +1,5 @@
 fn round_106c0b() {
-  var res : vec4<f32> = round(vec4<f32>(1.0f));
+  var res : vec4<f32> = round(vec4<f32>(3.400000095f));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/184d5a.wgsl b/test/tint/builtins/gen/literal/round/184d5a.wgsl
new file mode 100644
index 0000000..56c4e50
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/184d5a.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 round(vec<4, fa>) -> vec<4, fa>
+fn round_184d5a() {
+  var res = round(vec4(3.4));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_184d5a();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_184d5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_184d5a();
+}
diff --git a/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..278152a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void round_184d5a() {
+  float4 res = (3.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_184d5a();
+  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() {
+  round_184d5a();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_184d5a();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..278152a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void round_184d5a() {
+  float4 res = (3.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_184d5a();
+  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() {
+  round_184d5a();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_184d5a();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.glsl
new file mode 100644
index 0000000..d27ab94
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void round_184d5a() {
+  vec4 res = vec4(3.0f);
+}
+
+vec4 vertex_main() {
+  round_184d5a();
+  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 round_184d5a() {
+  vec4 res = vec4(3.0f);
+}
+
+void fragment_main() {
+  round_184d5a();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void round_184d5a() {
+  vec4 res = vec4(3.0f);
+}
+
+void compute_main() {
+  round_184d5a();
+}
+
+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/round/184d5a.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.msl
new file mode 100644
index 0000000..e592f73
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_184d5a() {
+  float4 res = float4(3.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  round_184d5a();
+  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() {
+  round_184d5a();
+  return;
+}
+
+kernel void compute_main() {
+  round_184d5a();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.spvasm
new file mode 100644
index 0000000..67a91d3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %round_184d5a "round_184d5a"
+               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_3 = OpConstant %float 3
+         %14 = OpConstantComposite %v4float %float_3 %float_3 %float_3 %float_3
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+         %17 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+%round_184d5a = 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 %round_184d5a
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %22 = OpLabel
+         %23 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %23
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %round_184d5a
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %round_184d5a
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.wgsl
new file mode 100644
index 0000000..8f0872c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/184d5a.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn round_184d5a() {
+  var res = round(vec4(3.4));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_184d5a();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_184d5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_184d5a();
+}
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl b/test/tint/builtins/gen/literal/round/1c7897.wgsl
index 47901ac..af33919 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl
@@ -23,7 +23,7 @@
 
 // fn round(vec<3, f32>) -> vec<3, f32>
 fn round_1c7897() {
-  var res: vec3<f32> = round(vec3<f32>(1.f));
+  var res: vec3<f32> = round(vec3<f32>(3.4f));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.dxc.hlsl
index 654f791..f22675b 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_1c7897() {
-  float3 res = round((1.0f).xxx);
+  float3 res = (3.0f).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.fxc.hlsl
index 654f791..f22675b 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void round_1c7897() {
-  float3 res = round((1.0f).xxx);
+  float3 res = (3.0f).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.glsl
index 4ab3d34..c275e8e 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void round_1c7897() {
-  vec3 res = round(vec3(1.0f));
+  vec3 res = vec3(3.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void round_1c7897() {
-  vec3 res = round(vec3(1.0f));
+  vec3 res = vec3(3.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void round_1c7897() {
-  vec3 res = round(vec3(1.0f));
+  vec3 res = vec3(3.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.msl
index af57b2f..2e26c54 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_1c7897() {
-  float3 res = rint(float3(1.0f));
+  float3 res = float3(3.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.spvasm
index b9cd1e0..a28da2e 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
-         %15 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -32,37 +31,37 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
-    %float_1 = OpConstant %float 1
-         %17 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+    %float_3 = OpConstant %float 3
+         %15 = OpConstantComposite %v3float %float_3 %float_3 %float_3
 %_ptr_Function_v3float = OpTypePointer Function %v3float
-         %20 = OpConstantNull %v3float
-         %21 = OpTypeFunction %v4float
+         %18 = OpConstantNull %v3float
+         %19 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
 %round_1c7897 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3float Function %20
-         %13 = OpExtInst %v3float %15 RoundEven %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 %round_1c7897
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %round_1c7897
                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 %round_1c7897
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %round_1c7897
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %round_1c7897
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %round_1c7897
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.wgsl
index 4767a89..1dd4fc6 100644
--- a/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/1c7897.wgsl.expected.wgsl
@@ -1,5 +1,5 @@
 fn round_1c7897() {
-  var res : vec3<f32> = round(vec3<f32>(1.0f));
+  var res : vec3<f32> = round(vec3<f32>(3.400000095f));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl b/test/tint/builtins/gen/literal/round/52c84d.wgsl
index 3a416c2..17bf011 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl
@@ -23,7 +23,7 @@
 
 // fn round(vec<2, f32>) -> vec<2, f32>
 fn round_52c84d() {
-  var res: vec2<f32> = round(vec2<f32>(1.f));
+  var res: vec2<f32> = round(vec2<f32>(3.4f));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.dxc.hlsl
index f8c0830..9bbbab4 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_52c84d() {
-  float2 res = round((1.0f).xx);
+  float2 res = (3.0f).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.fxc.hlsl
index f8c0830..9bbbab4 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void round_52c84d() {
-  float2 res = round((1.0f).xx);
+  float2 res = (3.0f).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.glsl
index 494a03b..30ba810 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void round_52c84d() {
-  vec2 res = round(vec2(1.0f));
+  vec2 res = vec2(3.0f);
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void round_52c84d() {
-  vec2 res = round(vec2(1.0f));
+  vec2 res = vec2(3.0f);
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void round_52c84d() {
-  vec2 res = round(vec2(1.0f));
+  vec2 res = vec2(3.0f);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.msl
index 803ee34..af2fe94 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_52c84d() {
-  float2 res = rint(float2(1.0f));
+  float2 res = float2(3.0f);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.spvasm
index 861f456..43f47a8 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 33
 ; Schema: 0
                OpCapability Shader
-         %15 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -32,37 +31,37 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
-    %float_1 = OpConstant %float 1
-         %17 = OpConstantComposite %v2float %float_1 %float_1
+    %float_3 = OpConstant %float 3
+         %15 = OpConstantComposite %v2float %float_3 %float_3
 %_ptr_Function_v2float = OpTypePointer Function %v2float
-         %20 = OpConstantNull %v2float
-         %21 = OpTypeFunction %v4float
+         %18 = OpConstantNull %v2float
+         %19 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
 %round_52c84d = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2float Function %20
-         %13 = OpExtInst %v2float %15 RoundEven %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 %round_52c84d
+%vertex_main_inner = OpFunction %v4float None %19
+         %21 = OpLabel
+         %22 = OpFunctionCall %void %round_52c84d
                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 %round_52c84d
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %round_52c84d
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %round_52c84d
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %round_52c84d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.wgsl
index ce71281..c075326 100644
--- a/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/52c84d.wgsl.expected.wgsl
@@ -1,5 +1,5 @@
 fn round_52c84d() {
-  var res : vec2<f32> = round(vec2<f32>(1.0f));
+  var res : vec2<f32> = round(vec2<f32>(3.400000095f));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/773a8f.wgsl b/test/tint/builtins/gen/literal/round/773a8f.wgsl
new file mode 100644
index 0000000..1f0ad03
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/773a8f.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 round(fa) -> fa
+fn round_773a8f() {
+  var res = round(3.4);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_773a8f();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_773a8f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_773a8f();
+}
diff --git a/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..dc329d8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void round_773a8f() {
+  float res = 3.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_773a8f();
+  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() {
+  round_773a8f();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_773a8f();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..dc329d8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void round_773a8f() {
+  float res = 3.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_773a8f();
+  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() {
+  round_773a8f();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_773a8f();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.glsl
new file mode 100644
index 0000000..f7e71c8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void round_773a8f() {
+  float res = 3.0f;
+}
+
+vec4 vertex_main() {
+  round_773a8f();
+  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 round_773a8f() {
+  float res = 3.0f;
+}
+
+void fragment_main() {
+  round_773a8f();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void round_773a8f() {
+  float res = 3.0f;
+}
+
+void compute_main() {
+  round_773a8f();
+}
+
+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/round/773a8f.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.msl
new file mode 100644
index 0000000..4b27365
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_773a8f() {
+  float res = 3.0f;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  round_773a8f();
+  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() {
+  round_773a8f();
+  return;
+}
+
+kernel void compute_main() {
+  round_773a8f();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.spvasm
new file mode 100644
index 0000000..b97daa9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/773a8f.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 %round_773a8f "round_773a8f"
+               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_3 = OpConstant %float 3
+%_ptr_Function_float = OpTypePointer Function %float
+         %16 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+%round_773a8f = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %8
+               OpStore %res %float_3
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+         %18 = OpLabel
+         %19 = OpFunctionCall %void %round_773a8f
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %21 = OpLabel
+         %22 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %22
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %round_773a8f
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %round_773a8f
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.wgsl
new file mode 100644
index 0000000..b151d40
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/773a8f.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn round_773a8f() {
+  var res = round(3.4);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_773a8f();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_773a8f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_773a8f();
+}
diff --git a/test/tint/builtins/gen/literal/round/8fdca3.wgsl b/test/tint/builtins/gen/literal/round/8fdca3.wgsl
new file mode 100644
index 0000000..059ab19
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/8fdca3.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 round(vec<2, fa>) -> vec<2, fa>
+fn round_8fdca3() {
+  var res = round(vec2(3.4));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_8fdca3();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_8fdca3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_8fdca3();
+}
diff --git a/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5e441a3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void round_8fdca3() {
+  float2 res = (3.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_8fdca3();
+  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() {
+  round_8fdca3();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_8fdca3();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5e441a3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void round_8fdca3() {
+  float2 res = (3.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_8fdca3();
+  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() {
+  round_8fdca3();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_8fdca3();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.glsl
new file mode 100644
index 0000000..ef15129
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void round_8fdca3() {
+  vec2 res = vec2(3.0f);
+}
+
+vec4 vertex_main() {
+  round_8fdca3();
+  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 round_8fdca3() {
+  vec2 res = vec2(3.0f);
+}
+
+void fragment_main() {
+  round_8fdca3();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void round_8fdca3() {
+  vec2 res = vec2(3.0f);
+}
+
+void compute_main() {
+  round_8fdca3();
+}
+
+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/round/8fdca3.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.msl
new file mode 100644
index 0000000..dbffaee
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_8fdca3() {
+  float2 res = float2(3.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  round_8fdca3();
+  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() {
+  round_8fdca3();
+  return;
+}
+
+kernel void compute_main() {
+  round_8fdca3();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.spvasm
new file mode 100644
index 0000000..40ce4a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %round_8fdca3 "round_8fdca3"
+               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_3 = OpConstant %float 3
+         %15 = OpConstantComposite %v2float %float_3 %float_3
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+         %18 = OpConstantNull %v2float
+         %19 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+%round_8fdca3 = 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 %round_8fdca3
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %25
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %round_8fdca3
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %round_8fdca3
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.wgsl
new file mode 100644
index 0000000..13867b0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/8fdca3.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn round_8fdca3() {
+  var res = round(vec2(3.4));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_8fdca3();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_8fdca3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_8fdca3();
+}
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl b/test/tint/builtins/gen/literal/round/9078ef.wgsl
index f9753e1..58c608f 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl
@@ -25,7 +25,7 @@
 
 // fn round(f16) -> f16
 fn round_9078ef() {
-  var res: f16 = round(1.h);
+  var res: f16 = round(3.4h);
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.dxc.hlsl
index 54293a2..5ffca69 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_9078ef() {
-  float16_t res = round(float16_t(1.0h));
+  float16_t res = float16_t(3.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.glsl
index f29b5bd..72105b4 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_9078ef() {
-  float16_t res = round(1.0hf);
+  float16_t res = 3.0hf;
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void round_9078ef() {
-  float16_t res = round(1.0hf);
+  float16_t res = 3.0hf;
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_9078ef() {
-  float16_t res = round(1.0hf);
+  float16_t res = 3.0hf;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.msl
index dc3bbdb..a9fe430 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_9078ef() {
-  half res = rint(1.0h);
+  half res = 3.0h;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.spvasm
index 44eed14..7e23e01 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 32
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %15 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -36,37 +35,36 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-%half_0x1p_0 = OpConstant %half 0x1p+0
+%half_0x1_8p_1 = OpConstant %half 0x1.8p+1
 %_ptr_Function_half = OpTypePointer Function %half
-         %19 = OpConstantNull %half
-         %20 = OpTypeFunction %v4float
+         %17 = OpConstantNull %half
+         %18 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %round_9078ef = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_half Function %19
-         %13 = OpExtInst %half %15 RoundEven %half_0x1p_0
-               OpStore %res %13
+        %res = OpVariable %_ptr_Function_half Function %17
+               OpStore %res %half_0x1_8p_1
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %20
-         %22 = OpLabel
-         %23 = OpFunctionCall %void %round_9078ef
+%vertex_main_inner = OpFunction %v4float None %18
+         %20 = OpLabel
+         %21 = OpFunctionCall %void %round_9078ef
                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 %round_9078ef
+         %27 = OpLabel
+         %28 = OpFunctionCall %void %round_9078ef
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %round_9078ef
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %round_9078ef
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.wgsl
index d0750a8..170d4a4 100644
--- a/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/9078ef.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
 enable f16;
 
 fn round_9078ef() {
-  var res : f16 = round(1.0h);
+  var res : f16 = round(3.3984375h);
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl b/test/tint/builtins/gen/literal/round/9edc38.wgsl
index 7a3670f..a3b64a4 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl
@@ -23,7 +23,7 @@
 
 // fn round(f32) -> f32
 fn round_9edc38() {
-  var res: f32 = round(1.f);
+  var res: f32 = round(3.4f);
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.dxc.hlsl
index dd35aab..daa1c1c 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_9edc38() {
-  float res = round(1.0f);
+  float res = 3.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.fxc.hlsl
index dd35aab..daa1c1c 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void round_9edc38() {
-  float res = round(1.0f);
+  float res = 3.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.glsl
index b7f45f1..01ef2a5 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void round_9edc38() {
-  float res = round(1.0f);
+  float res = 3.0f;
 }
 
 vec4 vertex_main() {
@@ -21,7 +21,7 @@
 precision mediump float;
 
 void round_9edc38() {
-  float res = round(1.0f);
+  float res = 3.0f;
 }
 
 void fragment_main() {
@@ -35,7 +35,7 @@
 #version 310 es
 
 void round_9edc38() {
-  float res = round(1.0f);
+  float res = 3.0f;
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.msl
index b6406d5..611d154 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_9edc38() {
-  float res = rint(1.0f);
+  float res = 3.0f;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.spvasm
index 604b2b3..8f2c920 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.spvasm
@@ -1,10 +1,9 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 31
+; Bound: 30
 ; Schema: 0
                OpCapability Shader
-         %14 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -31,35 +30,35 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
-    %float_1 = OpConstant %float 1
+    %float_3 = OpConstant %float 3
 %_ptr_Function_float = OpTypePointer Function %float
-         %18 = OpTypeFunction %v4float
+         %16 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
 %round_9edc38 = OpFunction %void None %9
          %12 = OpLabel
         %res = OpVariable %_ptr_Function_float Function %8
-         %13 = OpExtInst %float %14 RoundEven %float_1
-               OpStore %res %13
+               OpStore %res %float_3
                OpReturn
                OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %18
-         %20 = OpLabel
-         %21 = OpFunctionCall %void %round_9edc38
+%vertex_main_inner = OpFunction %v4float None %16
+         %18 = OpLabel
+         %19 = OpFunctionCall %void %round_9edc38
                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 %round_9edc38
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %round_9edc38
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %round_9edc38
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %round_9edc38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.wgsl
index a467241..918f864 100644
--- a/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/9edc38.wgsl.expected.wgsl
@@ -1,5 +1,5 @@
 fn round_9edc38() {
-  var res : f32 = round(1.0f);
+  var res : f32 = round(3.400000095f);
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/a1673d.wgsl b/test/tint/builtins/gen/literal/round/a1673d.wgsl
new file mode 100644
index 0000000..9487990
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/a1673d.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 round(vec<3, fa>) -> vec<3, fa>
+fn round_a1673d() {
+  var res = round(vec3(3.4));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_a1673d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_a1673d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_a1673d();
+}
diff --git a/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4032312
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void round_a1673d() {
+  float3 res = (3.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_a1673d();
+  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() {
+  round_a1673d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_a1673d();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4032312
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void round_a1673d() {
+  float3 res = (3.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_a1673d();
+  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() {
+  round_a1673d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_a1673d();
+  return;
+}
diff --git a/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.glsl
new file mode 100644
index 0000000..0a8db5f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void round_a1673d() {
+  vec3 res = vec3(3.0f);
+}
+
+vec4 vertex_main() {
+  round_a1673d();
+  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 round_a1673d() {
+  vec3 res = vec3(3.0f);
+}
+
+void fragment_main() {
+  round_a1673d();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void round_a1673d() {
+  vec3 res = vec3(3.0f);
+}
+
+void compute_main() {
+  round_a1673d();
+}
+
+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/round/a1673d.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.msl
new file mode 100644
index 0000000..e9b35bb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_a1673d() {
+  float3 res = float3(3.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  round_a1673d();
+  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() {
+  round_a1673d();
+  return;
+}
+
+kernel void compute_main() {
+  round_a1673d();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.spvasm
new file mode 100644
index 0000000..e9bbf2e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %round_a1673d "round_a1673d"
+               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_3 = OpConstant %float 3
+         %15 = OpConstantComposite %v3float %float_3 %float_3 %float_3
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+         %18 = OpConstantNull %v3float
+         %19 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+%round_a1673d = 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 %round_a1673d
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %25
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %round_a1673d
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %round_a1673d
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.wgsl
new file mode 100644
index 0000000..89bacdf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/round/a1673d.wgsl.expected.wgsl
@@ -0,0 +1,19 @@
+fn round_a1673d() {
+  var res = round(vec3(3.4));
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_a1673d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_a1673d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_a1673d();
+}
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl b/test/tint/builtins/gen/literal/round/d87e84.wgsl
index a2bd758..b9d842e 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl
@@ -25,7 +25,7 @@
 
 // fn round(vec<2, f16>) -> vec<2, f16>
 fn round_d87e84() {
-  var res: vec2<f16> = round(vec2<f16>(1.h));
+  var res: vec2<f16> = round(vec2<f16>(3.4h));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.dxc.hlsl
index 154f888..96f6ffe 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_d87e84() {
-  vector<float16_t, 2> res = round((float16_t(1.0h)).xx);
+  vector<float16_t, 2> res = (float16_t(3.0h)).xx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.glsl
index 00afdb0..2c32de4 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_d87e84() {
-  f16vec2 res = round(f16vec2(1.0hf));
+  f16vec2 res = f16vec2(3.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void round_d87e84() {
-  f16vec2 res = round(f16vec2(1.0hf));
+  f16vec2 res = f16vec2(3.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_d87e84() {
-  f16vec2 res = round(f16vec2(1.0hf));
+  f16vec2 res = f16vec2(3.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.msl
index 31cb08a..4393a40 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_d87e84() {
-  half2 res = rint(half2(1.0h));
+  half2 res = half2(3.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.spvasm
index d94035e..5e597b2 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %16 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,38 +36,37 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
-%half_0x1p_0 = OpConstant %half 0x1p+0
-         %18 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+%half_0x1_8p_1 = OpConstant %half 0x1.8p+1
+         %16 = OpConstantComposite %v2half %half_0x1_8p_1 %half_0x1_8p_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
-         %21 = OpConstantNull %v2half
-         %22 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v2half
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %round_d87e84 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v2half Function %21
-         %13 = OpExtInst %v2half %16 RoundEven %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 %round_d87e84
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %round_d87e84
                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 %round_d87e84
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %round_d87e84
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %round_d87e84
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %round_d87e84
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.wgsl
index a771f35..64094ac 100644
--- a/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/d87e84.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
 enable f16;
 
 fn round_d87e84() {
-  var res : vec2<f16> = round(vec2<f16>(1.0h));
+  var res : vec2<f16> = round(vec2<f16>(3.3984375h));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl b/test/tint/builtins/gen/literal/round/e1bba2.wgsl
index a942899..5353797 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl
@@ -25,7 +25,7 @@
 
 // fn round(vec<3, f16>) -> vec<3, f16>
 fn round_e1bba2() {
-  var res: vec3<f16> = round(vec3<f16>(1.h));
+  var res: vec3<f16> = round(vec3<f16>(3.4h));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.dxc.hlsl
index 061b32c..d2d2c98 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_e1bba2() {
-  vector<float16_t, 3> res = round((float16_t(1.0h)).xxx);
+  vector<float16_t, 3> res = (float16_t(3.0h)).xxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.glsl
index 0717d6b..a03d0bf 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_e1bba2() {
-  f16vec3 res = round(f16vec3(1.0hf));
+  f16vec3 res = f16vec3(3.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void round_e1bba2() {
-  f16vec3 res = round(f16vec3(1.0hf));
+  f16vec3 res = f16vec3(3.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_e1bba2() {
-  f16vec3 res = round(f16vec3(1.0hf));
+  f16vec3 res = f16vec3(3.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.msl
index 5f47a88..4b890be 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_e1bba2() {
-  half3 res = rint(half3(1.0h));
+  half3 res = half3(3.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.spvasm
index 8e82f20..9a870a2 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %16 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,38 +36,37 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-%half_0x1p_0 = OpConstant %half 0x1p+0
-         %18 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+%half_0x1_8p_1 = OpConstant %half 0x1.8p+1
+         %16 = OpConstantComposite %v3half %half_0x1_8p_1 %half_0x1_8p_1 %half_0x1_8p_1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
-         %21 = OpConstantNull %v3half
-         %22 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v3half
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %round_e1bba2 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v3half Function %21
-         %13 = OpExtInst %v3half %16 RoundEven %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 %round_e1bba2
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %round_e1bba2
                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 %round_e1bba2
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %round_e1bba2
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %round_e1bba2
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %round_e1bba2
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.wgsl
index 2c270f9..897964e 100644
--- a/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/e1bba2.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
 enable f16;
 
 fn round_e1bba2() {
-  var res : vec3<f16> = round(vec3<f16>(1.0h));
+  var res : vec3<f16> = round(vec3<f16>(3.3984375h));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl b/test/tint/builtins/gen/literal/round/f665b5.wgsl
index a3889e4..f16b14a 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl
@@ -25,7 +25,7 @@
 
 // fn round(vec<4, f16>) -> vec<4, f16>
 fn round_f665b5() {
-  var res: vec4<f16> = round(vec4<f16>(1.h));
+  var res: vec4<f16> = round(vec4<f16>(3.4h));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.dxc.hlsl
index c0820c5..90f7e0b 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_f665b5() {
-  vector<float16_t, 4> res = round((float16_t(1.0h)).xxxx);
+  vector<float16_t, 4> res = (float16_t(3.0h)).xxxx;
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.glsl
index 4293476..5107c21 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_f665b5() {
-  f16vec4 res = round(f16vec4(1.0hf));
+  f16vec4 res = f16vec4(3.0hf);
 }
 
 vec4 vertex_main() {
@@ -23,7 +23,7 @@
 precision mediump float;
 
 void round_f665b5() {
-  f16vec4 res = round(f16vec4(1.0hf));
+  f16vec4 res = f16vec4(3.0hf);
 }
 
 void fragment_main() {
@@ -38,7 +38,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_f665b5() {
-  f16vec4 res = round(f16vec4(1.0hf));
+  f16vec4 res = f16vec4(3.0hf);
 }
 
 void compute_main() {
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.msl b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.msl
index 92a75ec..9ab14ff 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_f665b5() {
-  half4 res = rint(half4(1.0h));
+  half4 res = half4(3.0h);
 }
 
 struct tint_symbol {
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.spvasm
index a0a5f90..341d4cc 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.spvasm
@@ -1,14 +1,13 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
                OpCapability Float16
                OpCapability UniformAndStorageBuffer16BitAccess
                OpCapability StorageBuffer16BitAccess
                OpCapability StorageInputOutput16
-         %16 = OpExtInstImport "GLSL.std.450"
                OpMemoryModel Logical GLSL450
                OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
                OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -37,38 +36,37 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
-%half_0x1p_0 = OpConstant %half 0x1p+0
-         %18 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+%half_0x1_8p_1 = OpConstant %half 0x1.8p+1
+         %16 = OpConstantComposite %v4half %half_0x1_8p_1 %half_0x1_8p_1 %half_0x1_8p_1 %half_0x1_8p_1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
-         %21 = OpConstantNull %v4half
-         %22 = OpTypeFunction %v4float
+         %19 = OpConstantNull %v4half
+         %20 = OpTypeFunction %v4float
     %float_1 = OpConstant %float 1
 %round_f665b5 = OpFunction %void None %9
          %12 = OpLabel
-        %res = OpVariable %_ptr_Function_v4half Function %21
-         %13 = OpExtInst %v4half %16 RoundEven %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 %round_f665b5
+%vertex_main_inner = OpFunction %v4float None %20
+         %22 = OpLabel
+         %23 = OpFunctionCall %void %round_f665b5
                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 %round_f665b5
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %round_f665b5
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %round_f665b5
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %round_f665b5
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.wgsl
index dbecbec..ed1085f 100644
--- a/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/literal/round/f665b5.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
 enable f16;
 
 fn round_f665b5() {
-  var res : vec4<f16> = round(vec4<f16>(1.0h));
+  var res : vec4<f16> = round(vec4<f16>(3.3984375h));
 }
 
 @vertex
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl b/test/tint/builtins/gen/var/round/106c0b.wgsl
index 9377b8b..961d709 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl
@@ -23,7 +23,7 @@
 
 // fn round(vec<4, f32>) -> vec<4, f32>
 fn round_106c0b() {
-  var arg_0 = vec4<f32>(1.f);
+  var arg_0 = vec4<f32>(3.4f);
   var res: vec4<f32> = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.dxc.hlsl
index a784c58..943dbcc 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_106c0b() {
-  float4 arg_0 = (1.0f).xxxx;
+  float4 arg_0 = (3.400000095f).xxxx;
   float4 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.fxc.hlsl
index a784c58..943dbcc 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void round_106c0b() {
-  float4 arg_0 = (1.0f).xxxx;
+  float4 arg_0 = (3.400000095f).xxxx;
   float4 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.glsl
index e36ec98..8d05096 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void round_106c0b() {
-  vec4 arg_0 = vec4(1.0f);
+  vec4 arg_0 = vec4(3.400000095f);
   vec4 res = round(arg_0);
 }
 
@@ -22,7 +22,7 @@
 precision mediump float;
 
 void round_106c0b() {
-  vec4 arg_0 = vec4(1.0f);
+  vec4 arg_0 = vec4(3.400000095f);
   vec4 res = round(arg_0);
 }
 
@@ -37,7 +37,7 @@
 #version 310 es
 
 void round_106c0b() {
-  vec4 arg_0 = vec4(1.0f);
+  vec4 arg_0 = vec4(3.400000095f);
   vec4 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.msl b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.msl
index b1254e6..d08ef75 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_106c0b() {
-  float4 arg_0 = float4(1.0f);
+  float4 arg_0 = float4(3.400000095f);
   float4 res = rint(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.spvasm
index f8cf66d..d10298f 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 34
+; Bound: 35
 ; Schema: 0
                OpCapability Shader
          %18 = OpExtInstImport "GLSL.std.450"
@@ -32,10 +32,11 @@
 %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
+%float_3_4000001 = OpConstant %float 3.4000001
+         %14 = OpConstantComposite %v4float %float_3_4000001 %float_3_4000001 %float_3_4000001 %float_3_4000001
 %_ptr_Function_v4float = OpTypePointer Function %v4float
          %21 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
 %round_106c0b = OpFunction %void None %9
          %12 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v4float Function %5
@@ -59,12 +60,12 @@
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %29 = OpLabel
-         %30 = OpFunctionCall %void %round_106c0b
+         %30 = OpLabel
+         %31 = OpFunctionCall %void %round_106c0b
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %32 = OpLabel
-         %33 = OpFunctionCall %void %round_106c0b
+         %33 = OpLabel
+         %34 = OpFunctionCall %void %round_106c0b
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.wgsl
index 9faa312..b6ef0fa 100644
--- a/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/106c0b.wgsl.expected.wgsl
@@ -1,5 +1,5 @@
 fn round_106c0b() {
-  var arg_0 = vec4<f32>(1.0f);
+  var arg_0 = vec4<f32>(3.400000095f);
   var res : vec4<f32> = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/184d5a.wgsl b/test/tint/builtins/gen/var/round/184d5a.wgsl
new file mode 100644
index 0000000..a99e108
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/184d5a.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 round(vec<4, fa>) -> vec<4, fa>
+fn round_184d5a() {
+  const arg_0 = vec4(3.4);
+  var res = round(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_184d5a();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_184d5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_184d5a();
+}
diff --git a/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..278152a
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void round_184d5a() {
+  float4 res = (3.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_184d5a();
+  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() {
+  round_184d5a();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_184d5a();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..278152a
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void round_184d5a() {
+  float4 res = (3.0f).xxxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_184d5a();
+  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() {
+  round_184d5a();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_184d5a();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.glsl
new file mode 100644
index 0000000..d27ab94
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void round_184d5a() {
+  vec4 res = vec4(3.0f);
+}
+
+vec4 vertex_main() {
+  round_184d5a();
+  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 round_184d5a() {
+  vec4 res = vec4(3.0f);
+}
+
+void fragment_main() {
+  round_184d5a();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void round_184d5a() {
+  vec4 res = vec4(3.0f);
+}
+
+void compute_main() {
+  round_184d5a();
+}
+
+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/round/184d5a.wgsl.expected.msl b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.msl
new file mode 100644
index 0000000..e592f73
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_184d5a() {
+  float4 res = float4(3.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  round_184d5a();
+  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() {
+  round_184d5a();
+  return;
+}
+
+kernel void compute_main() {
+  round_184d5a();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.spvasm
new file mode 100644
index 0000000..67a91d3
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.spvasm
@@ -0,0 +1,65 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 31
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %round_184d5a "round_184d5a"
+               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_3 = OpConstant %float 3
+         %14 = OpConstantComposite %v4float %float_3 %float_3 %float_3 %float_3
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+         %17 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+%round_184d5a = 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 %round_184d5a
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %22 = OpLabel
+         %23 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %23
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %26 = OpLabel
+         %27 = OpFunctionCall %void %round_184d5a
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %round_184d5a
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.wgsl
new file mode 100644
index 0000000..d4ffb6d
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/184d5a.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn round_184d5a() {
+  const arg_0 = vec4(3.4);
+  var res = round(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_184d5a();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_184d5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_184d5a();
+}
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl b/test/tint/builtins/gen/var/round/1c7897.wgsl
index e710262..2a023b4 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl
@@ -23,7 +23,7 @@
 
 // fn round(vec<3, f32>) -> vec<3, f32>
 fn round_1c7897() {
-  var arg_0 = vec3<f32>(1.f);
+  var arg_0 = vec3<f32>(3.4f);
   var res: vec3<f32> = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.dxc.hlsl
index 199e2ea..f11ae75 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_1c7897() {
-  float3 arg_0 = (1.0f).xxx;
+  float3 arg_0 = (3.400000095f).xxx;
   float3 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.fxc.hlsl
index 199e2ea..f11ae75 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void round_1c7897() {
-  float3 arg_0 = (1.0f).xxx;
+  float3 arg_0 = (3.400000095f).xxx;
   float3 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.glsl
index 6c96538..ed195d6 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void round_1c7897() {
-  vec3 arg_0 = vec3(1.0f);
+  vec3 arg_0 = vec3(3.400000095f);
   vec3 res = round(arg_0);
 }
 
@@ -22,7 +22,7 @@
 precision mediump float;
 
 void round_1c7897() {
-  vec3 arg_0 = vec3(1.0f);
+  vec3 arg_0 = vec3(3.400000095f);
   vec3 res = round(arg_0);
 }
 
@@ -37,7 +37,7 @@
 #version 310 es
 
 void round_1c7897() {
-  vec3 arg_0 = vec3(1.0f);
+  vec3 arg_0 = vec3(3.400000095f);
   vec3 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.msl b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.msl
index 8317df6..bd44954 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_1c7897() {
-  float3 arg_0 = float3(1.0f);
+  float3 arg_0 = float3(3.400000095f);
   float3 res = rint(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.spvasm
index cd19198..6f0e5d3 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
          %20 = OpExtInstImport "GLSL.std.450"
@@ -33,11 +33,12 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
     %v3float = OpTypeVector %float 3
-    %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v3float %float_1 %float_1 %float_1
+%float_3_4000001 = OpConstant %float 3.4000001
+         %15 = OpConstantComposite %v3float %float_3_4000001 %float_3_4000001 %float_3_4000001
 %_ptr_Function_v3float = OpTypePointer Function %v3float
          %18 = OpConstantNull %v3float
          %23 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
 %round_1c7897 = OpFunction %void None %9
          %12 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v3float Function %18
@@ -61,12 +62,12 @@
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %round_1c7897
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %round_1c7897
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %round_1c7897
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %round_1c7897
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.wgsl
index 1cd9dcd..1a23c8b 100644
--- a/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/1c7897.wgsl.expected.wgsl
@@ -1,5 +1,5 @@
 fn round_1c7897() {
-  var arg_0 = vec3<f32>(1.0f);
+  var arg_0 = vec3<f32>(3.400000095f);
   var res : vec3<f32> = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl b/test/tint/builtins/gen/var/round/52c84d.wgsl
index 6f15847..9578c82 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl
@@ -23,7 +23,7 @@
 
 // fn round(vec<2, f32>) -> vec<2, f32>
 fn round_52c84d() {
-  var arg_0 = vec2<f32>(1.f);
+  var arg_0 = vec2<f32>(3.4f);
   var res: vec2<f32> = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.dxc.hlsl
index f8016ba..0190de3 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_52c84d() {
-  float2 arg_0 = (1.0f).xx;
+  float2 arg_0 = (3.400000095f).xx;
   float2 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.fxc.hlsl
index f8016ba..0190de3 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void round_52c84d() {
-  float2 arg_0 = (1.0f).xx;
+  float2 arg_0 = (3.400000095f).xx;
   float2 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.glsl
index 07b1603..922bbfc 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void round_52c84d() {
-  vec2 arg_0 = vec2(1.0f);
+  vec2 arg_0 = vec2(3.400000095f);
   vec2 res = round(arg_0);
 }
 
@@ -22,7 +22,7 @@
 precision mediump float;
 
 void round_52c84d() {
-  vec2 arg_0 = vec2(1.0f);
+  vec2 arg_0 = vec2(3.400000095f);
   vec2 res = round(arg_0);
 }
 
@@ -37,7 +37,7 @@
 #version 310 es
 
 void round_52c84d() {
-  vec2 arg_0 = vec2(1.0f);
+  vec2 arg_0 = vec2(3.400000095f);
   vec2 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.msl b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.msl
index 03cb3ee..2efb971 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_52c84d() {
-  float2 arg_0 = float2(1.0f);
+  float2 arg_0 = float2(3.400000095f);
   float2 res = rint(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.spvasm
index 620c312..30c39e5 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 36
+; Bound: 37
 ; Schema: 0
                OpCapability Shader
          %20 = OpExtInstImport "GLSL.std.450"
@@ -33,11 +33,12 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
     %v2float = OpTypeVector %float 2
-    %float_1 = OpConstant %float 1
-         %15 = OpConstantComposite %v2float %float_1 %float_1
+%float_3_4000001 = OpConstant %float 3.4000001
+         %15 = OpConstantComposite %v2float %float_3_4000001 %float_3_4000001
 %_ptr_Function_v2float = OpTypePointer Function %v2float
          %18 = OpConstantNull %v2float
          %23 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
 %round_52c84d = OpFunction %void None %9
          %12 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_v2float Function %18
@@ -61,12 +62,12 @@
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %round_52c84d
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %round_52c84d
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %34 = OpLabel
-         %35 = OpFunctionCall %void %round_52c84d
+         %35 = OpLabel
+         %36 = OpFunctionCall %void %round_52c84d
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.wgsl
index a6cb052..989c7e9 100644
--- a/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/52c84d.wgsl.expected.wgsl
@@ -1,5 +1,5 @@
 fn round_52c84d() {
-  var arg_0 = vec2<f32>(1.0f);
+  var arg_0 = vec2<f32>(3.400000095f);
   var res : vec2<f32> = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/773a8f.wgsl b/test/tint/builtins/gen/var/round/773a8f.wgsl
new file mode 100644
index 0000000..556dd8f
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/773a8f.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 round(fa) -> fa
+fn round_773a8f() {
+  const arg_0 = 3.4;
+  var res = round(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_773a8f();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_773a8f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_773a8f();
+}
diff --git a/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..dc329d8
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void round_773a8f() {
+  float res = 3.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_773a8f();
+  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() {
+  round_773a8f();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_773a8f();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..dc329d8
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void round_773a8f() {
+  float res = 3.0f;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_773a8f();
+  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() {
+  round_773a8f();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_773a8f();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.glsl
new file mode 100644
index 0000000..f7e71c8
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void round_773a8f() {
+  float res = 3.0f;
+}
+
+vec4 vertex_main() {
+  round_773a8f();
+  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 round_773a8f() {
+  float res = 3.0f;
+}
+
+void fragment_main() {
+  round_773a8f();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void round_773a8f() {
+  float res = 3.0f;
+}
+
+void compute_main() {
+  round_773a8f();
+}
+
+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/round/773a8f.wgsl.expected.msl b/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.msl
new file mode 100644
index 0000000..4b27365
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_773a8f() {
+  float res = 3.0f;
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  round_773a8f();
+  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() {
+  round_773a8f();
+  return;
+}
+
+kernel void compute_main() {
+  round_773a8f();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.spvasm
new file mode 100644
index 0000000..b97daa9
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/773a8f.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 %round_773a8f "round_773a8f"
+               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_3 = OpConstant %float 3
+%_ptr_Function_float = OpTypePointer Function %float
+         %16 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+%round_773a8f = OpFunction %void None %9
+         %12 = OpLabel
+        %res = OpVariable %_ptr_Function_float Function %8
+               OpStore %res %float_3
+               OpReturn
+               OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %16
+         %18 = OpLabel
+         %19 = OpFunctionCall %void %round_773a8f
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %21 = OpLabel
+         %22 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %22
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %25 = OpLabel
+         %26 = OpFunctionCall %void %round_773a8f
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %round_773a8f
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.wgsl
new file mode 100644
index 0000000..3cd1f31
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/773a8f.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn round_773a8f() {
+  const arg_0 = 3.4;
+  var res = round(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_773a8f();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_773a8f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_773a8f();
+}
diff --git a/test/tint/builtins/gen/var/round/8fdca3.wgsl b/test/tint/builtins/gen/var/round/8fdca3.wgsl
new file mode 100644
index 0000000..9a56641
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/8fdca3.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 round(vec<2, fa>) -> vec<2, fa>
+fn round_8fdca3() {
+  const arg_0 = vec2(3.4);
+  var res = round(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_8fdca3();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_8fdca3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_8fdca3();
+}
diff --git a/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5e441a3
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void round_8fdca3() {
+  float2 res = (3.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_8fdca3();
+  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() {
+  round_8fdca3();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_8fdca3();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5e441a3
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void round_8fdca3() {
+  float2 res = (3.0f).xx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_8fdca3();
+  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() {
+  round_8fdca3();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_8fdca3();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.glsl
new file mode 100644
index 0000000..ef15129
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void round_8fdca3() {
+  vec2 res = vec2(3.0f);
+}
+
+vec4 vertex_main() {
+  round_8fdca3();
+  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 round_8fdca3() {
+  vec2 res = vec2(3.0f);
+}
+
+void fragment_main() {
+  round_8fdca3();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void round_8fdca3() {
+  vec2 res = vec2(3.0f);
+}
+
+void compute_main() {
+  round_8fdca3();
+}
+
+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/round/8fdca3.wgsl.expected.msl b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.msl
new file mode 100644
index 0000000..dbffaee
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_8fdca3() {
+  float2 res = float2(3.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  round_8fdca3();
+  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() {
+  round_8fdca3();
+  return;
+}
+
+kernel void compute_main() {
+  round_8fdca3();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.spvasm
new file mode 100644
index 0000000..40ce4a2
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %round_8fdca3 "round_8fdca3"
+               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_3 = OpConstant %float 3
+         %15 = OpConstantComposite %v2float %float_3 %float_3
+%_ptr_Function_v2float = OpTypePointer Function %v2float
+         %18 = OpConstantNull %v2float
+         %19 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+%round_8fdca3 = 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 %round_8fdca3
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %25
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %round_8fdca3
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %round_8fdca3
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.wgsl
new file mode 100644
index 0000000..fbf69dc
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/8fdca3.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn round_8fdca3() {
+  const arg_0 = vec2(3.4);
+  var res = round(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_8fdca3();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_8fdca3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_8fdca3();
+}
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl b/test/tint/builtins/gen/var/round/9078ef.wgsl
index 4ae932d..2b11845 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl
@@ -25,7 +25,7 @@
 
 // fn round(f16) -> f16
 fn round_9078ef() {
-  var arg_0 = 1.h;
+  var arg_0 = 3.4h;
   var res: f16 = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.dxc.hlsl
index 8f39c83..b6e47ac 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_9078ef() {
-  float16_t arg_0 = float16_t(1.0h);
+  float16_t arg_0 = float16_t(3.3984375h);
   float16_t res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.glsl
index ac20d8b..cfcc156 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_9078ef() {
-  float16_t arg_0 = 1.0hf;
+  float16_t arg_0 = 3.3984375hf;
   float16_t res = round(arg_0);
 }
 
@@ -24,7 +24,7 @@
 precision mediump float;
 
 void round_9078ef() {
-  float16_t arg_0 = 1.0hf;
+  float16_t arg_0 = 3.3984375hf;
   float16_t res = round(arg_0);
 }
 
@@ -40,7 +40,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_9078ef() {
-  float16_t arg_0 = 1.0hf;
+  float16_t arg_0 = 3.3984375hf;
   float16_t res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.msl b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.msl
index f4e67a5..83a58d2 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_9078ef() {
-  half arg_0 = 1.0h;
+  half arg_0 = 3.3984375h;
   half res = rint(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.spvasm
index 87ef5e0..a27be47 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.spvasm
@@ -37,7 +37,7 @@
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
-%half_0x1p_0 = OpConstant %half 0x1p+0
+%half_0x1_b3p_1 = OpConstant %half 0x1.b3p+1
 %_ptr_Function_half = OpTypePointer Function %half
          %17 = OpConstantNull %half
          %22 = OpTypeFunction %v4float
@@ -46,7 +46,7 @@
          %12 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_half Function %17
         %res = OpVariable %_ptr_Function_half Function %17
-               OpStore %arg_0 %half_0x1p_0
+               OpStore %arg_0 %half_0x1_b3p_1
          %20 = OpLoad %half %arg_0
          %18 = OpExtInst %half %19 RoundEven %20
                OpStore %res %18
diff --git a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.wgsl
index 15ed50a..56559c6 100644
--- a/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/9078ef.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
 enable f16;
 
 fn round_9078ef() {
-  var arg_0 = 1.0h;
+  var arg_0 = 3.3984375h;
   var res : f16 = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl b/test/tint/builtins/gen/var/round/9edc38.wgsl
index 90a8724..f47bea9 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl
@@ -23,7 +23,7 @@
 
 // fn round(f32) -> f32
 fn round_9edc38() {
-  var arg_0 = 1.f;
+  var arg_0 = 3.4f;
   var res: f32 = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.dxc.hlsl
index f68cfd0..b496960 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_9edc38() {
-  float arg_0 = 1.0f;
+  float arg_0 = 3.400000095f;
   float res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.fxc.hlsl
index f68cfd0..b496960 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.fxc.hlsl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.fxc.hlsl
@@ -1,5 +1,5 @@
 void round_9edc38() {
-  float arg_0 = 1.0f;
+  float arg_0 = 3.400000095f;
   float res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.glsl
index f675870..a149ca8 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.glsl
@@ -1,7 +1,7 @@
 #version 310 es
 
 void round_9edc38() {
-  float arg_0 = 1.0f;
+  float arg_0 = 3.400000095f;
   float res = round(arg_0);
 }
 
@@ -22,7 +22,7 @@
 precision mediump float;
 
 void round_9edc38() {
-  float arg_0 = 1.0f;
+  float arg_0 = 3.400000095f;
   float res = round(arg_0);
 }
 
@@ -37,7 +37,7 @@
 #version 310 es
 
 void round_9edc38() {
-  float arg_0 = 1.0f;
+  float arg_0 = 3.400000095f;
   float res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.msl b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.msl
index bee06fa..4d1f271 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_9edc38() {
-  float arg_0 = 1.0f;
+  float arg_0 = 3.400000095f;
   float res = rint(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.spvasm
index 24731f7..ae3f38d 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
 ; SPIR-V
 ; Version: 1.3
 ; Generator: Google Tint Compiler; 0
-; Bound: 33
+; Bound: 34
 ; Schema: 0
                OpCapability Shader
          %17 = OpExtInstImport "GLSL.std.450"
@@ -32,14 +32,15 @@
 %vertex_point_size = OpVariable %_ptr_Output_float Output %8
        %void = OpTypeVoid
           %9 = OpTypeFunction %void
-    %float_1 = OpConstant %float 1
+%float_3_4000001 = OpConstant %float 3.4000001
 %_ptr_Function_float = OpTypePointer Function %float
          %20 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
 %round_9edc38 = OpFunction %void None %9
          %12 = OpLabel
       %arg_0 = OpVariable %_ptr_Function_float Function %8
         %res = OpVariable %_ptr_Function_float Function %8
-               OpStore %arg_0 %float_1
+               OpStore %arg_0 %float_3_4000001
          %18 = OpLoad %float %arg_0
          %16 = OpExtInst %float %17 RoundEven %18
                OpStore %res %16
@@ -58,12 +59,12 @@
                OpReturn
                OpFunctionEnd
 %fragment_main = OpFunction %void None %9
-         %28 = OpLabel
-         %29 = OpFunctionCall %void %round_9edc38
+         %29 = OpLabel
+         %30 = OpFunctionCall %void %round_9edc38
                OpReturn
                OpFunctionEnd
 %compute_main = OpFunction %void None %9
-         %31 = OpLabel
-         %32 = OpFunctionCall %void %round_9edc38
+         %32 = OpLabel
+         %33 = OpFunctionCall %void %round_9edc38
                OpReturn
                OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.wgsl
index f41cc78..3141c24 100644
--- a/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/9edc38.wgsl.expected.wgsl
@@ -1,5 +1,5 @@
 fn round_9edc38() {
-  var arg_0 = 1.0f;
+  var arg_0 = 3.400000095f;
   var res : f32 = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/a1673d.wgsl b/test/tint/builtins/gen/var/round/a1673d.wgsl
new file mode 100644
index 0000000..03a7407
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/a1673d.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 round(vec<3, fa>) -> vec<3, fa>
+fn round_a1673d() {
+  const arg_0 = vec3(3.4);
+  var res = round(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_a1673d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_a1673d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_a1673d();
+}
diff --git a/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4032312
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,30 @@
+void round_a1673d() {
+  float3 res = (3.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_a1673d();
+  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() {
+  round_a1673d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_a1673d();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4032312
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,30 @@
+void round_a1673d() {
+  float3 res = (3.0f).xxx;
+}
+
+struct tint_symbol {
+  float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+  round_a1673d();
+  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() {
+  round_a1673d();
+  return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+  round_a1673d();
+  return;
+}
diff --git a/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.glsl
new file mode 100644
index 0000000..0a8db5f
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.glsl
@@ -0,0 +1,49 @@
+#version 310 es
+
+void round_a1673d() {
+  vec3 res = vec3(3.0f);
+}
+
+vec4 vertex_main() {
+  round_a1673d();
+  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 round_a1673d() {
+  vec3 res = vec3(3.0f);
+}
+
+void fragment_main() {
+  round_a1673d();
+}
+
+void main() {
+  fragment_main();
+  return;
+}
+#version 310 es
+
+void round_a1673d() {
+  vec3 res = vec3(3.0f);
+}
+
+void compute_main() {
+  round_a1673d();
+}
+
+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/round/a1673d.wgsl.expected.msl b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.msl
new file mode 100644
index 0000000..e9b35bb
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void round_a1673d() {
+  float3 res = float3(3.0f);
+}
+
+struct tint_symbol {
+  float4 value [[position]];
+};
+
+float4 vertex_main_inner() {
+  round_a1673d();
+  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() {
+  round_a1673d();
+  return;
+}
+
+kernel void compute_main() {
+  round_a1673d();
+  return;
+}
+
diff --git a/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.spvasm
new file mode 100644
index 0000000..e9bbf2e
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.spvasm
@@ -0,0 +1,67 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 33
+; Schema: 0
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+               OpEntryPoint Fragment %fragment_main "fragment_main"
+               OpEntryPoint GLCompute %compute_main "compute_main"
+               OpExecutionMode %fragment_main OriginUpperLeft
+               OpExecutionMode %compute_main LocalSize 1 1 1
+               OpName %value "value"
+               OpName %vertex_point_size "vertex_point_size"
+               OpName %round_a1673d "round_a1673d"
+               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_3 = OpConstant %float 3
+         %15 = OpConstantComposite %v3float %float_3 %float_3 %float_3
+%_ptr_Function_v3float = OpTypePointer Function %v3float
+         %18 = OpConstantNull %v3float
+         %19 = OpTypeFunction %v4float
+    %float_1 = OpConstant %float 1
+%round_a1673d = 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 %round_a1673d
+               OpReturnValue %5
+               OpFunctionEnd
+%vertex_main = OpFunction %void None %9
+         %24 = OpLabel
+         %25 = OpFunctionCall %v4float %vertex_main_inner
+               OpStore %value %25
+               OpStore %vertex_point_size %float_1
+               OpReturn
+               OpFunctionEnd
+%fragment_main = OpFunction %void None %9
+         %28 = OpLabel
+         %29 = OpFunctionCall %void %round_a1673d
+               OpReturn
+               OpFunctionEnd
+%compute_main = OpFunction %void None %9
+         %31 = OpLabel
+         %32 = OpFunctionCall %void %round_a1673d
+               OpReturn
+               OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.wgsl
new file mode 100644
index 0000000..4adb295
--- /dev/null
+++ b/test/tint/builtins/gen/var/round/a1673d.wgsl.expected.wgsl
@@ -0,0 +1,20 @@
+fn round_a1673d() {
+  const arg_0 = vec3(3.4);
+  var res = round(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+  round_a1673d();
+  return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+  round_a1673d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+  round_a1673d();
+}
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl b/test/tint/builtins/gen/var/round/d87e84.wgsl
index 6222d31..b7459b8 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl
@@ -25,7 +25,7 @@
 
 // fn round(vec<2, f16>) -> vec<2, f16>
 fn round_d87e84() {
-  var arg_0 = vec2<f16>(1.h);
+  var arg_0 = vec2<f16>(3.4h);
   var res: vec2<f16> = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.dxc.hlsl
index e72f501..38e6732 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_d87e84() {
-  vector<float16_t, 2> arg_0 = (float16_t(1.0h)).xx;
+  vector<float16_t, 2> arg_0 = (float16_t(3.3984375h)).xx;
   vector<float16_t, 2> res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.glsl
index d6b52fb..7b7d705 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_d87e84() {
-  f16vec2 arg_0 = f16vec2(1.0hf);
+  f16vec2 arg_0 = f16vec2(3.3984375hf);
   f16vec2 res = round(arg_0);
 }
 
@@ -24,7 +24,7 @@
 precision mediump float;
 
 void round_d87e84() {
-  f16vec2 arg_0 = f16vec2(1.0hf);
+  f16vec2 arg_0 = f16vec2(3.3984375hf);
   f16vec2 res = round(arg_0);
 }
 
@@ -40,7 +40,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_d87e84() {
-  f16vec2 arg_0 = f16vec2(1.0hf);
+  f16vec2 arg_0 = f16vec2(3.3984375hf);
   f16vec2 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.msl b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.msl
index 9fb5419..45fbfa2 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_d87e84() {
-  half2 arg_0 = half2(1.0h);
+  half2 arg_0 = half2(3.3984375h);
   half2 res = rint(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.spvasm
index ff7f597..691319f 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.spvasm
@@ -38,8 +38,8 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v2half = OpTypeVector %half 2
-%half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v2half %half_0x1p_0 %half_0x1p_0
+%half_0x1_b3p_1 = OpConstant %half 0x1.b3p+1
+         %16 = OpConstantComposite %v2half %half_0x1_b3p_1 %half_0x1_b3p_1
 %_ptr_Function_v2half = OpTypePointer Function %v2half
          %19 = OpConstantNull %v2half
          %24 = OpTypeFunction %v4float
diff --git a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.wgsl
index b656f4b..3732bd7 100644
--- a/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/d87e84.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
 enable f16;
 
 fn round_d87e84() {
-  var arg_0 = vec2<f16>(1.0h);
+  var arg_0 = vec2<f16>(3.3984375h);
   var res : vec2<f16> = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl b/test/tint/builtins/gen/var/round/e1bba2.wgsl
index acf1e62..5c666ae 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl
@@ -25,7 +25,7 @@
 
 // fn round(vec<3, f16>) -> vec<3, f16>
 fn round_e1bba2() {
-  var arg_0 = vec3<f16>(1.h);
+  var arg_0 = vec3<f16>(3.4h);
   var res: vec3<f16> = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.dxc.hlsl
index 09aae22..2c1a7e7 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_e1bba2() {
-  vector<float16_t, 3> arg_0 = (float16_t(1.0h)).xxx;
+  vector<float16_t, 3> arg_0 = (float16_t(3.3984375h)).xxx;
   vector<float16_t, 3> res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.glsl
index 0692769..79a642b 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_e1bba2() {
-  f16vec3 arg_0 = f16vec3(1.0hf);
+  f16vec3 arg_0 = f16vec3(3.3984375hf);
   f16vec3 res = round(arg_0);
 }
 
@@ -24,7 +24,7 @@
 precision mediump float;
 
 void round_e1bba2() {
-  f16vec3 arg_0 = f16vec3(1.0hf);
+  f16vec3 arg_0 = f16vec3(3.3984375hf);
   f16vec3 res = round(arg_0);
 }
 
@@ -40,7 +40,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_e1bba2() {
-  f16vec3 arg_0 = f16vec3(1.0hf);
+  f16vec3 arg_0 = f16vec3(3.3984375hf);
   f16vec3 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.msl b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.msl
index e16a543..d67c97b 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_e1bba2() {
-  half3 arg_0 = half3(1.0h);
+  half3 arg_0 = half3(3.3984375h);
   half3 res = rint(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.spvasm
index 8e954d4..ecba2f9 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.spvasm
@@ -38,8 +38,8 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v3half = OpTypeVector %half 3
-%half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v3half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+%half_0x1_b3p_1 = OpConstant %half 0x1.b3p+1
+         %16 = OpConstantComposite %v3half %half_0x1_b3p_1 %half_0x1_b3p_1 %half_0x1_b3p_1
 %_ptr_Function_v3half = OpTypePointer Function %v3half
          %19 = OpConstantNull %v3half
          %24 = OpTypeFunction %v4float
diff --git a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.wgsl
index 05487ef..a4bc2f2 100644
--- a/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/e1bba2.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
 enable f16;
 
 fn round_e1bba2() {
-  var arg_0 = vec3<f16>(1.0h);
+  var arg_0 = vec3<f16>(3.3984375h);
   var res : vec3<f16> = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl b/test/tint/builtins/gen/var/round/f665b5.wgsl
index 317440f..34ce7cc 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl
@@ -25,7 +25,7 @@
 
 // fn round(vec<4, f16>) -> vec<4, f16>
 fn round_f665b5() {
-  var arg_0 = vec4<f16>(1.h);
+  var arg_0 = vec4<f16>(3.4h);
   var res: vec4<f16> = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.dxc.hlsl
index 169bed8..1bcedeb 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.dxc.hlsl
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.dxc.hlsl
@@ -1,5 +1,5 @@
 void round_f665b5() {
-  vector<float16_t, 4> arg_0 = (float16_t(1.0h)).xxxx;
+  vector<float16_t, 4> arg_0 = (float16_t(3.3984375h)).xxxx;
   vector<float16_t, 4> res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.glsl b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.glsl
index a9df115..853570f 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.glsl
@@ -2,7 +2,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_f665b5() {
-  f16vec4 arg_0 = f16vec4(1.0hf);
+  f16vec4 arg_0 = f16vec4(3.3984375hf);
   f16vec4 res = round(arg_0);
 }
 
@@ -24,7 +24,7 @@
 precision mediump float;
 
 void round_f665b5() {
-  f16vec4 arg_0 = f16vec4(1.0hf);
+  f16vec4 arg_0 = f16vec4(3.3984375hf);
   f16vec4 res = round(arg_0);
 }
 
@@ -40,7 +40,7 @@
 #extension GL_AMD_gpu_shader_half_float : require
 
 void round_f665b5() {
-  f16vec4 arg_0 = f16vec4(1.0hf);
+  f16vec4 arg_0 = f16vec4(3.3984375hf);
   f16vec4 res = round(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.msl b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.msl
index 0334eae..dafb10b 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.msl
@@ -2,7 +2,7 @@
 
 using namespace metal;
 void round_f665b5() {
-  half4 arg_0 = half4(1.0h);
+  half4 arg_0 = half4(3.3984375h);
   half4 res = rint(arg_0);
 }
 
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.spvasm
index 225b5f2..4e352ff 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.spvasm
@@ -38,8 +38,8 @@
           %9 = OpTypeFunction %void
        %half = OpTypeFloat 16
      %v4half = OpTypeVector %half 4
-%half_0x1p_0 = OpConstant %half 0x1p+0
-         %16 = OpConstantComposite %v4half %half_0x1p_0 %half_0x1p_0 %half_0x1p_0 %half_0x1p_0
+%half_0x1_b3p_1 = OpConstant %half 0x1.b3p+1
+         %16 = OpConstantComposite %v4half %half_0x1_b3p_1 %half_0x1_b3p_1 %half_0x1_b3p_1 %half_0x1_b3p_1
 %_ptr_Function_v4half = OpTypePointer Function %v4half
          %19 = OpConstantNull %v4half
          %24 = OpTypeFunction %v4float
diff --git a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.wgsl
index a4fd853..89020d0 100644
--- a/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.wgsl
+++ b/test/tint/builtins/gen/var/round/f665b5.wgsl.expected.wgsl
@@ -1,7 +1,7 @@
 enable f16;
 
 fn round_f665b5() {
-  var arg_0 = vec4<f16>(1.0h);
+  var arg_0 = vec4<f16>(3.3984375h);
   var res : vec4<f16> = round(arg_0);
 }