1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=GFX8 3# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx906 -O0 -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=GFX9 4 5--- 6name: test_smulh_s32 7body: | 8 bb.0: 9 liveins: $vgpr0, $vgpr1 10 11 ; GFX8-LABEL: name: test_smulh_s32 12 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 13 ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1 14 ; GFX8: [[SMULH:%[0-9]+]]:_(s32) = G_SMULH [[COPY]], [[COPY1]] 15 ; GFX8: $vgpr0 = COPY [[SMULH]](s32) 16 ; GFX9-LABEL: name: test_smulh_s32 17 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 18 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1 19 ; GFX9: [[SMULH:%[0-9]+]]:_(s32) = G_SMULH [[COPY]], [[COPY1]] 20 ; GFX9: $vgpr0 = COPY [[SMULH]](s32) 21 %0:_(s32) = COPY $vgpr0 22 %1:_(s32) = COPY $vgpr1 23 %2:_(s32) = G_SMULH %0, %1 24 $vgpr0 = COPY %2 25... 26 27--- 28name: test_smulh_v2s32 29body: | 30 bb.0: 31 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3 32 33 ; GFX8-LABEL: name: test_smulh_v2s32 34 ; GFX8: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1 35 ; GFX8: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3 36 ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>) 37 ; GFX8: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>) 38 ; GFX8: [[SMULH:%[0-9]+]]:_(s32) = G_SMULH [[UV]], [[UV2]] 39 ; GFX8: [[SMULH1:%[0-9]+]]:_(s32) = G_SMULH [[UV1]], [[UV3]] 40 ; GFX8: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SMULH]](s32), [[SMULH1]](s32) 41 ; GFX8: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>) 42 ; GFX9-LABEL: name: test_smulh_v2s32 43 ; GFX9: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1 44 ; GFX9: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3 45 ; GFX9: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>) 46 ; GFX9: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>) 47 ; GFX9: [[SMULH:%[0-9]+]]:_(s32) = G_SMULH [[UV]], [[UV2]] 48 ; GFX9: [[SMULH1:%[0-9]+]]:_(s32) = G_SMULH [[UV1]], [[UV3]] 49 ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SMULH]](s32), [[SMULH1]](s32) 50 ; GFX9: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>) 51 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1 52 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3 53 %2:_(<2 x s32>) = G_SMULH %0, %1 54 $vgpr0_vgpr1 = COPY %2 55... 56 57--- 58name: test_smulh_s16 59body: | 60 bb.0: 61 liveins: $vgpr0, $vgpr1 62 63 ; GFX8-LABEL: name: test_smulh_s16 64 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 65 ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1 66 ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 67 ; GFX8: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 16 68 ; GFX8: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32) 69 ; GFX8: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 16 70 ; GFX8: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[SEXT_INREG]], [[SEXT_INREG1]] 71 ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 72 ; GFX8: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[MUL]], [[C]](s32) 73 ; GFX8: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ASHR]](s32) 74 ; GFX8: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY4]], 16 75 ; GFX8: $vgpr0 = COPY [[SEXT_INREG2]](s32) 76 ; GFX9-LABEL: name: test_smulh_s16 77 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 78 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1 79 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 80 ; GFX9: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 16 81 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32) 82 ; GFX9: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 16 83 ; GFX9: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[SEXT_INREG]], [[SEXT_INREG1]] 84 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 85 ; GFX9: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[MUL]], [[C]](s32) 86 ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[ASHR]](s32) 87 ; GFX9: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY4]], 16 88 ; GFX9: $vgpr0 = COPY [[SEXT_INREG2]](s32) 89 %0:_(s32) = COPY $vgpr0 90 %1:_(s32) = COPY $vgpr1 91 %2:_(s16) = G_TRUNC %0 92 %3:_(s16) = G_TRUNC %1 93 %4:_(s16) = G_SMULH %2, %3 94 %5:_(s32) = G_SEXT %4 95 $vgpr0 = COPY %5 96... 97 98--- 99name: test_smulh_s8 100body: | 101 bb.0: 102 liveins: $vgpr0, $vgpr1 103 104 ; GFX8-LABEL: name: test_smulh_s8 105 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 106 ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1 107 ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) 108 ; GFX8: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 8 109 ; GFX8: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC]], [[C]](s16) 110 ; GFX8: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[SHL]], [[C]](s16) 111 ; GFX8: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32) 112 ; GFX8: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[TRUNC1]], [[C]](s16) 113 ; GFX8: [[ASHR1:%[0-9]+]]:_(s16) = G_ASHR [[SHL1]], [[C]](s16) 114 ; GFX8: [[MUL:%[0-9]+]]:_(s16) = G_MUL [[ASHR]], [[ASHR1]] 115 ; GFX8: [[ASHR2:%[0-9]+]]:_(s16) = G_ASHR [[MUL]], [[C]](s16) 116 ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ASHR2]](s16) 117 ; GFX8: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[ANYEXT]], 8 118 ; GFX8: $vgpr0 = COPY [[SEXT_INREG]](s32) 119 ; GFX9-LABEL: name: test_smulh_s8 120 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 121 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1 122 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 123 ; GFX9: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 8 124 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[SEXT_INREG]](s32) 125 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32) 126 ; GFX9: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 8 127 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SEXT_INREG1]](s32) 128 ; GFX9: [[MUL:%[0-9]+]]:_(s16) = G_MUL [[TRUNC]], [[TRUNC1]] 129 ; GFX9: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 8 130 ; GFX9: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[MUL]], [[C]](s16) 131 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ASHR]](s16) 132 ; GFX9: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[ANYEXT]], 8 133 ; GFX9: $vgpr0 = COPY [[SEXT_INREG2]](s32) 134 %0:_(s32) = COPY $vgpr0 135 %1:_(s32) = COPY $vgpr1 136 %2:_(s8) = G_TRUNC %0 137 %3:_(s8) = G_TRUNC %1 138 %4:_(s8) = G_SMULH %2, %3 139 %5:_(s32) = G_SEXT %4 140 $vgpr0 = COPY %5 141... 142 143--- 144name: test_smulh_v2s16 145body: | 146 bb.0: 147 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3 148 ; GFX8-LABEL: name: test_smulh_v2s16 149 ; GFX8: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1 150 ; GFX8: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3 151 ; GFX8: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>) 152 ; GFX8: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>) 153 ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV]](s32) 154 ; GFX8: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 16 155 ; GFX8: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV2]](s32) 156 ; GFX8: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 16 157 ; GFX8: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[SEXT_INREG]], [[SEXT_INREG1]] 158 ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 159 ; GFX8: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[MUL]], [[C]](s32) 160 ; GFX8: [[COPY4:%[0-9]+]]:_(s32) = COPY [[UV1]](s32) 161 ; GFX8: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY4]], 16 162 ; GFX8: [[COPY5:%[0-9]+]]:_(s32) = COPY [[UV3]](s32) 163 ; GFX8: [[SEXT_INREG3:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY5]], 16 164 ; GFX8: [[MUL1:%[0-9]+]]:_(s32) = G_MUL [[SEXT_INREG2]], [[SEXT_INREG3]] 165 ; GFX8: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[MUL1]], [[C]](s32) 166 ; GFX8: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 167 ; GFX8: [[COPY6:%[0-9]+]]:_(s32) = COPY [[ASHR]](s32) 168 ; GFX8: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C1]] 169 ; GFX8: [[COPY7:%[0-9]+]]:_(s32) = COPY [[ASHR1]](s32) 170 ; GFX8: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C1]] 171 ; GFX8: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C]](s32) 172 ; GFX8: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]] 173 ; GFX8: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32) 174 ; GFX8: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[BITCAST]](<2 x s16>) 175 ; GFX8: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32) 176 ; GFX8: [[COPY8:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32) 177 ; GFX8: [[SEXT_INREG4:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY8]], 16 178 ; GFX8: [[COPY9:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 179 ; GFX8: [[SEXT_INREG5:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY9]], 16 180 ; GFX8: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SEXT_INREG4]](s32), [[SEXT_INREG5]](s32) 181 ; GFX8: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>) 182 ; GFX9-LABEL: name: test_smulh_v2s16 183 ; GFX9: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1 184 ; GFX9: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3 185 ; GFX9: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>) 186 ; GFX9: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>) 187 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[UV]](s32) 188 ; GFX9: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 16 189 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UV2]](s32) 190 ; GFX9: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 16 191 ; GFX9: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[SEXT_INREG]], [[SEXT_INREG1]] 192 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 193 ; GFX9: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[MUL]], [[C]](s32) 194 ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[UV1]](s32) 195 ; GFX9: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY4]], 16 196 ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[UV3]](s32) 197 ; GFX9: [[SEXT_INREG3:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY5]], 16 198 ; GFX9: [[MUL1:%[0-9]+]]:_(s32) = G_MUL [[SEXT_INREG2]], [[SEXT_INREG3]] 199 ; GFX9: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[MUL1]], [[C]](s32) 200 ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[ASHR]](s32) 201 ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[ASHR1]](s32) 202 ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY6]](s32), [[COPY7]](s32) 203 ; GFX9: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[BUILD_VECTOR_TRUNC]](<2 x s16>) 204 ; GFX9: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32) 205 ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32) 206 ; GFX9: [[SEXT_INREG4:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY8]], 16 207 ; GFX9: [[COPY9:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 208 ; GFX9: [[SEXT_INREG5:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY9]], 16 209 ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SEXT_INREG4]](s32), [[SEXT_INREG5]](s32) 210 ; GFX9: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>) 211 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1 212 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3 213 %2:_(<2 x s16>) = G_TRUNC %0 214 %3:_(<2 x s16>) = G_TRUNC %1 215 %4:_(<2 x s16>) = G_SMULH %2, %3 216 %5:_(<2 x s32>) = G_SEXT %4 217 $vgpr0_vgpr1 = COPY %5 218... 219 220--- 221name: test_smulh_v2s8 222body: | 223 bb.0: 224 liveins: $vgpr0, $vgpr1, $vgpr2, $vgpr3 225 ; GFX8-LABEL: name: test_smulh_v2s8 226 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 227 ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1 228 ; GFX8: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2 229 ; GFX8: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3 230 ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) 231 ; GFX8: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 8 232 ; GFX8: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC]], [[C]](s16) 233 ; GFX8: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[SHL]], [[C]](s16) 234 ; GFX8: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY2]](s32) 235 ; GFX8: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[TRUNC1]], [[C]](s16) 236 ; GFX8: [[ASHR1:%[0-9]+]]:_(s16) = G_ASHR [[SHL1]], [[C]](s16) 237 ; GFX8: [[MUL:%[0-9]+]]:_(s16) = G_MUL [[ASHR]], [[ASHR1]] 238 ; GFX8: [[ASHR2:%[0-9]+]]:_(s16) = G_ASHR [[MUL]], [[C]](s16) 239 ; GFX8: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32) 240 ; GFX8: [[SHL2:%[0-9]+]]:_(s16) = G_SHL [[TRUNC2]], [[C]](s16) 241 ; GFX8: [[ASHR3:%[0-9]+]]:_(s16) = G_ASHR [[SHL2]], [[C]](s16) 242 ; GFX8: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[COPY3]](s32) 243 ; GFX8: [[SHL3:%[0-9]+]]:_(s16) = G_SHL [[TRUNC3]], [[C]](s16) 244 ; GFX8: [[ASHR4:%[0-9]+]]:_(s16) = G_ASHR [[SHL3]], [[C]](s16) 245 ; GFX8: [[MUL1:%[0-9]+]]:_(s16) = G_MUL [[ASHR3]], [[ASHR4]] 246 ; GFX8: [[ASHR5:%[0-9]+]]:_(s16) = G_ASHR [[MUL1]], [[C]](s16) 247 ; GFX8: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 255 248 ; GFX8: [[COPY4:%[0-9]+]]:_(s16) = COPY [[ASHR2]](s16) 249 ; GFX8: [[AND:%[0-9]+]]:_(s16) = G_AND [[COPY4]], [[C1]] 250 ; GFX8: [[COPY5:%[0-9]+]]:_(s16) = COPY [[ASHR5]](s16) 251 ; GFX8: [[AND1:%[0-9]+]]:_(s16) = G_AND [[COPY5]], [[C1]] 252 ; GFX8: [[SHL4:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C]](s16) 253 ; GFX8: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL4]] 254 ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16) 255 ; GFX8: $vgpr0 = COPY [[ANYEXT]](s32) 256 ; GFX9-LABEL: name: test_smulh_v2s8 257 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 258 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1 259 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2 260 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY $vgpr3 261 ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 262 ; GFX9: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY4]], 8 263 ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32) 264 ; GFX9: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY5]], 8 265 ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG]](s32) 266 ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG1]](s32) 267 ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY6]](s32), [[COPY7]](s32) 268 ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32) 269 ; GFX9: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY8]], 8 270 ; GFX9: [[COPY9:%[0-9]+]]:_(s32) = COPY [[COPY3]](s32) 271 ; GFX9: [[SEXT_INREG3:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY9]], 8 272 ; GFX9: [[COPY10:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG2]](s32) 273 ; GFX9: [[COPY11:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG3]](s32) 274 ; GFX9: [[BUILD_VECTOR_TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY10]](s32), [[COPY11]](s32) 275 ; GFX9: [[MUL:%[0-9]+]]:_(<2 x s16>) = G_MUL [[BUILD_VECTOR_TRUNC]], [[BUILD_VECTOR_TRUNC1]] 276 ; GFX9: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 8 277 ; GFX9: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 278 ; GFX9: [[COPY12:%[0-9]+]]:_(s32) = COPY [[C1]](s32) 279 ; GFX9: [[BUILD_VECTOR_TRUNC2:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY12]](s32), [[C1]](s32) 280 ; GFX9: [[ASHR:%[0-9]+]]:_(<2 x s16>) = G_ASHR [[MUL]], [[BUILD_VECTOR_TRUNC2]](<2 x s16>) 281 ; GFX9: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[ASHR]](<2 x s16>) 282 ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[BITCAST]](s32) 283 ; GFX9: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 284 ; GFX9: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C2]](s32) 285 ; GFX9: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32) 286 ; GFX9: [[C3:%[0-9]+]]:_(s16) = G_CONSTANT i16 255 287 ; GFX9: [[COPY13:%[0-9]+]]:_(s16) = COPY [[TRUNC]](s16) 288 ; GFX9: [[AND:%[0-9]+]]:_(s16) = G_AND [[COPY13]], [[C3]] 289 ; GFX9: [[COPY14:%[0-9]+]]:_(s16) = COPY [[TRUNC1]](s16) 290 ; GFX9: [[AND1:%[0-9]+]]:_(s16) = G_AND [[COPY14]], [[C3]] 291 ; GFX9: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[AND1]], [[C]](s16) 292 ; GFX9: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[SHL]] 293 ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[OR]](s16) 294 ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32) 295 %0:_(s32) = COPY $vgpr0 296 %1:_(s32) = COPY $vgpr1 297 %2:_(s32) = COPY $vgpr2 298 %3:_(s32) = COPY $vgpr3 299 %5:_(s8) = G_TRUNC %0 300 %6:_(s8) = G_TRUNC %1 301 %7:_(s8) = G_TRUNC %2 302 %8:_(s8) = G_TRUNC %3 303 %11:_(<2 x s8>) = G_BUILD_VECTOR %5, %6 304 %12:_(<2 x s8>) = G_BUILD_VECTOR %7, %8 305 %13:_(<2 x s8>) = G_SMULH %11, %12 306 %14:_(s8), %15:_(s8) = G_UNMERGE_VALUES %13 307 %17:_(s16) = G_MERGE_VALUES %14, %15 308 %18:_(s32) = G_ANYEXT %17 309 $vgpr0 = COPY %18 310 311... 312 313--- 314name: test_smulh_v4s8 315body: | 316 bb.0: 317 liveins: $vgpr0, $vgpr1 318 ; GFX8-LABEL: name: test_smulh_v4s8 319 ; GFX8: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 320 ; GFX8: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1 321 ; GFX8: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 322 ; GFX8: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) 323 ; GFX8: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 324 ; GFX8: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C1]](s32) 325 ; GFX8: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24 326 ; GFX8: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32) 327 ; GFX8: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C]](s32) 328 ; GFX8: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C1]](s32) 329 ; GFX8: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C2]](s32) 330 ; GFX8: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) 331 ; GFX8: [[C3:%[0-9]+]]:_(s16) = G_CONSTANT i16 8 332 ; GFX8: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC]], [[C3]](s16) 333 ; GFX8: [[ASHR:%[0-9]+]]:_(s16) = G_ASHR [[SHL]], [[C3]](s16) 334 ; GFX8: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32) 335 ; GFX8: [[SHL1:%[0-9]+]]:_(s16) = G_SHL [[TRUNC1]], [[C3]](s16) 336 ; GFX8: [[ASHR1:%[0-9]+]]:_(s16) = G_ASHR [[SHL1]], [[C3]](s16) 337 ; GFX8: [[MUL:%[0-9]+]]:_(s16) = G_MUL [[ASHR]], [[ASHR1]] 338 ; GFX8: [[ASHR2:%[0-9]+]]:_(s16) = G_ASHR [[MUL]], [[C3]](s16) 339 ; GFX8: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32) 340 ; GFX8: [[SHL2:%[0-9]+]]:_(s16) = G_SHL [[TRUNC2]], [[C3]](s16) 341 ; GFX8: [[ASHR3:%[0-9]+]]:_(s16) = G_ASHR [[SHL2]], [[C3]](s16) 342 ; GFX8: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR3]](s32) 343 ; GFX8: [[SHL3:%[0-9]+]]:_(s16) = G_SHL [[TRUNC3]], [[C3]](s16) 344 ; GFX8: [[ASHR4:%[0-9]+]]:_(s16) = G_ASHR [[SHL3]], [[C3]](s16) 345 ; GFX8: [[MUL1:%[0-9]+]]:_(s16) = G_MUL [[ASHR3]], [[ASHR4]] 346 ; GFX8: [[ASHR5:%[0-9]+]]:_(s16) = G_ASHR [[MUL1]], [[C3]](s16) 347 ; GFX8: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR1]](s32) 348 ; GFX8: [[SHL4:%[0-9]+]]:_(s16) = G_SHL [[TRUNC4]], [[C3]](s16) 349 ; GFX8: [[ASHR6:%[0-9]+]]:_(s16) = G_ASHR [[SHL4]], [[C3]](s16) 350 ; GFX8: [[TRUNC5:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR4]](s32) 351 ; GFX8: [[SHL5:%[0-9]+]]:_(s16) = G_SHL [[TRUNC5]], [[C3]](s16) 352 ; GFX8: [[ASHR7:%[0-9]+]]:_(s16) = G_ASHR [[SHL5]], [[C3]](s16) 353 ; GFX8: [[MUL2:%[0-9]+]]:_(s16) = G_MUL [[ASHR6]], [[ASHR7]] 354 ; GFX8: [[ASHR8:%[0-9]+]]:_(s16) = G_ASHR [[MUL2]], [[C3]](s16) 355 ; GFX8: [[TRUNC6:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR2]](s32) 356 ; GFX8: [[SHL6:%[0-9]+]]:_(s16) = G_SHL [[TRUNC6]], [[C3]](s16) 357 ; GFX8: [[ASHR9:%[0-9]+]]:_(s16) = G_ASHR [[SHL6]], [[C3]](s16) 358 ; GFX8: [[TRUNC7:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR5]](s32) 359 ; GFX8: [[SHL7:%[0-9]+]]:_(s16) = G_SHL [[TRUNC7]], [[C3]](s16) 360 ; GFX8: [[ASHR10:%[0-9]+]]:_(s16) = G_ASHR [[SHL7]], [[C3]](s16) 361 ; GFX8: [[MUL3:%[0-9]+]]:_(s16) = G_MUL [[ASHR9]], [[ASHR10]] 362 ; GFX8: [[ASHR11:%[0-9]+]]:_(s16) = G_ASHR [[MUL3]], [[C3]](s16) 363 ; GFX8: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 364 ; GFX8: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ASHR2]](s16) 365 ; GFX8: [[AND:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C4]] 366 ; GFX8: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[ASHR5]](s16) 367 ; GFX8: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ANYEXT1]], [[C4]] 368 ; GFX8: [[SHL8:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C]](s32) 369 ; GFX8: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL8]] 370 ; GFX8: [[ANYEXT2:%[0-9]+]]:_(s32) = G_ANYEXT [[ASHR8]](s16) 371 ; GFX8: [[AND2:%[0-9]+]]:_(s32) = G_AND [[ANYEXT2]], [[C4]] 372 ; GFX8: [[SHL9:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[C1]](s32) 373 ; GFX8: [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL9]] 374 ; GFX8: [[ANYEXT3:%[0-9]+]]:_(s32) = G_ANYEXT [[ASHR11]](s16) 375 ; GFX8: [[AND3:%[0-9]+]]:_(s32) = G_AND [[ANYEXT3]], [[C4]] 376 ; GFX8: [[SHL10:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C2]](s32) 377 ; GFX8: [[OR2:%[0-9]+]]:_(s32) = G_OR [[OR1]], [[SHL10]] 378 ; GFX8: $vgpr0 = COPY [[OR2]](s32) 379 ; GFX9-LABEL: name: test_smulh_v4s8 380 ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 381 ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1 382 ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 383 ; GFX9: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) 384 ; GFX9: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 385 ; GFX9: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C1]](s32) 386 ; GFX9: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24 387 ; GFX9: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32) 388 ; GFX9: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C]](s32) 389 ; GFX9: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C1]](s32) 390 ; GFX9: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C2]](s32) 391 ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 392 ; GFX9: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY2]], 8 393 ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32) 394 ; GFX9: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 8 395 ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG]](s32) 396 ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG1]](s32) 397 ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY4]](s32), [[COPY5]](s32) 398 ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32) 399 ; GFX9: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY6]], 8 400 ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[LSHR3]](s32) 401 ; GFX9: [[SEXT_INREG3:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY7]], 8 402 ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG2]](s32) 403 ; GFX9: [[COPY9:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG3]](s32) 404 ; GFX9: [[BUILD_VECTOR_TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY8]](s32), [[COPY9]](s32) 405 ; GFX9: [[MUL:%[0-9]+]]:_(<2 x s16>) = G_MUL [[BUILD_VECTOR_TRUNC]], [[BUILD_VECTOR_TRUNC1]] 406 ; GFX9: [[COPY10:%[0-9]+]]:_(s32) = COPY [[C]](s32) 407 ; GFX9: [[COPY11:%[0-9]+]]:_(s32) = COPY [[C]](s32) 408 ; GFX9: [[BUILD_VECTOR_TRUNC2:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY10]](s32), [[COPY11]](s32) 409 ; GFX9: [[ASHR:%[0-9]+]]:_(<2 x s16>) = G_ASHR [[MUL]], [[BUILD_VECTOR_TRUNC2]](<2 x s16>) 410 ; GFX9: [[COPY12:%[0-9]+]]:_(s32) = COPY [[LSHR1]](s32) 411 ; GFX9: [[SEXT_INREG4:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY12]], 8 412 ; GFX9: [[COPY13:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32) 413 ; GFX9: [[SEXT_INREG5:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY13]], 8 414 ; GFX9: [[COPY14:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG4]](s32) 415 ; GFX9: [[COPY15:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG5]](s32) 416 ; GFX9: [[BUILD_VECTOR_TRUNC3:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY14]](s32), [[COPY15]](s32) 417 ; GFX9: [[COPY16:%[0-9]+]]:_(s32) = COPY [[LSHR4]](s32) 418 ; GFX9: [[SEXT_INREG6:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY16]], 8 419 ; GFX9: [[COPY17:%[0-9]+]]:_(s32) = COPY [[LSHR5]](s32) 420 ; GFX9: [[SEXT_INREG7:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY17]], 8 421 ; GFX9: [[COPY18:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG6]](s32) 422 ; GFX9: [[COPY19:%[0-9]+]]:_(s32) = COPY [[SEXT_INREG7]](s32) 423 ; GFX9: [[BUILD_VECTOR_TRUNC4:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY18]](s32), [[COPY19]](s32) 424 ; GFX9: [[MUL1:%[0-9]+]]:_(<2 x s16>) = G_MUL [[BUILD_VECTOR_TRUNC3]], [[BUILD_VECTOR_TRUNC4]] 425 ; GFX9: [[COPY20:%[0-9]+]]:_(s32) = COPY [[C]](s32) 426 ; GFX9: [[COPY21:%[0-9]+]]:_(s32) = COPY [[C]](s32) 427 ; GFX9: [[BUILD_VECTOR_TRUNC5:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY20]](s32), [[COPY21]](s32) 428 ; GFX9: [[ASHR1:%[0-9]+]]:_(<2 x s16>) = G_ASHR [[MUL1]], [[BUILD_VECTOR_TRUNC5]](<2 x s16>) 429 ; GFX9: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[ASHR]](<2 x s16>) 430 ; GFX9: [[LSHR6:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C1]](s32) 431 ; GFX9: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[ASHR1]](<2 x s16>) 432 ; GFX9: [[LSHR7:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C1]](s32) 433 ; GFX9: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 434 ; GFX9: [[COPY22:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32) 435 ; GFX9: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY22]], [[C3]] 436 ; GFX9: [[COPY23:%[0-9]+]]:_(s32) = COPY [[LSHR6]](s32) 437 ; GFX9: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY23]], [[C3]] 438 ; GFX9: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C]](s32) 439 ; GFX9: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]] 440 ; GFX9: [[COPY24:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32) 441 ; GFX9: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY24]], [[C3]] 442 ; GFX9: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND2]], [[C1]](s32) 443 ; GFX9: [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[SHL1]] 444 ; GFX9: [[COPY25:%[0-9]+]]:_(s32) = COPY [[LSHR7]](s32) 445 ; GFX9: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY25]], [[C3]] 446 ; GFX9: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C2]](s32) 447 ; GFX9: [[OR2:%[0-9]+]]:_(s32) = G_OR [[OR1]], [[SHL2]] 448 ; GFX9: $vgpr0 = COPY [[OR2]](s32) 449 %0:_(s32) = COPY $vgpr0 450 %1:_(s32) = COPY $vgpr1 451 %2:_(s8), %3:_(s8), %4:_(s8), %5:_(s8) = G_UNMERGE_VALUES %0 452 %6:_(s8), %7:_(s8), %8:_(s8), %9:_(s8) = G_UNMERGE_VALUES %1 453 %10:_(<4 x s8>) = G_BUILD_VECTOR %2:_(s8), %3:_(s8), %4:_(s8), %5:_(s8) 454 %11:_(<4 x s8>) = G_BUILD_VECTOR %6:_(s8), %7:_(s8), %8:_(s8), %9:_(s8) 455 %12:_(<4 x s8>) = G_SMULH %10:_, %11:_ 456 %13:_(s8), %14:_(s8), %15:_(s8), %16:_(s8) = G_UNMERGE_VALUES %12:_(<4 x s8>) 457 %17:_(s32) = G_MERGE_VALUES %13, %14, %15, %16 458 $vgpr0 = COPY %17 459... 460