1 # RUN: llc -mtriple=amdgcn -mcpu=gfx802 -start-before postrapseudos -asm-verbose=0 -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -start-before postrapseudos -asm-verbose=0 -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -start-before postrapseudos -asm-verbose=0 -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %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:
52 name: lo_to_lo_samereg
53 tracksRegLiveness: true
57 $vgpr0_lo16 = COPY $vgpr0_lo16
61 # GCN-LABEL: {{^}}lo_to_hi_samereg:
62 # GCN: v_mov_b32_sdwa v0, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
63 name: lo_to_hi_samereg
64 tracksRegLiveness: true
68 $vgpr0_hi16 = COPY $vgpr0_lo16
72 # GCN-LABEL: {{^}}hi_to_lo_samereg:
73 # GCN: v_mov_b32_sdwa v0, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
74 name: hi_to_lo_samereg
75 tracksRegLiveness: true
79 $vgpr0_lo16 = COPY killed $vgpr0_hi16
83 # GCN-LABEL: {{^}}hi_to_hi_samereg:
86 name: hi_to_hi_samereg
87 tracksRegLiveness: true
91 $vgpr0_hi16 = COPY killed $vgpr0_hi16
95 # GCN-LABEL: {{^}}lo_to_lo_def_livein:
96 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
97 name: lo_to_lo_def_livein
98 tracksRegLiveness: true
103 $vgpr1 = IMPLICIT_DEF
104 $vgpr1_lo16 = COPY $vgpr0_lo16
108 # GCN-LABEL: {{^}}lo_to_hi_def_livein:
109 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
110 name: lo_to_hi_def_livein
111 tracksRegLiveness: true
116 $vgpr1 = IMPLICIT_DEF
117 $vgpr1_hi16 = COPY $vgpr0_lo16
121 # GCN-LABEL: {{^}}hi_to_lo_def_livein:
122 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
123 name: hi_to_lo_def_livein
124 tracksRegLiveness: true
129 $vgpr1 = IMPLICIT_DEF
130 $vgpr1_lo16 = COPY killed $vgpr0_hi16
134 # GCN-LABEL: {{^}}hi_to_hi_def_livein:
135 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
136 name: hi_to_hi_def_livein
137 tracksRegLiveness: true
142 $vgpr1 = IMPLICIT_DEF
143 $vgpr1_hi16 = COPY $vgpr0_hi16
147 # TODO: This can be coalesced into a VGPR_32 copy
148 # GCN-LABEL: {{^}}lo_to_lo_hi_to_hi:
149 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
150 # GCN-NEXT: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
151 # GCN-NEXT: v_mov_b32_e32 v2, v1
153 name: lo_to_lo_hi_to_hi
154 tracksRegLiveness: true
157 $vgpr0 = IMPLICIT_DEF
158 $vgpr1_lo16 = COPY $vgpr0_lo16
159 $vgpr1_hi16 = COPY $vgpr0_hi16
160 $vgpr2 = COPY killed $vgpr1
164 # GCN-LABEL: {{^}}lo_to_hi_hi_to_lo:
165 # GCN: v_mov_b32_sdwa v1, v0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
166 # GCN-NEXT: v_mov_b32_sdwa v1, v0 dst_sel:WORD_1 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0
167 # GCN-NEXT: v_mov_b32_e32 v2, v1
169 name: lo_to_hi_hi_to_lo
170 tracksRegLiveness: true
173 $vgpr0 = IMPLICIT_DEF
174 $vgpr1_lo16 = COPY $vgpr0_hi16
175 $vgpr1_hi16 = COPY $vgpr0_lo16
176 $vgpr2 = COPY killed $vgpr1
180 # NB: copy of undef just killed instead of expansion
181 # GCN-LABEL: {{^}}lo_to_lo_undef:
183 # GCN-NEXT: v_mov_b32_e32 v2, v1
186 tracksRegLiveness: true
189 $vgpr1_lo16 = COPY undef $vgpr0_lo16
190 $vgpr2 = COPY killed $vgpr1
194 # GCN-LABEL: {{^}}lo_to_lo_sgpr_to_sgpr:
195 # GCN: s_mov_b32 s1, s0
196 name: lo_to_lo_sgpr_to_sgpr
197 tracksRegLiveness: true
200 $sgpr0 = IMPLICIT_DEF
201 $sgpr1_lo16 = COPY $sgpr0_lo16