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 -check-prefix=GFX6 %s 3# RUN: llc -march=amdgcn -mcpu=gfx906 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX9-DL %s 4# RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX10 %s 5 6--- 7 8name: fma_f32 9legalized: true 10regBankSelected: true 11 12body: | 13 bb.0: 14 liveins: $vgpr0, $vgpr1, $vgpr2 15 16 ; GFX6-LABEL: name: fma_f32 17 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 18 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 19 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 20 ; GFX6: %3:vgpr_32 = nofpexcept V_FMA_F32 0, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 21 ; GFX6: S_ENDPGM 0, implicit %3 22 ; GFX9-DL-LABEL: name: fma_f32 23 ; GFX9-DL: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 24 ; GFX9-DL: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 25 ; GFX9-DL: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 26 ; GFX9-DL: %3:vgpr_32 = nofpexcept V_FMAC_F32_e64 0, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 27 ; GFX9-DL: S_ENDPGM 0, implicit %3 28 ; GFX10-LABEL: name: fma_f32 29 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 30 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 31 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 32 ; GFX10: %3:vgpr_32 = nofpexcept V_FMAC_F32_e64 0, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 33 ; GFX10: S_ENDPGM 0, implicit %3 34 %0:vgpr(s32) = COPY $vgpr0 35 %1:vgpr(s32) = COPY $vgpr1 36 %2:vgpr(s32) = COPY $vgpr2 37 %3:vgpr(s32) = G_FMA %0, %1, %2 38 S_ENDPGM 0, implicit %3 39 40... 41 42--- 43 44name: fma_f32_fneg_src0 45legalized: true 46regBankSelected: true 47 48body: | 49 bb.0: 50 liveins: $vgpr0, $vgpr1, $vgpr2 51 52 ; GFX6-LABEL: name: fma_f32_fneg_src0 53 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 54 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 55 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 56 ; GFX6: %4:vgpr_32 = nofpexcept V_FMA_F32 1, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 57 ; GFX6: S_ENDPGM 0, implicit %4 58 ; GFX9-DL-LABEL: name: fma_f32_fneg_src0 59 ; GFX9-DL: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 60 ; GFX9-DL: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 61 ; GFX9-DL: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 62 ; GFX9-DL: %4:vgpr_32 = nofpexcept V_FMAC_F32_e64 1, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 63 ; GFX9-DL: S_ENDPGM 0, implicit %4 64 ; GFX10-LABEL: name: fma_f32_fneg_src0 65 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 66 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 67 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 68 ; GFX10: %4:vgpr_32 = nofpexcept V_FMAC_F32_e64 1, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 69 ; GFX10: S_ENDPGM 0, implicit %4 70 %0:vgpr(s32) = COPY $vgpr0 71 %1:vgpr(s32) = COPY $vgpr1 72 %2:vgpr(s32) = COPY $vgpr2 73 %3:vgpr(s32) = G_FNEG %0 74 %4:vgpr(s32) = G_FMA %3, %1, %2 75 S_ENDPGM 0, implicit %4 76 77... 78 79--- 80 81name: fma_f32_fneg_src1 82legalized: true 83regBankSelected: true 84 85body: | 86 bb.0: 87 liveins: $vgpr0, $vgpr1, $vgpr2 88 89 ; GFX6-LABEL: name: fma_f32_fneg_src1 90 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 91 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 92 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 93 ; GFX6: %4:vgpr_32 = nofpexcept V_FMA_F32 0, [[COPY]], 1, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 94 ; GFX6: S_ENDPGM 0, implicit %4 95 ; GFX9-DL-LABEL: name: fma_f32_fneg_src1 96 ; GFX9-DL: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 97 ; GFX9-DL: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 98 ; GFX9-DL: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 99 ; GFX9-DL: %4:vgpr_32 = nofpexcept V_FMAC_F32_e64 0, [[COPY]], 1, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 100 ; GFX9-DL: S_ENDPGM 0, implicit %4 101 ; GFX10-LABEL: name: fma_f32_fneg_src1 102 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 103 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 104 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 105 ; GFX10: %4:vgpr_32 = nofpexcept V_FMAC_F32_e64 0, [[COPY]], 1, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 106 ; GFX10: S_ENDPGM 0, implicit %4 107 %0:vgpr(s32) = COPY $vgpr0 108 %1:vgpr(s32) = COPY $vgpr1 109 %2:vgpr(s32) = COPY $vgpr2 110 %3:vgpr(s32) = G_FNEG %1 111 %4:vgpr(s32) = G_FMA %0, %3, %2 112 S_ENDPGM 0, implicit %4 113 114... 115 116--- 117 118name: fma_f32_fneg_src2 119legalized: true 120regBankSelected: true 121 122body: | 123 bb.0: 124 liveins: $vgpr0, $vgpr1, $vgpr2 125 126 ; GFX6-LABEL: name: fma_f32_fneg_src2 127 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 128 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 129 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 130 ; GFX6: %4:vgpr_32 = nofpexcept V_FMA_F32 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec 131 ; GFX6: S_ENDPGM 0, implicit %4 132 ; GFX9-DL-LABEL: name: fma_f32_fneg_src2 133 ; GFX9-DL: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 134 ; GFX9-DL: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 135 ; GFX9-DL: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 136 ; GFX9-DL: %4:vgpr_32 = nofpexcept V_FMA_F32 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec 137 ; GFX9-DL: S_ENDPGM 0, implicit %4 138 ; GFX10-LABEL: name: fma_f32_fneg_src2 139 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 140 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 141 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 142 ; GFX10: %4:vgpr_32 = nofpexcept V_FMA_F32 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec 143 ; GFX10: S_ENDPGM 0, implicit %4 144 %0:vgpr(s32) = COPY $vgpr0 145 %1:vgpr(s32) = COPY $vgpr1 146 %2:vgpr(s32) = COPY $vgpr2 147 %3:vgpr(s32) = G_FNEG %2 148 %4:vgpr(s32) = G_FMA %0, %1, %3 149 S_ENDPGM 0, implicit %4 150 151... 152 153--- 154 155name: fma_f32_fabs_src2 156legalized: true 157regBankSelected: true 158 159body: | 160 bb.0: 161 liveins: $vgpr0, $vgpr1, $vgpr2 162 163 ; GFX6-LABEL: name: fma_f32_fabs_src2 164 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 165 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 166 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 167 ; GFX6: %4:vgpr_32 = nofpexcept V_FMA_F32 0, [[COPY]], 0, [[COPY1]], 2, [[COPY2]], 0, 0, implicit $mode, implicit $exec 168 ; GFX6: S_ENDPGM 0, implicit %4 169 ; GFX9-DL-LABEL: name: fma_f32_fabs_src2 170 ; GFX9-DL: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 171 ; GFX9-DL: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 172 ; GFX9-DL: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 173 ; GFX9-DL: %4:vgpr_32 = nofpexcept V_FMA_F32 0, [[COPY]], 0, [[COPY1]], 2, [[COPY2]], 0, 0, implicit $mode, implicit $exec 174 ; GFX9-DL: S_ENDPGM 0, implicit %4 175 ; GFX10-LABEL: name: fma_f32_fabs_src2 176 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 177 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 178 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 179 ; GFX10: %4:vgpr_32 = nofpexcept V_FMA_F32 0, [[COPY]], 0, [[COPY1]], 2, [[COPY2]], 0, 0, implicit $mode, implicit $exec 180 ; GFX10: S_ENDPGM 0, implicit %4 181 %0:vgpr(s32) = COPY $vgpr0 182 %1:vgpr(s32) = COPY $vgpr1 183 %2:vgpr(s32) = COPY $vgpr2 184 %3:vgpr(s32) = G_FABS %2 185 %4:vgpr(s32) = G_FMA %0, %1, %3 186 S_ENDPGM 0, implicit %4 187 188... 189 190--- 191 192name: fma_f32_copy_fneg_src2 193legalized: true 194regBankSelected: true 195 196body: | 197 bb.0: 198 liveins: $vgpr0, $vgpr1, $vgpr2 199 200 ; GFX6-LABEL: name: fma_f32_copy_fneg_src2 201 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 202 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 203 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 204 ; GFX6: %5:vgpr_32 = nofpexcept V_FMA_F32 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec 205 ; GFX6: S_ENDPGM 0, implicit %5 206 ; GFX9-DL-LABEL: name: fma_f32_copy_fneg_src2 207 ; GFX9-DL: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 208 ; GFX9-DL: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 209 ; GFX9-DL: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 210 ; GFX9-DL: %5:vgpr_32 = nofpexcept V_FMA_F32 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec 211 ; GFX9-DL: S_ENDPGM 0, implicit %5 212 ; GFX10-LABEL: name: fma_f32_copy_fneg_src2 213 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 214 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 215 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 216 ; GFX10: %5:vgpr_32 = nofpexcept V_FMA_F32 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec 217 ; GFX10: S_ENDPGM 0, implicit %5 218 %0:vgpr(s32) = COPY $vgpr0 219 %1:vgpr(s32) = COPY $vgpr1 220 %2:vgpr(s32) = COPY $vgpr2 221 %3:vgpr(s32) = G_FNEG %2 222 %4:vgpr(s32) = COPY %3 223 %5:vgpr(s32) = G_FMA %0, %1, %4 224 S_ENDPGM 0, implicit %5 225 226... 227