GLSL: implement reverseBits().

Bug: tint:1431
Change-Id: I816ce26e98705f459e2fbc652d06d6fc97bab7fb
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/82141
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
diff --git a/src/tint/writer/glsl/generator_impl.cc b/src/tint/writer/glsl/generator_impl.cc
index 5ebeeb7..3291c76 100644
--- a/src/tint/writer/glsl/generator_impl.cc
+++ b/src/tint/writer/glsl/generator_impl.cc
@@ -580,9 +580,6 @@
   if (builtin->IsTexture()) {
     return EmitTextureCall(out, call, builtin);
   }
-  if (builtin->Type() == sem::BuiltinType::kCountOneBits) {
-    return EmitCountOneBitsCall(out, expr);
-  }
   if (builtin->Type() == sem::BuiltinType::kSelect) {
     return EmitSelectCall(out, expr);
   }
@@ -862,23 +859,6 @@
   return true;
 }
 
-bool GeneratorImpl::EmitCountOneBitsCall(std::ostream& out,
-                                         const ast::CallExpression* expr) {
-  // GLSL's bitCount returns an integer type, so cast it to the appropriate
-  // unsigned type.
-  if (!EmitType(out, TypeOf(expr)->UnwrapRef(), ast::StorageClass::kNone,
-                ast::Access::kReadWrite, "")) {
-    return false;
-  }
-  out << "(bitCount(";
-
-  if (!EmitExpression(out, expr->args[0])) {
-    return false;
-  }
-  out << "))";
-  return true;
-}
-
 bool GeneratorImpl::EmitSelectCall(std::ostream& out,
                                    const ast::CallExpression* expr) {
   auto* expr_false = expr->args[0];
@@ -1609,7 +1589,7 @@
     case sem::BuiltinType::kAtan2:
       return "atan";
     case sem::BuiltinType::kCountOneBits:
-      return "bitCount";
+      return "countbits";
     case sem::BuiltinType::kDpdx:
       return "ddx";
     case sem::BuiltinType::kDpdxCoarse:
@@ -1643,7 +1623,7 @@
     case sem::BuiltinType::kMix:
       return "mix";
     case sem::BuiltinType::kReverseBits:
-      return "reversebits";
+      return "bitfieldReverse";
     case sem::BuiltinType::kSmoothStep:
       return "smoothstep";
     default:
diff --git a/src/tint/writer/glsl/generator_impl.h b/src/tint/writer/glsl/generator_impl.h
index 8bfebbc..5fa94f9 100644
--- a/src/tint/writer/glsl/generator_impl.h
+++ b/src/tint/writer/glsl/generator_impl.h
@@ -194,11 +194,6 @@
   /// @param out the output of the expression stream
   /// @param expr the call expression
   /// @returns true if the call expression is emitted
-  bool EmitCountOneBitsCall(std::ostream& out, const ast::CallExpression* expr);
-  /// Handles generating a call to the `countOneBits()` builtin
-  /// @param out the output of the expression stream
-  /// @param expr the call expression
-  /// @returns true if the call expression is emitted
   bool EmitSelectCall(std::ostream& out, const ast::CallExpression* expr);
   /// Handles generating a call to the `dot()` builtin
   /// @param out the output of the expression stream
diff --git a/src/tint/writer/glsl/generator_impl_builtin_test.cc b/src/tint/writer/glsl/generator_impl_builtin_test.cc
index 2de2f85..d7bd64a 100644
--- a/src/tint/writer/glsl/generator_impl_builtin_test.cc
+++ b/src/tint/writer/glsl/generator_impl_builtin_test.cc
@@ -198,7 +198,7 @@
         BuiltinData{BuiltinType::kClamp, ParamType::kU32, "clamp"},
         BuiltinData{BuiltinType::kCos, ParamType::kF32, "cos"},
         BuiltinData{BuiltinType::kCosh, ParamType::kF32, "cosh"},
-        BuiltinData{BuiltinType::kCountOneBits, ParamType::kU32, "bitCount"},
+        BuiltinData{BuiltinType::kCountOneBits, ParamType::kU32, "countbits"},
         BuiltinData{BuiltinType::kCross, ParamType::kF32, "cross"},
         BuiltinData{BuiltinType::kDeterminant, ParamType::kF32, "determinant"},
         BuiltinData{BuiltinType::kDistance, ParamType::kF32, "distance"},
@@ -234,7 +234,8 @@
         BuiltinData{BuiltinType::kNormalize, ParamType::kF32, "normalize"},
         BuiltinData{BuiltinType::kPow, ParamType::kF32, "pow"},
         BuiltinData{BuiltinType::kReflect, ParamType::kF32, "reflect"},
-        BuiltinData{BuiltinType::kReverseBits, ParamType::kU32, "reversebits"},
+        BuiltinData{BuiltinType::kReverseBits, ParamType::kU32,
+                    "bitfieldReverse"},
         BuiltinData{BuiltinType::kRound, ParamType::kU32, "round"},
         BuiltinData{BuiltinType::kSign, ParamType::kF32, "sign"},
         BuiltinData{BuiltinType::kSin, ParamType::kF32, "sin"},
diff --git a/test/tint/builtins/gen/countOneBits/0d0e46.wgsl.expected.glsl b/test/tint/builtins/gen/countOneBits/0d0e46.wgsl.expected.glsl
index 11f62b4..bf9a227 100644
--- a/test/tint/builtins/gen/countOneBits/0d0e46.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/countOneBits/0d0e46.wgsl.expected.glsl
@@ -1,7 +1,9 @@
+SKIP: FAILED
+
 #version 310 es
 
 void countOneBits_0d0e46() {
-  uvec4 res = uvec4(bitCount(uvec4(0u, 0u, 0u, 0u)));
+  uvec4 res = countbits(uvec4(0u, 0u, 0u, 0u));
 }
 
 vec4 vertex_main() {
@@ -16,11 +18,19 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 4-component vector of uint'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 precision mediump float;
 
 void countOneBits_0d0e46() {
-  uvec4 res = uvec4(bitCount(uvec4(0u, 0u, 0u, 0u)));
+  uvec4 res = countbits(uvec4(0u, 0u, 0u, 0u));
 }
 
 void fragment_main() {
@@ -31,10 +41,18 @@
   fragment_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:5: 'countbits' : no matching overloaded function found 
+ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 4-component vector of uint'
+ERROR: 0:5: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 
 void countOneBits_0d0e46() {
-  uvec4 res = uvec4(bitCount(uvec4(0u, 0u, 0u, 0u)));
+  uvec4 res = countbits(uvec4(0u, 0u, 0u, 0u));
 }
 
 void compute_main() {
@@ -46,3 +64,11 @@
   compute_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 4-component vector of uint'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/countOneBits/0f7980.wgsl.expected.glsl b/test/tint/builtins/gen/countOneBits/0f7980.wgsl.expected.glsl
index 2dafae1..d4e690c 100644
--- a/test/tint/builtins/gen/countOneBits/0f7980.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/countOneBits/0f7980.wgsl.expected.glsl
@@ -1,7 +1,9 @@
+SKIP: FAILED
+
 #version 310 es
 
 void countOneBits_0f7980() {
-  ivec4 res = ivec4(bitCount(ivec4(0, 0, 0, 0)));
+  ivec4 res = countbits(ivec4(0, 0, 0, 0));
 }
 
 vec4 vertex_main() {
@@ -16,11 +18,19 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 4-component vector of int'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 precision mediump float;
 
 void countOneBits_0f7980() {
-  ivec4 res = ivec4(bitCount(ivec4(0, 0, 0, 0)));
+  ivec4 res = countbits(ivec4(0, 0, 0, 0));
 }
 
 void fragment_main() {
@@ -31,10 +41,18 @@
   fragment_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:5: 'countbits' : no matching overloaded function found 
+ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 4-component vector of int'
+ERROR: 0:5: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 
 void countOneBits_0f7980() {
-  ivec4 res = ivec4(bitCount(ivec4(0, 0, 0, 0)));
+  ivec4 res = countbits(ivec4(0, 0, 0, 0));
 }
 
 void compute_main() {
@@ -46,3 +64,11 @@
   compute_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 4-component vector of int'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/countOneBits/65d2ae.wgsl.expected.glsl b/test/tint/builtins/gen/countOneBits/65d2ae.wgsl.expected.glsl
index abdbb04..2f4d946 100644
--- a/test/tint/builtins/gen/countOneBits/65d2ae.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/countOneBits/65d2ae.wgsl.expected.glsl
@@ -1,7 +1,9 @@
+SKIP: FAILED
+
 #version 310 es
 
 void countOneBits_65d2ae() {
-  ivec3 res = ivec3(bitCount(ivec3(0, 0, 0)));
+  ivec3 res = countbits(ivec3(0, 0, 0));
 }
 
 vec4 vertex_main() {
@@ -16,11 +18,19 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 3-component vector of int'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 precision mediump float;
 
 void countOneBits_65d2ae() {
-  ivec3 res = ivec3(bitCount(ivec3(0, 0, 0)));
+  ivec3 res = countbits(ivec3(0, 0, 0));
 }
 
 void fragment_main() {
@@ -31,10 +41,18 @@
   fragment_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:5: 'countbits' : no matching overloaded function found 
+ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 3-component vector of int'
+ERROR: 0:5: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 
 void countOneBits_65d2ae() {
-  ivec3 res = ivec3(bitCount(ivec3(0, 0, 0)));
+  ivec3 res = countbits(ivec3(0, 0, 0));
 }
 
 void compute_main() {
@@ -46,3 +64,11 @@
   compute_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 3-component vector of int'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/countOneBits/690cfc.wgsl.expected.glsl b/test/tint/builtins/gen/countOneBits/690cfc.wgsl.expected.glsl
index 95e26f1..80fbd03 100644
--- a/test/tint/builtins/gen/countOneBits/690cfc.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/countOneBits/690cfc.wgsl.expected.glsl
@@ -1,7 +1,9 @@
+SKIP: FAILED
+
 #version 310 es
 
 void countOneBits_690cfc() {
-  uvec3 res = uvec3(bitCount(uvec3(0u, 0u, 0u)));
+  uvec3 res = countbits(uvec3(0u, 0u, 0u));
 }
 
 vec4 vertex_main() {
@@ -16,11 +18,19 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 3-component vector of uint'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 precision mediump float;
 
 void countOneBits_690cfc() {
-  uvec3 res = uvec3(bitCount(uvec3(0u, 0u, 0u)));
+  uvec3 res = countbits(uvec3(0u, 0u, 0u));
 }
 
 void fragment_main() {
@@ -31,10 +41,18 @@
   fragment_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:5: 'countbits' : no matching overloaded function found 
+ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 3-component vector of uint'
+ERROR: 0:5: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 
 void countOneBits_690cfc() {
-  uvec3 res = uvec3(bitCount(uvec3(0u, 0u, 0u)));
+  uvec3 res = countbits(uvec3(0u, 0u, 0u));
 }
 
 void compute_main() {
@@ -46,3 +64,11 @@
   compute_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 3-component vector of uint'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/countOneBits/94fd81.wgsl.expected.glsl b/test/tint/builtins/gen/countOneBits/94fd81.wgsl.expected.glsl
index 214e0d9..f4d3c55 100644
--- a/test/tint/builtins/gen/countOneBits/94fd81.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/countOneBits/94fd81.wgsl.expected.glsl
@@ -1,7 +1,9 @@
+SKIP: FAILED
+
 #version 310 es
 
 void countOneBits_94fd81() {
-  uvec2 res = uvec2(bitCount(uvec2(0u, 0u)));
+  uvec2 res = countbits(uvec2(0u, 0u));
 }
 
 vec4 vertex_main() {
@@ -16,11 +18,19 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of uint'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 precision mediump float;
 
 void countOneBits_94fd81() {
-  uvec2 res = uvec2(bitCount(uvec2(0u, 0u)));
+  uvec2 res = countbits(uvec2(0u, 0u));
 }
 
 void fragment_main() {
@@ -31,10 +41,18 @@
   fragment_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:5: 'countbits' : no matching overloaded function found 
+ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 2-component vector of uint'
+ERROR: 0:5: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 
 void countOneBits_94fd81() {
-  uvec2 res = uvec2(bitCount(uvec2(0u, 0u)));
+  uvec2 res = countbits(uvec2(0u, 0u));
 }
 
 void compute_main() {
@@ -46,3 +64,11 @@
   compute_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of uint'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/countOneBits/ae44f9.wgsl.expected.glsl b/test/tint/builtins/gen/countOneBits/ae44f9.wgsl.expected.glsl
index cf72302..6d26ecd 100644
--- a/test/tint/builtins/gen/countOneBits/ae44f9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/countOneBits/ae44f9.wgsl.expected.glsl
@@ -1,7 +1,9 @@
+SKIP: FAILED
+
 #version 310 es
 
 void countOneBits_ae44f9() {
-  uint res = uint(bitCount(1u));
+  uint res = countbits(1u);
 }
 
 vec4 vertex_main() {
@@ -16,11 +18,19 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp uint'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 precision mediump float;
 
 void countOneBits_ae44f9() {
-  uint res = uint(bitCount(1u));
+  uint res = countbits(1u);
 }
 
 void fragment_main() {
@@ -31,10 +41,18 @@
   fragment_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:5: 'countbits' : no matching overloaded function found 
+ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump uint'
+ERROR: 0:5: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 
 void countOneBits_ae44f9() {
-  uint res = uint(bitCount(1u));
+  uint res = countbits(1u);
 }
 
 void compute_main() {
@@ -46,3 +64,11 @@
   compute_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp uint'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/countOneBits/af90e2.wgsl.expected.glsl b/test/tint/builtins/gen/countOneBits/af90e2.wgsl.expected.glsl
index 2e87592..13673ed 100644
--- a/test/tint/builtins/gen/countOneBits/af90e2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/countOneBits/af90e2.wgsl.expected.glsl
@@ -1,7 +1,9 @@
+SKIP: FAILED
+
 #version 310 es
 
 void countOneBits_af90e2() {
-  ivec2 res = ivec2(bitCount(ivec2(0, 0)));
+  ivec2 res = countbits(ivec2(0, 0));
 }
 
 vec4 vertex_main() {
@@ -16,11 +18,19 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of int'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 precision mediump float;
 
 void countOneBits_af90e2() {
-  ivec2 res = ivec2(bitCount(ivec2(0, 0)));
+  ivec2 res = countbits(ivec2(0, 0));
 }
 
 void fragment_main() {
@@ -31,10 +41,18 @@
   fragment_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:5: 'countbits' : no matching overloaded function found 
+ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 2-component vector of int'
+ERROR: 0:5: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 
 void countOneBits_af90e2() {
-  ivec2 res = ivec2(bitCount(ivec2(0, 0)));
+  ivec2 res = countbits(ivec2(0, 0));
 }
 
 void compute_main() {
@@ -46,3 +64,11 @@
   compute_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of int'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/countOneBits/fd88b2.wgsl.expected.glsl b/test/tint/builtins/gen/countOneBits/fd88b2.wgsl.expected.glsl
index bf825f0..22f32fc 100644
--- a/test/tint/builtins/gen/countOneBits/fd88b2.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/countOneBits/fd88b2.wgsl.expected.glsl
@@ -1,7 +1,9 @@
+SKIP: FAILED
+
 #version 310 es
 
 void countOneBits_fd88b2() {
-  int res = int(bitCount(1));
+  int res = countbits(1);
 }
 
 vec4 vertex_main() {
@@ -16,11 +18,19 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp int'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 precision mediump float;
 
 void countOneBits_fd88b2() {
-  int res = int(bitCount(1));
+  int res = countbits(1);
 }
 
 void fragment_main() {
@@ -31,10 +41,18 @@
   fragment_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:5: 'countbits' : no matching overloaded function found 
+ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump int'
+ERROR: 0:5: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
 #version 310 es
 
 void countOneBits_fd88b2() {
-  int res = int(bitCount(1));
+  int res = countbits(1);
 }
 
 void compute_main() {
@@ -46,3 +64,11 @@
   compute_main();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:4: 'countbits' : no matching overloaded function found 
+ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp int'
+ERROR: 0:4: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/reverseBits/222177.wgsl.expected.glsl b/test/tint/builtins/gen/reverseBits/222177.wgsl.expected.glsl
index 38d027f..d4679f8 100644
--- a/test/tint/builtins/gen/reverseBits/222177.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/reverseBits/222177.wgsl.expected.glsl
@@ -1,9 +1,7 @@
-SKIP: FAILED
-
 #version 310 es
 
 void reverseBits_222177() {
-  ivec2 res = reversebits(ivec2(0, 0));
+  ivec2 res = bitfieldReverse(ivec2(0, 0));
 }
 
 vec4 vertex_main() {
@@ -18,19 +16,11 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of int'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 precision mediump float;
 
 void reverseBits_222177() {
-  ivec2 res = reversebits(ivec2(0, 0));
+  ivec2 res = bitfieldReverse(ivec2(0, 0));
 }
 
 void fragment_main() {
@@ -41,18 +31,10 @@
   fragment_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:5: 'reversebits' : no matching overloaded function found 
-ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 2-component vector of int'
-ERROR: 0:5: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 
 void reverseBits_222177() {
-  ivec2 res = reversebits(ivec2(0, 0));
+  ivec2 res = bitfieldReverse(ivec2(0, 0));
 }
 
 void compute_main() {
@@ -64,11 +46,3 @@
   compute_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of int'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/reverseBits/35fea9.wgsl.expected.glsl b/test/tint/builtins/gen/reverseBits/35fea9.wgsl.expected.glsl
index dba2f0b..c335cae 100644
--- a/test/tint/builtins/gen/reverseBits/35fea9.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/reverseBits/35fea9.wgsl.expected.glsl
@@ -1,9 +1,7 @@
-SKIP: FAILED
-
 #version 310 es
 
 void reverseBits_35fea9() {
-  uvec4 res = reversebits(uvec4(0u, 0u, 0u, 0u));
+  uvec4 res = bitfieldReverse(uvec4(0u, 0u, 0u, 0u));
 }
 
 vec4 vertex_main() {
@@ -18,19 +16,11 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 4-component vector of uint'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 precision mediump float;
 
 void reverseBits_35fea9() {
-  uvec4 res = reversebits(uvec4(0u, 0u, 0u, 0u));
+  uvec4 res = bitfieldReverse(uvec4(0u, 0u, 0u, 0u));
 }
 
 void fragment_main() {
@@ -41,18 +31,10 @@
   fragment_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:5: 'reversebits' : no matching overloaded function found 
-ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 4-component vector of uint'
-ERROR: 0:5: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 
 void reverseBits_35fea9() {
-  uvec4 res = reversebits(uvec4(0u, 0u, 0u, 0u));
+  uvec4 res = bitfieldReverse(uvec4(0u, 0u, 0u, 0u));
 }
 
 void compute_main() {
@@ -64,11 +46,3 @@
   compute_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 4-component vector of uint'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/reverseBits/4dbd6f.wgsl.expected.glsl b/test/tint/builtins/gen/reverseBits/4dbd6f.wgsl.expected.glsl
index 0bd7700..24ac6b4 100644
--- a/test/tint/builtins/gen/reverseBits/4dbd6f.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/reverseBits/4dbd6f.wgsl.expected.glsl
@@ -1,9 +1,7 @@
-SKIP: FAILED
-
 #version 310 es
 
 void reverseBits_4dbd6f() {
-  ivec4 res = reversebits(ivec4(0, 0, 0, 0));
+  ivec4 res = bitfieldReverse(ivec4(0, 0, 0, 0));
 }
 
 vec4 vertex_main() {
@@ -18,19 +16,11 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 4-component vector of int'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 precision mediump float;
 
 void reverseBits_4dbd6f() {
-  ivec4 res = reversebits(ivec4(0, 0, 0, 0));
+  ivec4 res = bitfieldReverse(ivec4(0, 0, 0, 0));
 }
 
 void fragment_main() {
@@ -41,18 +31,10 @@
   fragment_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:5: 'reversebits' : no matching overloaded function found 
-ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 4-component vector of int'
-ERROR: 0:5: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 
 void reverseBits_4dbd6f() {
-  ivec4 res = reversebits(ivec4(0, 0, 0, 0));
+  ivec4 res = bitfieldReverse(ivec4(0, 0, 0, 0));
 }
 
 void compute_main() {
@@ -64,11 +46,3 @@
   compute_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 4-component vector of int'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/reverseBits/7c4269.wgsl.expected.glsl b/test/tint/builtins/gen/reverseBits/7c4269.wgsl.expected.glsl
index be1c701..d40be46 100644
--- a/test/tint/builtins/gen/reverseBits/7c4269.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/reverseBits/7c4269.wgsl.expected.glsl
@@ -1,9 +1,7 @@
-SKIP: FAILED
-
 #version 310 es
 
 void reverseBits_7c4269() {
-  int res = reversebits(1);
+  int res = bitfieldReverse(1);
 }
 
 vec4 vertex_main() {
@@ -18,19 +16,11 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 precision mediump float;
 
 void reverseBits_7c4269() {
-  int res = reversebits(1);
+  int res = bitfieldReverse(1);
 }
 
 void fragment_main() {
@@ -41,18 +31,10 @@
   fragment_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:5: 'reversebits' : no matching overloaded function found 
-ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:5: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 
 void reverseBits_7c4269() {
-  int res = reversebits(1);
+  int res = bitfieldReverse(1);
 }
 
 void compute_main() {
@@ -64,11 +46,3 @@
   compute_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/reverseBits/a6ccd4.wgsl.expected.glsl b/test/tint/builtins/gen/reverseBits/a6ccd4.wgsl.expected.glsl
index 0458f71..553bad2 100644
--- a/test/tint/builtins/gen/reverseBits/a6ccd4.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/reverseBits/a6ccd4.wgsl.expected.glsl
@@ -1,9 +1,7 @@
-SKIP: FAILED
-
 #version 310 es
 
 void reverseBits_a6ccd4() {
-  uvec3 res = reversebits(uvec3(0u, 0u, 0u));
+  uvec3 res = bitfieldReverse(uvec3(0u, 0u, 0u));
 }
 
 vec4 vertex_main() {
@@ -18,19 +16,11 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 3-component vector of uint'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 precision mediump float;
 
 void reverseBits_a6ccd4() {
-  uvec3 res = reversebits(uvec3(0u, 0u, 0u));
+  uvec3 res = bitfieldReverse(uvec3(0u, 0u, 0u));
 }
 
 void fragment_main() {
@@ -41,18 +31,10 @@
   fragment_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:5: 'reversebits' : no matching overloaded function found 
-ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 3-component vector of uint'
-ERROR: 0:5: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 
 void reverseBits_a6ccd4() {
-  uvec3 res = reversebits(uvec3(0u, 0u, 0u));
+  uvec3 res = bitfieldReverse(uvec3(0u, 0u, 0u));
 }
 
 void compute_main() {
@@ -64,11 +46,3 @@
   compute_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 3-component vector of uint'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/reverseBits/c21bc1.wgsl.expected.glsl b/test/tint/builtins/gen/reverseBits/c21bc1.wgsl.expected.glsl
index a595a34..6a6cc5a 100644
--- a/test/tint/builtins/gen/reverseBits/c21bc1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/reverseBits/c21bc1.wgsl.expected.glsl
@@ -1,9 +1,7 @@
-SKIP: FAILED
-
 #version 310 es
 
 void reverseBits_c21bc1() {
-  ivec3 res = reversebits(ivec3(0, 0, 0));
+  ivec3 res = bitfieldReverse(ivec3(0, 0, 0));
 }
 
 vec4 vertex_main() {
@@ -18,19 +16,11 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 3-component vector of int'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 precision mediump float;
 
 void reverseBits_c21bc1() {
-  ivec3 res = reversebits(ivec3(0, 0, 0));
+  ivec3 res = bitfieldReverse(ivec3(0, 0, 0));
 }
 
 void fragment_main() {
@@ -41,18 +31,10 @@
   fragment_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:5: 'reversebits' : no matching overloaded function found 
-ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 3-component vector of int'
-ERROR: 0:5: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 
 void reverseBits_c21bc1() {
-  ivec3 res = reversebits(ivec3(0, 0, 0));
+  ivec3 res = bitfieldReverse(ivec3(0, 0, 0));
 }
 
 void compute_main() {
@@ -64,11 +46,3 @@
   compute_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 3-component vector of int'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/reverseBits/e1f4c1.wgsl.expected.glsl b/test/tint/builtins/gen/reverseBits/e1f4c1.wgsl.expected.glsl
index b9e7aa6..8bbfbcb 100644
--- a/test/tint/builtins/gen/reverseBits/e1f4c1.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/reverseBits/e1f4c1.wgsl.expected.glsl
@@ -1,9 +1,7 @@
-SKIP: FAILED
-
 #version 310 es
 
 void reverseBits_e1f4c1() {
-  uvec2 res = reversebits(uvec2(0u, 0u));
+  uvec2 res = bitfieldReverse(uvec2(0u, 0u));
 }
 
 vec4 vertex_main() {
@@ -18,19 +16,11 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of uint'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 precision mediump float;
 
 void reverseBits_e1f4c1() {
-  uvec2 res = reversebits(uvec2(0u, 0u));
+  uvec2 res = bitfieldReverse(uvec2(0u, 0u));
 }
 
 void fragment_main() {
@@ -41,18 +31,10 @@
   fragment_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:5: 'reversebits' : no matching overloaded function found 
-ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump 2-component vector of uint'
-ERROR: 0:5: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 
 void reverseBits_e1f4c1() {
-  uvec2 res = reversebits(uvec2(0u, 0u));
+  uvec2 res = bitfieldReverse(uvec2(0u, 0u));
 }
 
 void compute_main() {
@@ -64,11 +46,3 @@
   compute_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of uint'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/reverseBits/e31adf.wgsl.expected.glsl b/test/tint/builtins/gen/reverseBits/e31adf.wgsl.expected.glsl
index 9e0c292..6755536 100644
--- a/test/tint/builtins/gen/reverseBits/e31adf.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/reverseBits/e31adf.wgsl.expected.glsl
@@ -1,9 +1,7 @@
-SKIP: FAILED
-
 #version 310 es
 
 void reverseBits_e31adf() {
-  uint res = reversebits(1u);
+  uint res = bitfieldReverse(1u);
 }
 
 vec4 vertex_main() {
@@ -18,19 +16,11 @@
   gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp uint'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 precision mediump float;
 
 void reverseBits_e31adf() {
-  uint res = reversebits(1u);
+  uint res = bitfieldReverse(1u);
 }
 
 void fragment_main() {
@@ -41,18 +31,10 @@
   fragment_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:5: 'reversebits' : no matching overloaded function found 
-ERROR: 0:5: '=' :  cannot convert from ' const float' to ' temp mediump uint'
-ERROR: 0:5: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
 #version 310 es
 
 void reverseBits_e31adf() {
-  uint res = reversebits(1u);
+  uint res = bitfieldReverse(1u);
 }
 
 void compute_main() {
@@ -64,11 +46,3 @@
   compute_main();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:4: 'reversebits' : no matching overloaded function found 
-ERROR: 0:4: '=' :  cannot convert from ' const float' to ' temp highp uint'
-ERROR: 0:4: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/textureDimensions/ba1481.wgsl.expected.glsl b/test/tint/builtins/gen/textureDimensions/ba1481.wgsl.expected.glsl
index c0f864e..d4240f0 100644
--- a/test/tint/builtins/gen/textureDimensions/ba1481.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/textureDimensions/ba1481.wgsl.expected.glsl
@@ -1,6 +1,6 @@
 SKIP: FAILED
 
-C:\src\tint2\src\writer\glsl\generator_impl.cc:2510 internal compiler error: Multiplanar external texture transform was not run.
+../../src/tint/writer/glsl/generator_impl.cc:2576 internal compiler error: Multiplanar external texture transform was not run.
 
 
 ********************************************************************
diff --git a/test/tint/builtins/gen/textureLoad/8acf41.wgsl.expected.glsl b/test/tint/builtins/gen/textureLoad/8acf41.wgsl.expected.glsl
index c0f864e..d4240f0 100644
--- a/test/tint/builtins/gen/textureLoad/8acf41.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/textureLoad/8acf41.wgsl.expected.glsl
@@ -1,6 +1,6 @@
 SKIP: FAILED
 
-C:\src\tint2\src\writer\glsl\generator_impl.cc:2510 internal compiler error: Multiplanar external texture transform was not run.
+../../src/tint/writer/glsl/generator_impl.cc:2576 internal compiler error: Multiplanar external texture transform was not run.
 
 
 ********************************************************************
diff --git a/test/tint/builtins/gen/textureSampleLevel/979816.wgsl.expected.glsl b/test/tint/builtins/gen/textureSampleLevel/979816.wgsl.expected.glsl
index c0f864e..d4240f0 100644
--- a/test/tint/builtins/gen/textureSampleLevel/979816.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/textureSampleLevel/979816.wgsl.expected.glsl
@@ -1,6 +1,6 @@
 SKIP: FAILED
 
-C:\src\tint2\src\writer\glsl\generator_impl.cc:2510 internal compiler error: Multiplanar external texture transform was not run.
+../../src/tint/writer/glsl/generator_impl.cc:2576 internal compiler error: Multiplanar external texture transform was not run.
 
 
 ********************************************************************
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_IntVector_IntVector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_IntVector_IntVector.spvasm.expected.glsl
index a2b0da4..90d4fcd 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_IntVector_IntVector.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_IntVector_IntVector.spvasm.expected.glsl
@@ -1,3 +1,5 @@
+SKIP: FAILED
+
 #version 310 es
 
 void main_1() {
@@ -5,7 +7,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  ivec2 x_1 = ivec2(bitCount(v2i1));
+  ivec2 x_1 = countbits(v2i1);
   return;
 }
 
@@ -18,3 +20,11 @@
   tint_symbol();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:8: 'countbits' : no matching overloaded function found 
+ERROR: 0:8: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of int'
+ERROR: 0:8: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_IntVector_UintVector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_IntVector_UintVector.spvasm.expected.glsl
index 8f0ef93..0d0f715 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_IntVector_UintVector.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_IntVector_UintVector.spvasm.expected.glsl
@@ -1,3 +1,5 @@
+SKIP: FAILED
+
 #version 310 es
 
 void main_1() {
@@ -5,7 +7,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  ivec2 x_1 = ivec2(uvec2(bitCount(v2u1)));
+  ivec2 x_1 = ivec2(countbits(v2u1));
   return;
 }
 
@@ -18,3 +20,10 @@
   tint_symbol();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:8: 'countbits' : no matching overloaded function found 
+ERROR: 0:8: '' : compilation terminated 
+ERROR: 2 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Int_Int.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Int_Int.spvasm.expected.glsl
index cef6916..14bc7ec 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Int_Int.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Int_Int.spvasm.expected.glsl
@@ -1,3 +1,5 @@
+SKIP: FAILED
+
 #version 310 es
 
 void main_1() {
@@ -5,7 +7,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  int x_1 = int(bitCount(i1));
+  int x_1 = countbits(i1);
   return;
 }
 
@@ -18,3 +20,11 @@
   tint_symbol();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:8: 'countbits' : no matching overloaded function found 
+ERROR: 0:8: '=' :  cannot convert from ' const float' to ' temp highp int'
+ERROR: 0:8: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Int_Uint.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Int_Uint.spvasm.expected.glsl
index 3a7c14c..26c3149 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Int_Uint.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Int_Uint.spvasm.expected.glsl
@@ -1,3 +1,5 @@
+SKIP: FAILED
+
 #version 310 es
 
 void main_1() {
@@ -5,7 +7,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  int x_1 = int(uint(bitCount(u1)));
+  int x_1 = int(countbits(u1));
   return;
 }
 
@@ -18,3 +20,10 @@
   tint_symbol();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:8: 'countbits' : no matching overloaded function found 
+ERROR: 0:8: '' : compilation terminated 
+ERROR: 2 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_UintVector_IntVector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_UintVector_IntVector.spvasm.expected.glsl
index 53291e7..001332f 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_UintVector_IntVector.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_UintVector_IntVector.spvasm.expected.glsl
@@ -1,3 +1,5 @@
+SKIP: FAILED
+
 #version 310 es
 
 void main_1() {
@@ -5,7 +7,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  uvec2 x_1 = uvec2(ivec2(bitCount(v2i1)));
+  uvec2 x_1 = uvec2(countbits(v2i1));
   return;
 }
 
@@ -18,3 +20,10 @@
   tint_symbol();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:8: 'countbits' : no matching overloaded function found 
+ERROR: 0:8: '' : compilation terminated 
+ERROR: 2 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_UintVector_UintVector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_UintVector_UintVector.spvasm.expected.glsl
index a6bf792..b53a816 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_UintVector_UintVector.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_UintVector_UintVector.spvasm.expected.glsl
@@ -1,3 +1,5 @@
+SKIP: FAILED
+
 #version 310 es
 
 void main_1() {
@@ -5,7 +7,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  uvec2 x_1 = uvec2(bitCount(v2u1));
+  uvec2 x_1 = countbits(v2u1);
   return;
 }
 
@@ -18,3 +20,11 @@
   tint_symbol();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:8: 'countbits' : no matching overloaded function found 
+ERROR: 0:8: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of uint'
+ERROR: 0:8: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Uint_Int.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Uint_Int.spvasm.expected.glsl
index 8c34a54..ed3e3e8 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Uint_Int.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Uint_Int.spvasm.expected.glsl
@@ -1,3 +1,5 @@
+SKIP: FAILED
+
 #version 310 es
 
 void main_1() {
@@ -5,7 +7,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  uint x_1 = uint(int(bitCount(i1)));
+  uint x_1 = uint(countbits(i1));
   return;
 }
 
@@ -18,3 +20,10 @@
   tint_symbol();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:8: 'countbits' : no matching overloaded function found 
+ERROR: 0:8: '' : compilation terminated 
+ERROR: 2 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Uint_Uint.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Uint_Uint.spvasm.expected.glsl
index 7cbf141..bb09555 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Uint_Uint.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitCount_Uint_Uint.spvasm.expected.glsl
@@ -1,3 +1,5 @@
+SKIP: FAILED
+
 #version 310 es
 
 void main_1() {
@@ -5,7 +7,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  uint x_1 = uint(bitCount(u1));
+  uint x_1 = countbits(u1);
   return;
 }
 
@@ -18,3 +20,11 @@
   tint_symbol();
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:8: 'countbits' : no matching overloaded function found 
+ERROR: 0:8: '=' :  cannot convert from ' const float' to ' temp highp uint'
+ERROR: 0:8: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_IntVector_IntVector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_IntVector_IntVector.spvasm.expected.glsl
index e2b906d..a8bb8d8 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_IntVector_IntVector.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_IntVector_IntVector.spvasm.expected.glsl
@@ -1,5 +1,3 @@
-SKIP: FAILED
-
 #version 310 es
 
 void main_1() {
@@ -7,7 +5,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  ivec2 x_1 = reversebits(v2i1);
+  ivec2 x_1 = bitfieldReverse(v2i1);
   return;
 }
 
@@ -20,11 +18,3 @@
   tint_symbol();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:8: 'reversebits' : no matching overloaded function found 
-ERROR: 0:8: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of int'
-ERROR: 0:8: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_Int_Int.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_Int_Int.spvasm.expected.glsl
index 737138d..66a7769 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_Int_Int.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_Int_Int.spvasm.expected.glsl
@@ -1,5 +1,3 @@
-SKIP: FAILED
-
 #version 310 es
 
 void main_1() {
@@ -7,7 +5,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  int x_1 = reversebits(i1);
+  int x_1 = bitfieldReverse(i1);
   return;
 }
 
@@ -20,11 +18,3 @@
   tint_symbol();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:8: 'reversebits' : no matching overloaded function found 
-ERROR: 0:8: '=' :  cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:8: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_UintVector_UintVector.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_UintVector_UintVector.spvasm.expected.glsl
index 4cab6d4..5c7ec42 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_UintVector_UintVector.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_UintVector_UintVector.spvasm.expected.glsl
@@ -1,5 +1,3 @@
-SKIP: FAILED
-
 #version 310 es
 
 void main_1() {
@@ -7,7 +5,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  uvec2 x_1 = reversebits(v2u1);
+  uvec2 x_1 = bitfieldReverse(v2u1);
   return;
 }
 
@@ -20,11 +18,3 @@
   tint_symbol();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:8: 'reversebits' : no matching overloaded function found 
-ERROR: 0:8: '=' :  cannot convert from ' const float' to ' temp highp 2-component vector of uint'
-ERROR: 0:8: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_Uint_Uint.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_Uint_Uint.spvasm.expected.glsl
index b0a9729..e93fe20 100644
--- a/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_Uint_Uint.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/SpvUnaryBitTest_BitReverse_Uint_Uint.spvasm.expected.glsl
@@ -1,5 +1,3 @@
-SKIP: FAILED
-
 #version 310 es
 
 void main_1() {
@@ -7,7 +5,7 @@
   int i1 = 30;
   uvec2 v2u1 = uvec2(10u, 20u);
   ivec2 v2i1 = ivec2(30, 40);
-  uint x_1 = reversebits(u1);
+  uint x_1 = bitfieldReverse(u1);
   return;
 }
 
@@ -20,11 +18,3 @@
   tint_symbol();
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:8: 'reversebits' : no matching overloaded function found 
-ERROR: 0:8: '=' :  cannot convert from ' const float' to ' temp highp uint'
-ERROR: 0:8: '' : compilation terminated 
-ERROR: 3 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-bitcount/0-opt.spvasm.expected.glsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-bitcount/0-opt.spvasm.expected.glsl
index 311b8a6..944bf9e 100644
--- a/test/tint/vk-gl-cts/graphicsfuzz/cov-bitcount/0-opt.spvasm.expected.glsl
+++ b/test/tint/vk-gl-cts/graphicsfuzz/cov-bitcount/0-opt.spvasm.expected.glsl
@@ -1,3 +1,5 @@
+SKIP: FAILED
+
 #version 310 es
 precision mediump float;
 
@@ -37,7 +39,7 @@
   if ((x_65 > x_67)) {
     a = (a + 1);
   }
-  i = int(bitCount(a));
+  i = countbits(a);
   int x_75 = i;
   int x_77 = x_11.x_GLF_uniform_int_values[0].el;
   if ((x_75 < x_77)) {
@@ -83,3 +85,11 @@
   x_GLF_color_1_1 = inner_result.x_GLF_color_1;
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:40: 'countbits' : no matching overloaded function found 
+ERROR: 0:40: 'assign' :  cannot convert from ' const float' to ' temp mediump int'
+ERROR: 0:40: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-bitcount/0-opt.wgsl.expected.glsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-bitcount/0-opt.wgsl.expected.glsl
index f834d90..c64c3de 100644
--- a/test/tint/vk-gl-cts/graphicsfuzz/cov-bitcount/0-opt.wgsl.expected.glsl
+++ b/test/tint/vk-gl-cts/graphicsfuzz/cov-bitcount/0-opt.wgsl.expected.glsl
@@ -1,3 +1,5 @@
+SKIP: FAILED
+
 vk-gl-cts/graphicsfuzz/cov-bitcount/0-opt.wgsl:1:13 warning: use of deprecated language feature: the @stride attribute is deprecated; use a larger type if necessary
 type Arr = @stride(16) array<f32, 1>;
             ^^^^^^
@@ -45,7 +47,7 @@
   if ((x_65 > x_67)) {
     a = (a + 1);
   }
-  i = int(bitCount(a));
+  i = countbits(a);
   int x_75 = i;
   int x_77 = x_11.x_GLF_uniform_int_values[0].el;
   if ((x_75 < x_77)) {
@@ -91,3 +93,11 @@
   x_GLF_color_1_1 = inner_result.x_GLF_color_1;
   return;
 }
+Error parsing GLSL shader:
+ERROR: 0:40: 'countbits' : no matching overloaded function found 
+ERROR: 0:40: 'assign' :  cannot convert from ' const float' to ' temp mediump int'
+ERROR: 0:40: '' : compilation terminated 
+ERROR: 3 compilation errors.  No code generated.
+
+
+
diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow/0.spvasm.expected.glsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow/0.spvasm.expected.glsl
index 5a6fcec..612acf1 100644
--- a/test/tint/vk-gl-cts/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow/0.spvasm.expected.glsl
+++ b/test/tint/vk-gl-cts/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow/0.spvasm.expected.glsl
@@ -1,5 +1,3 @@
-SKIP: FAILED
-
 #version 310 es
 precision mediump float;
 
@@ -23,7 +21,7 @@
   int x_28_phi = 0;
   int x_31_phi = 0;
   int x_42_phi = 0;
-  int x_24 = min(1, reversebits(1));
+  int x_24 = min(1, bitfieldReverse(1));
   int x_26 = x_5.x_GLF_uniform_int_values[3].el;
   x_28_phi = x_26;
   x_31_phi = 1;
@@ -79,10 +77,3 @@
   x_GLF_color_1_1 = inner_result.x_GLF_color_1;
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:24: 'reversebits' : no matching overloaded function found 
-ERROR: 0:24: '' : compilation terminated 
-ERROR: 2 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow/0.wgsl.expected.glsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow/0.wgsl.expected.glsl
index a8ff3ff..3f464b3 100644
--- a/test/tint/vk-gl-cts/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow/0.wgsl.expected.glsl
+++ b/test/tint/vk-gl-cts/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow/0.wgsl.expected.glsl
@@ -1,5 +1,3 @@
-SKIP: FAILED
-
 vk-gl-cts/graphicsfuzz/cov-bitfieldreverse-loop-limit-underflow/0.wgsl:1:13 warning: use of deprecated language feature: the @stride attribute is deprecated; use a larger type if necessary
 type Arr = @stride(16) array<i32, 4>;
             ^^^^^^
@@ -27,7 +25,7 @@
   int x_28_phi = 0;
   int x_31_phi = 0;
   int x_42_phi = 0;
-  int x_24 = min(1, reversebits(1));
+  int x_24 = min(1, bitfieldReverse(1));
   int x_26 = x_5.x_GLF_uniform_int_values[3].el;
   x_28_phi = x_26;
   x_31_phi = 1;
@@ -83,10 +81,3 @@
   x_GLF_color_1_1 = inner_result.x_GLF_color_1;
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:24: 'reversebits' : no matching overloaded function found 
-ERROR: 0:24: '' : compilation terminated 
-ERROR: 2 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-dag-combiner-loop-bitfieldreverse/0-opt.spvasm.expected.glsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-dag-combiner-loop-bitfieldreverse/0-opt.spvasm.expected.glsl
index 6cedb1f..fcc7fa5 100644
--- a/test/tint/vk-gl-cts/graphicsfuzz/cov-dag-combiner-loop-bitfieldreverse/0-opt.spvasm.expected.glsl
+++ b/test/tint/vk-gl-cts/graphicsfuzz/cov-dag-combiner-loop-bitfieldreverse/0-opt.spvasm.expected.glsl
@@ -1,5 +1,3 @@
-SKIP: FAILED
-
 #version 310 es
 precision mediump float;
 
@@ -28,7 +26,7 @@
     int x_36 = (i + 1);
     i = x_36;
     int x_39 = x_6.x_GLF_uniform_int_values[2].el;
-    if ((reversebits(x_36) <= x_39)) {
+    if ((bitfieldReverse(x_36) <= x_39)) {
     } else {
       break;
     }
@@ -65,10 +63,3 @@
   x_GLF_color_1_1 = inner_result.x_GLF_color_1;
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:29: 'reversebits' : no matching overloaded function found 
-ERROR: 0:29: '' : compilation terminated 
-ERROR: 2 compilation errors.  No code generated.
-
-
-
diff --git a/test/tint/vk-gl-cts/graphicsfuzz/cov-dag-combiner-loop-bitfieldreverse/0-opt.wgsl.expected.glsl b/test/tint/vk-gl-cts/graphicsfuzz/cov-dag-combiner-loop-bitfieldreverse/0-opt.wgsl.expected.glsl
index 8631354..a79f2ef 100644
--- a/test/tint/vk-gl-cts/graphicsfuzz/cov-dag-combiner-loop-bitfieldreverse/0-opt.wgsl.expected.glsl
+++ b/test/tint/vk-gl-cts/graphicsfuzz/cov-dag-combiner-loop-bitfieldreverse/0-opt.wgsl.expected.glsl
@@ -1,5 +1,3 @@
-SKIP: FAILED
-
 vk-gl-cts/graphicsfuzz/cov-dag-combiner-loop-bitfieldreverse/0-opt.wgsl:1:13 warning: use of deprecated language feature: the @stride attribute is deprecated; use a larger type if necessary
 type Arr = @stride(16) array<i32, 4>;
             ^^^^^^
@@ -32,7 +30,7 @@
     int x_36 = (i + 1);
     i = x_36;
     int x_39 = x_6.x_GLF_uniform_int_values[2].el;
-    if ((reversebits(x_36) <= x_39)) {
+    if ((bitfieldReverse(x_36) <= x_39)) {
     } else {
       break;
     }
@@ -69,10 +67,3 @@
   x_GLF_color_1_1 = inner_result.x_GLF_color_1;
   return;
 }
-Error parsing GLSL shader:
-ERROR: 0:29: 'reversebits' : no matching overloaded function found 
-ERROR: 0:29: '' : compilation terminated 
-ERROR: 2 compilation errors.  No code generated.
-
-
-