1 # RUN: llc -march=amdgcn -mcpu=gfx802 -start-before postrapseudos -asm-verbose=0 -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -start-before postrapseudos -asm-verbose=0 -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
3 # RUN: llc -march=amdgcn -mcpu=gfx1010 -start-before postrapseudos -asm-verbose=0 -verify-machineinstrs %s -o - | FileCheck -check-prefixes=GCN,GFX10 %s
5 # GCN-LABEL: {{^}}lo_to_lo:
6 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
8 tracksRegLiveness: true
12 $vgpr1_lo16 = COPY $vgpr0_lo16
16 # GCN-LABEL: {{^}}lo_to_hi:
17 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
19 tracksRegLiveness: true
23 $vgpr1_hi16 = COPY killed $vgpr0_lo16
27 # GCN-LABEL: {{^}}hi_to_lo:
28 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
30 tracksRegLiveness: true
34 $vgpr1_lo16 = COPY $vgpr0_hi16
38 # GCN-LABEL: {{^}}hi_to_hi:
39 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
41 tracksRegLiveness: true
45 $vgpr1_hi16 = COPY $vgpr0_hi16
49 # GCN-LABEL: {{^}}lo_to_lo_samereg:
51 # GFX10-NEXT: s_waitcnt_vscnt
53 name: lo_to_lo_samereg
54 tracksRegLiveness: true
58 $vgpr0_lo16 = COPY $vgpr0_lo16
62 # GCN-LABEL: {{^}}lo_to_hi_samereg:
63 # GCN: v_mov_b32_sdwa v0, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
64 name: lo_to_hi_samereg
65 tracksRegLiveness: true
69 $vgpr0_hi16 = COPY $vgpr0_lo16
73 # GCN-LABEL: {{^}}hi_to_lo_samereg:
74 # GCN: v_mov_b32_sdwa v0, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
75 name: hi_to_lo_samereg
76 tracksRegLiveness: true
80 $vgpr0_lo16 = COPY killed $vgpr0_hi16
84 # GCN-LABEL: {{^}}hi_to_hi_samereg:
86 # GFX10-NEXT: s_waitcnt_vscnt
88 name: hi_to_hi_samereg
89 tracksRegLiveness: true
93 $vgpr0_hi16 = COPY killed $vgpr0_hi16
97 # GCN-LABEL: {{^}}lo_to_lo_def_livein:
98 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
99 name: lo_to_lo_def_livein
100 tracksRegLiveness: true
105 $vgpr1 = IMPLICIT_DEF
106 $vgpr1_lo16 = COPY $vgpr0_lo16
110 # GCN-LABEL: {{^}}lo_to_hi_def_livein:
111 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
112 name: lo_to_hi_def_livein
113 tracksRegLiveness: true
118 $vgpr1 = IMPLICIT_DEF
119 $vgpr1_hi16 = COPY $vgpr0_lo16
123 # GCN-LABEL: {{^}}hi_to_lo_def_livein:
124 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
125 name: hi_to_lo_def_livein
126 tracksRegLiveness: true
131 $vgpr1 = IMPLICIT_DEF
132 $vgpr1_lo16 = COPY killed $vgpr0_hi16
136 # GCN-LABEL: {{^}}hi_to_hi_def_livein:
137 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
138 name: hi_to_hi_def_livein
139 tracksRegLiveness: true
144 $vgpr1 = IMPLICIT_DEF
145 $vgpr1_hi16 = COPY $vgpr0_hi16
149 # TODO: This can be coalesced into a VGPR_32 copy
150 # GCN-LABEL: {{^}}lo_to_lo_hi_to_hi:
151 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
152 # GCN-NEXT: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
153 # GCN-NEXT: v_mov_b32_e32 v2, v1
155 name: lo_to_lo_hi_to_hi
156 tracksRegLiveness: true
159 $vgpr0 = IMPLICIT_DEF
160 $vgpr1_lo16 = COPY $vgpr0_lo16
161 $vgpr1_hi16 = COPY $vgpr0_hi16
162 $vgpr2 = COPY killed $vgpr1
166 # GCN-LABEL: {{^}}lo_to_hi_hi_to_lo:
167 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
168 # GCN-NEXT: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
169 # GCN-NEXT: v_mov_b32_e32 v2, v1
171 name: lo_to_hi_hi_to_lo
172 tracksRegLiveness: true
175 $vgpr0 = IMPLICIT_DEF
176 $vgpr1_lo16 = COPY $vgpr0_hi16
177 $vgpr1_hi16 = COPY $vgpr0_lo16
178 $vgpr2 = COPY killed $vgpr1
182 # NB: copy of undef just killed instead of expansion
183 # GCN-LABEL: {{^}}lo_to_lo_undef:
185 # GFX10-NEXT: s_waitcnt_vscnt
186 # GCN-NEXT: v_mov_b32_e32 v2, v1
189 tracksRegLiveness: true
192 $vgpr1_lo16 = COPY undef $vgpr0_lo16
193 $vgpr2 = COPY killed $vgpr1
197 # GCN-LABEL: {{^}}lo_to_lo_sgpr_to_sgpr:
198 # GCN: s_mov_b32 s1, s0
199 name: lo_to_lo_sgpr_to_sgpr
200 tracksRegLiveness: true
203 $sgpr0 = IMPLICIT_DEF
204 $sgpr1_lo16 = COPY $sgpr0_lo16