[llvm-objdump] - Remove one overload of reportError. NFCI.
[llvm-complete.git] / test / CodeGen / AMDGPU / GlobalISel / inst-select-fmul.mir
blobaa7e0e7ee7ad6d5c4daea2657482adb40aae3c25
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck %s -check-prefixes=GCN
4 ---
6 name:            fmul_f32
7 legalized:       true
8 regBankSelected: true
10 body: |
11   bb.0:
12     liveins: $sgpr0, $vgpr0, $vgpr1, $vgpr3_vgpr4
13     ; GCN-LABEL: name: fmul_f32
14     ; GCN: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
15     ; GCN: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
16     ; GCN: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr1
17     ; GCN: [[COPY3:%[0-9]+]]:vreg_64 = COPY $vgpr3_vgpr4
18     ; GCN: [[V_MUL_F32_e64_:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 0, [[COPY1]], 0, [[COPY]], 0, 0, implicit $exec
19     ; GCN: [[V_MUL_F32_e64_1:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $exec
20     ; GCN: [[V_MUL_F32_e64_2:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $exec
21     ; GCN: FLAT_STORE_DWORD [[COPY3]], [[V_MUL_F32_e64_]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
22     ; GCN: FLAT_STORE_DWORD [[COPY3]], [[V_MUL_F32_e64_1]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
23     ; GCN: FLAT_STORE_DWORD [[COPY3]], [[V_MUL_F32_e64_2]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
24     %0:sgpr(s32) = COPY $sgpr0
25     %1:vgpr(s32) = COPY $vgpr0
26     %2:vgpr(s32) = COPY $vgpr1
27     %3:vgpr(p1) = COPY $vgpr3_vgpr4
29     ; fmul vs
30     %4:vgpr(s32) = G_FMUL %1, %0
32     ; fmul sv
33     %5:vgpr(s32) = G_FMUL %0, %1
35     ; fmul vv
36     %6:vgpr(s32) = G_FMUL %1, %2
38     G_STORE %4, %3 :: (store 4, addrspace 1)
39     G_STORE %5, %3 :: (store 4, addrspace 1)
40     G_STORE %6, %3 :: (store 4, addrspace 1)
41 ...
43 ---
45 name:            fmul_f64
46 legalized:       true
47 regBankSelected: true
49 body: |
50   bb.0:
51     liveins: $sgpr0_sgpr1, $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5
52     ; GCN-LABEL: name: fmul_f64
53     ; GCN: [[COPY:%[0-9]+]]:sreg_64_xexec = COPY $sgpr0_sgpr1
54     ; GCN: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
55     ; GCN: [[COPY2:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
56     ; GCN: [[V_MUL_F64_:%[0-9]+]]:vreg_64 = V_MUL_F64 0, [[COPY1]], 0, [[COPY]], 0, 0, implicit $exec
57     ; GCN: [[V_MUL_F64_1:%[0-9]+]]:vreg_64 = V_MUL_F64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $exec
58     ; GCN: [[V_MUL_F64_2:%[0-9]+]]:vreg_64 = V_MUL_F64 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $exec
59     ; GCN: S_ENDPGM 0, implicit [[V_MUL_F64_]], implicit [[V_MUL_F64_1]], implicit [[V_MUL_F64_2]]
60     %0:sgpr(s64) = COPY $sgpr0_sgpr1
61     %1:vgpr(s64) = COPY $vgpr0_vgpr1
62     %2:vgpr(s64) = COPY $vgpr2_vgpr3
63     %3:vgpr(p1) = COPY $vgpr4_vgpr5
65     ; fmul vs
66     %4:vgpr(s64) = G_FMUL %1, %0
68     ; fmul sv
69     %5:vgpr(s64) = G_FMUL %0, %1
71     ; fmul vv
72     %6:vgpr(s64) = G_FMUL %1, %2
73     S_ENDPGM 0, implicit %4, implicit %5, implicit %6
75 ...
77 ---
79 name:            fmul_f16
80 legalized:       true
81 regBankSelected: true
83 body: |
84   bb.0:
85     liveins: $sgpr0, $vgpr0, $vgpr1, $vgpr3_vgpr4
86     ; GCN-LABEL: name: fmul_f16
87     ; GCN: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
88     ; GCN: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
89     ; GCN: [[V_MUL_F16_e64_:%[0-9]+]]:vgpr_32 = V_MUL_F16_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $exec
90     ; GCN: [[V_MUL_F16_e64_1:%[0-9]+]]:vgpr_32 = V_MUL_F16_e64 0, [[COPY]], 0, [[COPY]], 0, 0, implicit $exec
91     ; GCN: [[V_MUL_F16_e64_2:%[0-9]+]]:vgpr_32 = V_MUL_F16_e64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $exec
92     ; GCN: S_ENDPGM 0, implicit [[V_MUL_F16_e64_]], implicit [[V_MUL_F16_e64_1]], implicit [[V_MUL_F16_e64_2]]
93     %0:sgpr(s32) = COPY $sgpr0
94     %1:vgpr(s32) = COPY $vgpr0
95     %2:vgpr(s32) = COPY $vgpr1
96     %3:vgpr(p1) = COPY $vgpr3_vgpr4
98     %4:sgpr(s16) = G_TRUNC %0
99     %5:vgpr(s16) = G_TRUNC %1
100     %6:vgpr(s16) = G_TRUNC %2
102     ; fmul vs
103     %8:vgpr(s16) = G_FMUL %4, %4
105     ; fmul sv
106     %9:vgpr(s16) = G_FMUL %4, %4
108     ; fmul vv
109     %10:vgpr(s16) = G_FMUL %4, %5
111     S_ENDPGM 0, implicit %8, implicit %9, implicit %10
116 name:            fmul_modifiers_f32
117 legalized:       true
118 regBankSelected: true
120 body: |
121   bb.0:
122     liveins: $vgpr0, $vgpr1, $vgpr2_vgpr3
123     ; GCN-LABEL: name: fmul_modifiers_f32
124     ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
125     ; GCN: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
126     ; GCN: [[V_MUL_F32_e64_:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 2, [[COPY]], 0, [[COPY]], 0, 0, implicit $exec
127     ; GCN: [[V_MUL_F32_e64_1:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 0, [[COPY]], 2, [[COPY]], 0, 0, implicit $exec
128     ; GCN: [[V_MUL_F32_e64_2:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 2, [[COPY]], 2, [[COPY]], 0, 0, implicit $exec
129     ; GCN: [[V_MUL_F32_e64_3:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 1, [[COPY]], 0, [[COPY]], 0, 0, implicit $exec
130     ; GCN: [[V_MUL_F32_e64_4:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 0, [[COPY]], 1, [[COPY]], 0, 0, implicit $exec
131     ; GCN: [[V_MUL_F32_e64_5:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 1, [[COPY]], 1, [[COPY]], 0, 0, implicit $exec
132     ; GCN: [[V_MUL_F32_e64_6:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 3, [[COPY]], 0, [[COPY]], 0, 0, implicit $exec
133     ; GCN: [[V_MUL_F32_e64_7:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 0, [[COPY]], 3, [[COPY]], 0, 0, implicit $exec
134     ; GCN: [[V_MUL_F32_e64_8:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 3, [[COPY]], 3, [[COPY]], 0, 0, implicit $exec
135     ; GCN: [[V_MUL_F32_e64_9:%[0-9]+]]:vgpr_32 = V_MUL_F32_e64 3, [[COPY]], 1, [[COPY]], 0, 0, implicit $exec
136     ; GCN: FLAT_STORE_DWORD [[COPY1]], [[V_MUL_F32_e64_]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
137     ; GCN: FLAT_STORE_DWORD [[COPY1]], [[V_MUL_F32_e64_1]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
138     ; GCN: FLAT_STORE_DWORD [[COPY1]], [[V_MUL_F32_e64_2]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
139     ; GCN: FLAT_STORE_DWORD [[COPY1]], [[V_MUL_F32_e64_3]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
140     ; GCN: FLAT_STORE_DWORD [[COPY1]], [[V_MUL_F32_e64_4]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
141     ; GCN: FLAT_STORE_DWORD [[COPY1]], [[V_MUL_F32_e64_5]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
142     ; GCN: FLAT_STORE_DWORD [[COPY1]], [[V_MUL_F32_e64_6]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
143     ; GCN: FLAT_STORE_DWORD [[COPY1]], [[V_MUL_F32_e64_7]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
144     ; GCN: FLAT_STORE_DWORD [[COPY1]], [[V_MUL_F32_e64_8]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
145     ; GCN: FLAT_STORE_DWORD [[COPY1]], [[V_MUL_F32_e64_9]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr
146     %0:vgpr(s32) = COPY $vgpr0
147     %1:vgpr(s32) = COPY $vgpr1
148     %2:vgpr(p1) = COPY $vgpr2_vgpr3
150     %3:vgpr(s32) = G_FABS %0
151     %4:vgpr(s32) = G_FNEG %0
152     %5:vgpr(s32) = G_FNEG %3
154     ; fabs lhs
155     %6:vgpr(s32) = G_FMUL %3, %0
157     ; fabs rhs
158     %7:vgpr(s32) = G_FMUL %0, %3
160     ; fabs lhs, rhs
161     %8:vgpr(s32) = G_FMUL %3, %3
164     ; fneg lhs
165     %9:vgpr(s32) = G_FMUL %4, %0
167     ; fneg rhs
168     %10:vgpr(s32) = G_FMUL %0, %4
170     ; fneg  lhs, rhs
171     %11:vgpr(s32) = G_FMUL %4, %4
174     ; fneg fabs lhs
175     %12:vgpr(s32) = G_FMUL %5, %0
177     ; fneg fabs rhs
178     %13:vgpr(s32) = G_FMUL %0, %5
180     ; fneg  fabs lhs, rhs
181     %14:vgpr(s32) = G_FMUL %5, %5
184     ; fneg  fabs lhs, fneg rhs
185     %15:vgpr(s32) = G_FMUL %5, %4
187     G_STORE %6, %2 :: (store 4, addrspace 1)
188     G_STORE %7, %2 :: (store 4, addrspace 1)
189     G_STORE %8, %2 :: (store 4, addrspace 1)
190     G_STORE %9, %2 :: (store 4, addrspace 1)
191     G_STORE %10, %2 :: (store 4, addrspace 1)
192     G_STORE %11, %2 :: (store 4, addrspace 1)
193     G_STORE %12, %2 :: (store 4, addrspace 1)
194     G_STORE %13, %2 :: (store 4, addrspace 1)
195     G_STORE %14, %2 :: (store 4, addrspace 1)
196     G_STORE %15, %2 :: (store 4, addrspace 1)