SKIP: FAILED


cbuffer cbuffer_data : register(b0) {
  uint4 data[3];
};
vector<float16_t, 4> tint_bitcast_to_f16(uint4 src) {
  uint4 v = src;
  uint4 mask = (65535u).xxxx;
  uint4 shift = (16u).xxxx;
  float4 t_low = f16tof32((v & mask));
  float4 t_high = f16tof32(((v >> shift) & mask));
  float16_t v_1 = float16_t(t_low.x);
  float16_t v_2 = float16_t(t_high.x);
  float16_t v_3 = float16_t(t_low.y);
  return vector<float16_t, 4>(v_1, v_2, v_3, float16_t(t_high.y));
}

matrix<float16_t, 4, 3> v_4(uint start_byte_offset) {
  vector<float16_t, 3> v_5 = tint_bitcast_to_f16(data[(start_byte_offset / 16u)]).xyz;
  vector<float16_t, 3> v_6 = tint_bitcast_to_f16(data[((8u + start_byte_offset) / 16u)]).xyz;
  vector<float16_t, 3> v_7 = tint_bitcast_to_f16(data[((16u + start_byte_offset) / 16u)]).xyz;
  return matrix<float16_t, 4, 3>(v_5, v_6, v_7, tint_bitcast_to_f16(data[((24u + start_byte_offset) / 16u)]).xyz);
}

void main() {
  vector<float16_t, 3> v_8 = tint_bitcast_to_f16(data[2u]).xyz;
  vector<float16_t, 4> x = mul(v_4(0u), v_8);
}

FXC validation failure:
c:\src\dawn\Shader@0x000001D30B5F4CC0(5,8-16): error X3000: syntax error: unexpected token 'float16_t'

