1 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -run-pass=twoaddressinstruction -verify-machineinstrs -o - %s | FileCheck --check-prefixes=GFX10,GFX10-NOLIS %s
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -passes=two-address-instruction -verify-each -o - %s | FileCheck --check-prefixes=GFX10,GFX10-NOLIS %s
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -run-pass=liveintervals,twoaddressinstruction -verify-machineinstrs -o - %s | FileCheck --check-prefixes=GFX10,GFX10-LIS %s
6 # GFX10-LABEL: name: test_fmamk_reg_imm_f16
7 # GFX10: dead %2:vgpr_32 = IMPLICIT_DEF
9 # GFX10-NOLIS: V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
10 # GFX10-LIS: V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
12 name: test_fmamk_reg_imm_f16
13 tracksRegLiveness: true
17 %0:vreg_64 = IMPLICIT_DEF
18 %1:vgpr_32 = COPY %0.sub1
19 %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
20 %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2, killed %1, implicit $mode, implicit $exec
24 # GFX10-LABEL: name: test_fmamk_reg_imm_f16__imm_is_subreg
25 # GFX10: %0:vreg_64 = IMPLICIT_DEF
26 # GFX10: %1:vgpr_32 = COPY %0.sub1
27 # GFX10: dead undef %2.sub0:vreg_64 = IMPLICIT_DEF
28 # GFX10-NOLIS: %3:vgpr_32 = V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
29 # GFX10-LIS: %3:vgpr_32 = V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
31 name: test_fmamk_reg_imm_f16__imm_is_subreg
32 tracksRegLiveness: true
36 %0:vreg_64 = IMPLICIT_DEF
37 %1:vgpr_32 = COPY %0.sub1
38 undef %2.sub0:vreg_64 = V_MOV_B32_e32 1078523331, implicit $exec
39 %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2.sub0, killed %1, implicit $mode, implicit $exec
43 # GFX10-LABEL: name: test_fmamk_reg_imm_f16__imm_is_subreg_fully_defined
44 # GFX10: %0:vreg_64 = IMPLICIT_DEF
45 # GFX10: %1:vgpr_32 = COPY %0.sub1
46 # GFX10: undef %2.sub1:vreg_64 = V_MOV_B32_e32 9999, implicit $exec
47 # GFX10: %2.sub0:vreg_64 = V_MOV_B32_e32 1078523331, implicit $exec
48 # GFX10-NOLIS: %3:vgpr_32 = V_FMA_F16_gfx9_e64 0, killed %0.sub0, 0, %2.sub0, 0, killed %1, 0, 0, 0, implicit $mode, implicit $e
49 # GFX10-LIS: %3:vgpr_32 = V_FMA_F16_gfx9_e64 0, %0.sub0, 0, %2.sub0, 0, %1, 0, 0, 0, implicit $mode, implicit $e
51 name: test_fmamk_reg_imm_f16__imm_is_subreg_fully_defined
52 tracksRegLiveness: true
55 %0:vreg_64 = IMPLICIT_DEF
56 %1:vgpr_32 = COPY %0.sub1
57 undef %2.sub1 = V_MOV_B32_e32 9999, implicit $exec
58 %2.sub0:vreg_64 = V_MOV_B32_e32 1078523331, implicit $exec
59 %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2.sub0, killed %1, implicit $mode, implicit $exec
63 # GFX10-LABEL: name: test_fmamk_reg_imm_f16__use_imm_before_mac
64 # GFX10: %0:vreg_64 = IMPLICIT_DEF
65 # GFX10: %1:vgpr_32 = COPY %0.sub1
66 # GFX10: %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
67 # GFX10: S_NOP 0, implicit %2
68 # GFX10-NOLIS: %3:vgpr_32 = V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
69 # GFX10-LIS: %3:vgpr_32 = V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
71 name: test_fmamk_reg_imm_f16__use_imm_before_mac
72 tracksRegLiveness: true
76 %0:vreg_64 = IMPLICIT_DEF
77 %1:vgpr_32 = COPY %0.sub1
78 %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
80 %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2, killed %1, implicit $mode, implicit $exec
84 # GFX10-LABEL: name: test_fmamk_reg_imm_f16__use_imm_after_mac
85 # GFX10: %0:vreg_64 = IMPLICIT_DEF
86 # GFX10: %1:vgpr_32 = COPY %0.sub1
87 # GFX10: %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
88 # GFX10-NOLIS: %3:vgpr_32 = V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
89 # GFX10-LIS: %3:vgpr_32 = V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
91 name: test_fmamk_reg_imm_f16__use_imm_after_mac
92 tracksRegLiveness: true
96 %0:vreg_64 = IMPLICIT_DEF
97 %1:vgpr_32 = COPY %0.sub1
98 %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
99 %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2, killed %1, implicit $mode, implicit $exec
104 # GFX10-LABEL: name: test_fmamk_reg_imm_f16__use_imm_before_after_mac
105 # GFX10: %0:vreg_64 = IMPLICIT_DEF
106 # GFX10: %1:vgpr_32 = COPY %0.sub1
107 # GFX10: %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
108 # GFX10: S_NOP 0, implicit %2
109 # GFX10-NOLIS: %3:vgpr_32 = V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
110 # GFX10-LIS: %3:vgpr_32 = V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
111 # GFX10: S_NOP 0, implicit %2
114 name: test_fmamk_reg_imm_f16__use_imm_before_after_mac
115 tracksRegLiveness: true
119 %0:vreg_64 = IMPLICIT_DEF
120 %1:vgpr_32 = COPY %0.sub1
121 %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
123 %3:vgpr_32 = V_FMAC_F16_e32 killed %0.sub0, %2, killed %1, implicit $mode, implicit $exec
128 # GFX10-LABEL: name: test_fmamk_imm_reg_f16
129 # GFX10: dead %2:vgpr_32 = IMPLICIT_DEF
130 # GFX10-NOT: V_MOV_B32
131 # GFX10-NOLIS: V_FMAMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
132 # GFX10-LIS: V_FMAMK_F16 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
134 name: test_fmamk_imm_reg_f16
135 tracksRegLiveness: true
137 - { id: 0, class: vreg_64 }
138 - { id: 1, class: vgpr_32 }
139 - { id: 2, class: vgpr_32 }
140 - { id: 3, class: vgpr_32 }
146 %2 = V_MOV_B32_e32 1078523331, implicit $exec
147 %3 = V_FMAC_F16_e32 %2, killed %0.sub0, killed %1, implicit $mode, implicit $exec
151 # GFX10-LABEL: name: test_fmaak_f16
152 # GFX10: %1:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
153 # GFX10-NOT: V_MOV_B32
154 # GFX10-NOLIS: V_FMAAK_F16 killed %0.sub0, %0.sub1, 1078523331, implicit $mode, implicit $exec
155 # GFX10-LIS: V_FMAAK_F16 %0.sub0, %0.sub1, 1078523331, implicit $mode, implicit $exec
158 tracksRegLiveness: true
160 - { id: 0, class: vreg_64 }
161 - { id: 1, class: vgpr_32 }
162 - { id: 2, class: vgpr_32 }
167 %1 = V_MOV_B32_e32 1078523331, implicit $exec
168 %2 = V_FMAC_F16_e32 killed %0.sub0, %0.sub1, %1, implicit $mode, implicit $exec
169 S_ENDPGM 0, implicit %1
172 # GFX10-LABEL: name: test_fmaak_inline_literal_f16
173 # GFX10: %1:vgpr_32 = V_MOV_B32_e32 49664, implicit $exec
174 # GFX10-NOT: V_MOV_B32
175 # GFX10-NOLIS: %2:vgpr_32 = V_FMAAK_F16 16384, killed %0, 49664, implicit $mode, implicit $exec
176 # GFX10-LIS: %2:vgpr_32 = V_FMAAK_F16 16384, %0, 49664, implicit $mode, implicit $exec
179 name: test_fmaak_inline_literal_f16
180 tracksRegLiveness: true
182 - { reg: '$vgpr0', virtual-reg: '%0' }
187 %0:vgpr_32 = COPY killed $vgpr0
189 %1:vgpr_32 = V_MOV_B32_e32 49664, implicit $exec
190 %2:vgpr_32 = V_FMAC_F16_e32 16384, killed %0, %1, implicit $mode, implicit $exec
191 S_ENDPGM 0, implicit %1