Tint: Implement bitcast for f16

This CL implement the missing bitcast from/to f16 types, including
resolver validation and HLSL/GLSL backends. MSL and SPIRV backends have
native support. Related unittests and tint tests are also implemented.

Bug: tint:1977, dawn:1510, tint:1502
Change-Id: I04499864df4115eeb130aceb359151e8e1ffbfa9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/140500
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
diff --git a/test/tint/expressions/bitcast/let/32bit/vec2f16-u32.wgsl.expected.fxc.hlsl b/test/tint/expressions/bitcast/let/32bit/vec2f16-u32.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2332ca6
--- /dev/null
+++ b/test/tint/expressions/bitcast/let/32bit/vec2f16-u32.wgsl.expected.fxc.hlsl
@@ -0,0 +1,18 @@
+SKIP: FAILED
+
+uint tint_bitcast_from_f16(vector<float16_t, 2> src) {
+  uint2 r = f32tof16(float2(src));
+  return asuint(uint((r.x & 0xffff) | ((r.y & 0xffff) << 16)));
+}
+
+[numthreads(1, 1, 1)]
+void f() {
+  const vector<float16_t, 2> a = vector<float16_t, 2>(float16_t(1.0h), float16_t(2.0h));
+  const uint b = tint_bitcast_from_f16(a);
+  return;
+}
+FXC validation failure:
+D:\Projects\RampUp\dawn\test\tint\expressions\bitcast\Shader@0x0000011D0C566F70(1,35-43): error X3000: syntax error: unexpected token 'float16_t'
+D:\Projects\RampUp\dawn\test\tint\expressions\bitcast\Shader@0x0000011D0C566F70(2,29-31): error X3004: undeclared identifier 'src'
+D:\Projects\RampUp\dawn\test\tint\expressions\bitcast\Shader@0x0000011D0C566F70(2,22-32): error X3014: incorrect number of arguments to numeric-type constructor
+