• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: ./amdgcn_glslc %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s
2
3; We don't want any "v_and" or "v_or" here. v_cvt_f16 only writes the lower 16 bits.
4
5; FUNC-LABEL: {{^}}@packhalf:
6; GCN: main
7; GCN: v_interp_mov
8; GCN: v_interp_mov
9; GCN-NEXT: v_cvt_f16_f32
10; GCN-NEXT: v_lshlrev_b32
11; GCN-NEXT: v_cvt_f16_f32
12; GCN-NEXT: epilog
13
14#shader fs packhalf
15#version 420
16flat in vec2 v;
17out uvec4 o;
18void main() {
19    o.x = packHalf2x16(v);
20}
21
22
23; FUNC-LABEL: {{^}}@unpackhalf:
24; GCN: main
25; GCN: v_interp_mov
26; GCN-NEXT: v_cvt_f32_f16
27; GCN-NEXT: v_lshrrev_b32
28; GCN-NEXT: v_cvt_f32_f16
29; GCN-NEXT: epilog
30
31#shader fs unpackhalf
32#version 420
33flat in uint u;
34out vec4 o;
35void main() {
36    o.xy = unpackHalf2x16(u);
37}
38