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=gfx1010 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX10 %s 4 5--- 6 7name: fmad_f32 8legalized: true 9regBankSelected: true 10 11body: | 12 bb.0: 13 liveins: $vgpr0, $vgpr1, $vgpr2 14 15 ; GFX6-LABEL: name: fmad_f32 16 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 17 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 18 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 19 ; GFX6: [[V_MAC_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAC_F32_e64 0, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 20 ; GFX6: S_ENDPGM 0, implicit [[V_MAC_F32_e64_]] 21 ; GFX10-LABEL: name: fmad_f32 22 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 23 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 24 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 25 ; GFX10: [[V_MAC_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAC_F32_e64 0, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 26 ; GFX10: S_ENDPGM 0, implicit [[V_MAC_F32_e64_]] 27 %0:vgpr(s32) = COPY $vgpr0 28 %1:vgpr(s32) = COPY $vgpr1 29 %2:vgpr(s32) = COPY $vgpr2 30 %3:vgpr(s32) = G_FMAD %0, %1, %2 31 S_ENDPGM 0, implicit %3 32 33... 34 35--- 36 37name: fmad_f32_fneg_src0 38legalized: true 39regBankSelected: true 40 41body: | 42 bb.0: 43 liveins: $vgpr0, $vgpr1, $vgpr2 44 45 ; GFX6-LABEL: name: fmad_f32_fneg_src0 46 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 47 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 48 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 49 ; GFX6: [[V_MAD_F32_:%[0-9]+]]:vgpr_32 = V_MAD_F32 1, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 50 ; GFX6: S_ENDPGM 0, implicit [[V_MAD_F32_]] 51 ; GFX10-LABEL: name: fmad_f32_fneg_src0 52 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 53 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 54 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 55 ; GFX10: [[V_MAD_F32_:%[0-9]+]]:vgpr_32 = V_MAD_F32 1, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 56 ; GFX10: S_ENDPGM 0, implicit [[V_MAD_F32_]] 57 %0:vgpr(s32) = COPY $vgpr0 58 %1:vgpr(s32) = COPY $vgpr1 59 %2:vgpr(s32) = COPY $vgpr2 60 %3:vgpr(s32) = G_FNEG %0 61 %4:vgpr(s32) = G_FMAD %3, %1, %2 62 S_ENDPGM 0, implicit %4 63 64... 65 66--- 67 68name: fmad_f32_fneg_src1 69legalized: true 70regBankSelected: true 71 72body: | 73 bb.0: 74 liveins: $vgpr0, $vgpr1, $vgpr2 75 76 ; GFX6-LABEL: name: fmad_f32_fneg_src1 77 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 78 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 79 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 80 ; GFX6: [[V_MAD_F32_:%[0-9]+]]:vgpr_32 = V_MAD_F32 0, [[COPY]], 1, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 81 ; GFX6: S_ENDPGM 0, implicit [[V_MAD_F32_]] 82 ; GFX10-LABEL: name: fmad_f32_fneg_src1 83 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 84 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 85 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 86 ; GFX10: [[V_MAD_F32_:%[0-9]+]]:vgpr_32 = V_MAD_F32 0, [[COPY]], 1, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec 87 ; GFX10: S_ENDPGM 0, implicit [[V_MAD_F32_]] 88 %0:vgpr(s32) = COPY $vgpr0 89 %1:vgpr(s32) = COPY $vgpr1 90 %2:vgpr(s32) = COPY $vgpr2 91 %3:vgpr(s32) = G_FNEG %1 92 %4:vgpr(s32) = G_FMAD %0, %3, %2 93 S_ENDPGM 0, implicit %4 94 95... 96 97--- 98 99name: fmad_f32_fneg_src2 100legalized: true 101regBankSelected: true 102 103body: | 104 bb.0: 105 liveins: $vgpr0, $vgpr1, $vgpr2 106 107 ; GFX6-LABEL: name: fmad_f32_fneg_src2 108 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 109 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 110 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 111 ; GFX6: [[V_MAD_F32_:%[0-9]+]]:vgpr_32 = V_MAD_F32 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec 112 ; GFX6: S_ENDPGM 0, implicit [[V_MAD_F32_]] 113 ; GFX10-LABEL: name: fmad_f32_fneg_src2 114 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 115 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 116 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 117 ; GFX10: [[V_MAD_F32_:%[0-9]+]]:vgpr_32 = V_MAD_F32 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec 118 ; GFX10: S_ENDPGM 0, implicit [[V_MAD_F32_]] 119 %0:vgpr(s32) = COPY $vgpr0 120 %1:vgpr(s32) = COPY $vgpr1 121 %2:vgpr(s32) = COPY $vgpr2 122 %3:vgpr(s32) = G_FNEG %2 123 %4:vgpr(s32) = G_FMAD %0, %1, %3 124 S_ENDPGM 0, implicit %4 125 126... 127 128--- 129 130name: fmad_f32_fabs_src2 131legalized: true 132regBankSelected: true 133 134body: | 135 bb.0: 136 liveins: $vgpr0, $vgpr1, $vgpr2 137 138 ; GFX6-LABEL: name: fmad_f32_fabs_src2 139 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 140 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 141 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 142 ; GFX6: [[V_MAD_F32_:%[0-9]+]]:vgpr_32 = V_MAD_F32 0, [[COPY]], 0, [[COPY1]], 2, [[COPY2]], 0, 0, implicit $mode, implicit $exec 143 ; GFX6: S_ENDPGM 0, implicit [[V_MAD_F32_]] 144 ; GFX10-LABEL: name: fmad_f32_fabs_src2 145 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 146 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 147 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 148 ; GFX10: [[V_MAD_F32_:%[0-9]+]]:vgpr_32 = V_MAD_F32 0, [[COPY]], 0, [[COPY1]], 2, [[COPY2]], 0, 0, implicit $mode, implicit $exec 149 ; GFX10: S_ENDPGM 0, implicit [[V_MAD_F32_]] 150 %0:vgpr(s32) = COPY $vgpr0 151 %1:vgpr(s32) = COPY $vgpr1 152 %2:vgpr(s32) = COPY $vgpr2 153 %3:vgpr(s32) = G_FABS %2 154 %4:vgpr(s32) = G_FMAD %0, %1, %3 155 S_ENDPGM 0, implicit %4 156 157... 158 159--- 160 161name: fmad_f32_copy_fneg_src2 162legalized: true 163regBankSelected: true 164 165body: | 166 bb.0: 167 liveins: $vgpr0, $vgpr1, $vgpr2 168 169 ; GFX6-LABEL: name: fmad_f32_copy_fneg_src2 170 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0 171 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1 172 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2 173 ; GFX6: [[V_MAD_F32_:%[0-9]+]]:vgpr_32 = V_MAD_F32 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec 174 ; GFX6: S_ENDPGM 0, implicit [[V_MAD_F32_]] 175 ; GFX10-LABEL: name: fmad_f32_copy_fneg_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: [[V_MAD_F32_:%[0-9]+]]:vgpr_32 = V_MAD_F32 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec 180 ; GFX10: S_ENDPGM 0, implicit [[V_MAD_F32_]] 181 %0:vgpr(s32) = COPY $vgpr0 182 %1:vgpr(s32) = COPY $vgpr1 183 %2:vgpr(s32) = COPY $vgpr2 184 %3:vgpr(s32) = G_FNEG %2 185 %4:vgpr(s32) = COPY %3 186 %5:vgpr(s32) = G_FMAD %0, %1, %4 187 S_ENDPGM 0, implicit %5 188 189... 190