1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer -global-isel-abort=0 -o - %s | FileCheck %s 3 4--- 5name: test_trunc_s64_to_s32 6body: | 7 bb.0: 8 liveins: $vgpr0_vgpr1 9 10 ; CHECK-LABEL: name: test_trunc_s64_to_s32 11 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 12 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) 13 ; CHECK: $vgpr0 = COPY [[TRUNC]](s32) 14 %0:_(s64) = COPY $vgpr0_vgpr1 15 %1:_(s32) = G_TRUNC %0 16 $vgpr0 = COPY %1 17... 18 19--- 20name: test_trunc_s64_to_s16 21body: | 22 bb.0: 23 liveins: $vgpr0_vgpr1 24 25 ; CHECK-LABEL: name: test_trunc_s64_to_s16 26 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 27 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s64) 28 ; CHECK: S_ENDPGM 0, implicit [[TRUNC]](s16) 29 %0:_(s64) = COPY $vgpr0_vgpr1 30 %1:_(s16) = G_TRUNC %0 31 S_ENDPGM 0, implicit %1 32... 33 34--- 35name: test_trunc_v2s32_to_v2s16 36body: | 37 bb.0: 38 liveins: $vgpr0_vgpr1 39 40 ; CHECK-LABEL: name: test_trunc_v2s32_to_v2s16 41 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1 42 ; CHECK: [[TRUNC:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[COPY]](<2 x s32>) 43 ; CHECK: $vgpr0 = COPY [[TRUNC]](<2 x s16>) 44 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1 45 %1:_(<2 x s16>) = G_TRUNC %0 46 $vgpr0 = COPY %1 47... 48 49--- 50name: test_trunc_v3s32_to_v3s16 51body: | 52 bb.0: 53 liveins: $vgpr0_vgpr1_vgpr2 54 55 ; CHECK-LABEL: name: test_trunc_v3s32_to_v3s16 56 ; CHECK: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2 57 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>) 58 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[UV]](s32) 59 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[UV1]](s32) 60 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[UV2]](s32) 61 ; CHECK: S_ENDPGM 0, implicit [[TRUNC]](s16), implicit [[TRUNC1]](s16), implicit [[TRUNC2]](s16) 62 %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2 63 %1:_(<3 x s16>) = G_TRUNC %0 64 %2:_(s16), %3:_(s16), %4:_(s16) = G_UNMERGE_VALUES %1 65 S_ENDPGM 0, implicit %2, implicit %3, implicit %4 66... 67 68--- 69name: test_trunc_v4s32_to_v4s16 70body: | 71 bb.0: 72 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 73 74 ; CHECK-LABEL: name: test_trunc_v4s32_to_v4s16 75 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 76 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s32>), [[UV1:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[COPY]](<4 x s32>) 77 ; CHECK: [[TRUNC:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV]](<2 x s32>) 78 ; CHECK: [[TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV1]](<2 x s32>) 79 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[TRUNC]](<2 x s16>), [[TRUNC1]](<2 x s16>) 80 ; CHECK: $vgpr0_vgpr1 = COPY [[CONCAT_VECTORS]](<4 x s16>) 81 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 82 %1:_(<4 x s16>) = G_TRUNC %0 83 $vgpr0_vgpr1 = COPY %1 84... 85 86--- 87name: test_trunc_v8s32_to_v8s16 88body: | 89 bb.0: 90 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 91 92 ; CHECK-LABEL: name: test_trunc_v8s32_to_v8s16 93 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 94 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s32>), [[UV1:%[0-9]+]]:_(<2 x s32>), [[UV2:%[0-9]+]]:_(<2 x s32>), [[UV3:%[0-9]+]]:_(<2 x s32>) = G_UNMERGE_VALUES [[COPY]](<8 x s32>) 95 ; CHECK: [[TRUNC:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV]](<2 x s32>) 96 ; CHECK: [[TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV1]](<2 x s32>) 97 ; CHECK: [[TRUNC2:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV2]](<2 x s32>) 98 ; CHECK: [[TRUNC3:%[0-9]+]]:_(<2 x s16>) = G_TRUNC [[UV3]](<2 x s32>) 99 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<8 x s16>) = G_CONCAT_VECTORS [[TRUNC]](<2 x s16>), [[TRUNC1]](<2 x s16>), [[TRUNC2]](<2 x s16>), [[TRUNC3]](<2 x s16>) 100 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[CONCAT_VECTORS]](<8 x s16>) 101 %0:_(<8 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 102 %1:_(<8 x s16>) = G_TRUNC %0 103 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1 104... 105 106--- 107name: test_trunc_v2s64_to_v2s16 108body: | 109 bb.0: 110 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 111 112 ; CHECK-LABEL: name: test_trunc_v2s64_to_v2s16 113 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 114 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>) 115 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 116 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[UV]](s64) 117 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]] 118 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[UV1]](s64) 119 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]] 120 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 121 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32) 122 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]] 123 ; CHECK: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32) 124 ; CHECK: $vgpr0 = COPY [[BITCAST]](<2 x s16>) 125 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 126 %1:_(<2 x s16>) = G_TRUNC %0 127 $vgpr0 = COPY %1 128... 129 130--- 131name: test_trunc_v4s64_to_v4s16 132body: | 133 bb.0: 134 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 135 136 ; CHECK-LABEL: name: test_trunc_v4s64_to_v4s16 137 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 138 ; CHECK: [[UV:%[0-9]+]]:_(<2 x s64>), [[UV1:%[0-9]+]]:_(<2 x s64>) = G_UNMERGE_VALUES [[COPY]](<4 x s64>) 139 ; CHECK: [[UV2:%[0-9]+]]:_(s64), [[UV3:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[UV]](<2 x s64>) 140 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 141 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[UV2]](s64) 142 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]] 143 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[UV3]](s64) 144 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]] 145 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 146 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32) 147 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]] 148 ; CHECK: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32) 149 ; CHECK: [[UV4:%[0-9]+]]:_(s64), [[UV5:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[UV1]](<2 x s64>) 150 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[UV4]](s64) 151 ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[TRUNC2]], [[C]] 152 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[UV5]](s64) 153 ; CHECK: [[AND3:%[0-9]+]]:_(s32) = G_AND [[TRUNC3]], [[C]] 154 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C1]](s32) 155 ; CHECK: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]] 156 ; CHECK: [[BITCAST1:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32) 157 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[BITCAST]](<2 x s16>), [[BITCAST1]](<2 x s16>) 158 ; CHECK: $vgpr0_vgpr1 = COPY [[CONCAT_VECTORS]](<4 x s16>) 159 %0:_(<4 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 160 %1:_(<4 x s16>) = G_TRUNC %0 161 $vgpr0_vgpr1 = COPY %1 162... 163 164--- 165name: test_trunc_s64_to_s1 166body: | 167 bb.0: 168 liveins: $vgpr0_vgpr1 169 170 ; CHECK-LABEL: name: test_trunc_s64_to_s1 171 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 172 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[COPY]](s64) 173 ; CHECK: S_ENDPGM 0, implicit [[TRUNC]](s1) 174 %0:_(s64) = COPY $vgpr0_vgpr1 175 %1:_(s1) = G_TRUNC %0 176 S_ENDPGM 0, implicit %1 177... 178 179--- 180name: test_trunc_s32_to_s1 181body: | 182 bb.0: 183 liveins: $vgpr0 184 185 ; CHECK-LABEL: name: test_trunc_s32_to_s1 186 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 187 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[COPY]](s32) 188 ; CHECK: S_ENDPGM 0, implicit [[TRUNC]](s1) 189 %0:_(s32) = COPY $vgpr0 190 %1:_(s1) = G_TRUNC %0 191 S_ENDPGM 0, implicit %1 192... 193 194--- 195name: test_trunc_s16_to_s1 196body: | 197 bb.0: 198 liveins: $vgpr0 199 200 ; CHECK-LABEL: name: test_trunc_s16_to_s1 201 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 202 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[COPY]](s32) 203 ; CHECK: S_ENDPGM 0, implicit [[TRUNC]](s1) 204 %0:_(s32) = COPY $vgpr0 205 %1:_(s16) = G_TRUNC %0 206 %2:_(s1) = G_TRUNC %1 207 S_ENDPGM 0, implicit %2 208... 209 210--- 211name: test_trunc_v4s32_to_v4s1 212body: | 213 bb.0: 214 liveins: $vgpr0_vgpr1_vgpr2_vgpr3, $vgpr4_vgpr5_vgpr6_vgpr7, $vgpr8_vgpr9_vgpr10_vgpr11 215 216 ; CHECK-LABEL: name: test_trunc_v4s32_to_v4s1 217 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 218 ; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 219 ; CHECK: [[COPY2:%[0-9]+]]:_(<4 x s32>) = COPY $vgpr8_vgpr9_vgpr10_vgpr11 220 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<4 x s32>) 221 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[UV]](s32) 222 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s1) = G_TRUNC [[UV1]](s32) 223 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s1) = G_TRUNC [[UV2]](s32) 224 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s1) = G_TRUNC [[UV3]](s32) 225 ; CHECK: [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32), [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<4 x s32>) 226 ; CHECK: [[UV8:%[0-9]+]]:_(s32), [[UV9:%[0-9]+]]:_(s32), [[UV10:%[0-9]+]]:_(s32), [[UV11:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY2]](<4 x s32>) 227 ; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[UV4]], [[UV8]] 228 ; CHECK: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC1]](s1), [[UV5]], [[UV9]] 229 ; CHECK: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC2]](s1), [[UV6]], [[UV10]] 230 ; CHECK: [[SELECT3:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC3]](s1), [[UV7]], [[UV11]] 231 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[SELECT]](s32), [[SELECT1]](s32), [[SELECT2]](s32), [[SELECT3]](s32) 232 ; CHECK: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<4 x s32>) 233 %0:_(<4 x s32>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 234 %1:_(<4 x s32>) = COPY $vgpr4_vgpr5_vgpr6_vgpr7 235 %2:_(<4 x s32>) = COPY $vgpr8_vgpr9_vgpr10_vgpr11 236 %3:_(<4 x s1>) = G_TRUNC %0 237 %4:_(<4 x s32>) = G_SELECT %3, %1, %2 238 S_ENDPGM 0, implicit %4 239... 240 241--- 242name: test_trunc_v2s64_to_v2s32 243body: | 244 bb.0: 245 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 246 247 ; CHECK-LABEL: name: test_trunc_v2s64_to_v2s32 248 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 249 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>) 250 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[UV]](s64) 251 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[UV1]](s64) 252 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[TRUNC]](s32), [[TRUNC1]](s32) 253 ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>) 254 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 255 %1:_(<2 x s32>) = G_TRUNC %0 256 $vgpr0_vgpr1 = COPY %1 257... 258 259--- 260name: test_trunc_v4s64_to_v4s32 261body: | 262 bb.0: 263 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 264 265 ; CHECK-LABEL: name: test_trunc_v4s64_to_v4s32 266 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 267 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64), [[UV2:%[0-9]+]]:_(s64), [[UV3:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<4 x s64>) 268 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[UV]](s64) 269 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[UV1]](s64) 270 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[UV2]](s64) 271 ; CHECK: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[UV3]](s64) 272 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[TRUNC]](s32), [[TRUNC1]](s32), [[TRUNC2]](s32), [[TRUNC3]](s32) 273 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<4 x s32>) 274 %0:_(<4 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 275 %1:_(<4 x s32>) = G_TRUNC %0 276 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1 277... 278 279--- 280name: test_trunc_v2s128_to_v2s64 281body: | 282 bb.0: 283 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 284 285 ; CHECK-LABEL: name: test_trunc_v2s128_to_v2s64 286 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s128>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 287 ; CHECK: [[UV:%[0-9]+]]:_(s128), [[UV1:%[0-9]+]]:_(s128) = G_UNMERGE_VALUES [[COPY]](<2 x s128>) 288 ; CHECK: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[UV]](s128) 289 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s64) = G_TRUNC [[UV1]](s128) 290 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[TRUNC]](s64), [[TRUNC1]](s64) 291 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>) 292 %0:_(<2 x s128>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 293 %1:_(<2 x s64>) = G_TRUNC %0 294 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1 295... 296 297--- 298name: test_trunc_v2s128_to_v2s32 299body: | 300 bb.0: 301 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 302 303 ; CHECK-LABEL: name: test_trunc_v2s128_to_v2s32 304 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s128>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 305 ; CHECK: [[UV:%[0-9]+]]:_(s128), [[UV1:%[0-9]+]]:_(s128) = G_UNMERGE_VALUES [[COPY]](<2 x s128>) 306 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[UV]](s128) 307 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[UV1]](s128) 308 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[TRUNC]](s32), [[TRUNC1]](s32) 309 ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>) 310 %0:_(<2 x s128>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 311 %1:_(<2 x s32>) = G_TRUNC %0 312 $vgpr0_vgpr1 = COPY %1 313... 314 315--- 316name: test_trunc_v2s128_to_v2s16 317body: | 318 bb.0: 319 liveins: $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 320 321 ; CHECK-LABEL: name: test_trunc_v2s128_to_v2s16 322 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s128>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 323 ; CHECK: [[UV:%[0-9]+]]:_(s128), [[UV1:%[0-9]+]]:_(s128) = G_UNMERGE_VALUES [[COPY]](<2 x s128>) 324 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 325 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[UV]](s128) 326 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]] 327 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[UV1]](s128) 328 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]] 329 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 330 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32) 331 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]] 332 ; CHECK: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32) 333 ; CHECK: $vgpr0 = COPY [[BITCAST]](<2 x s16>) 334 %0:_(<2 x s128>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3_vgpr4_vgpr5_vgpr6_vgpr7 335 %1:_(<2 x s16>) = G_TRUNC %0 336 $vgpr0 = COPY %1 337... 338 339--- 340name: test_trunc_v2s96_to_v2s32 341body: | 342 bb.0: 343 liveins: $vgpr0_vgpr1_vgpr2, $vgpr3_vgpr4_vgpr5 344 345 ; CHECK-LABEL: name: test_trunc_v2s96_to_v2s32 346 ; CHECK: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2 347 ; CHECK: [[COPY1:%[0-9]+]]:_(s96) = COPY $vgpr3_vgpr4_vgpr5 348 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s96) 349 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s96) 350 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[TRUNC]](s32), [[TRUNC1]](s32) 351 ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>) 352 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2 353 %1:_(s96) = COPY $vgpr3_vgpr4_vgpr5 354 %2:_(<2 x s96>) = G_BUILD_VECTOR %0, %1 355 %3:_(<2 x s32>) = G_TRUNC %2 356 $vgpr0_vgpr1 = COPY %3 357... 358 359--- 360name: test_trunc_v2s96_to_v2s16 361body: | 362 bb.0: 363 liveins: $vgpr0_vgpr1_vgpr2, $vgpr3_vgpr4_vgpr5 364 365 ; CHECK-LABEL: name: test_trunc_v2s96_to_v2s16 366 ; CHECK: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2 367 ; CHECK: [[COPY1:%[0-9]+]]:_(s96) = COPY $vgpr3_vgpr4_vgpr5 368 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 369 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s96) 370 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]] 371 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s96) 372 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]] 373 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 374 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C1]](s32) 375 ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]] 376 ; CHECK: [[BITCAST:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32) 377 ; CHECK: $vgpr0 = COPY [[BITCAST]](<2 x s16>) 378 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2 379 %1:_(s96) = COPY $vgpr3_vgpr4_vgpr5 380 %2:_(<2 x s96>) = G_BUILD_VECTOR %0, %1 381 %3:_(<2 x s16>) = G_TRUNC %2 382 $vgpr0 = COPY %3 383... 384 385--- 386name: test_trunc_v2s96_to_v2s8 387body: | 388 bb.0: 389 liveins: $vgpr0_vgpr1_vgpr2, $vgpr3_vgpr4_vgpr5 390 391 ; CHECK-LABEL: name: test_trunc_v2s96_to_v2s8 392 ; CHECK: [[COPY:%[0-9]+]]:_(s96) = COPY $vgpr0_vgpr1_vgpr2 393 ; CHECK: [[COPY1:%[0-9]+]]:_(s96) = COPY $vgpr3_vgpr4_vgpr5 394 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s96) 395 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s96) 396 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[TRUNC]](s32), [[TRUNC1]](s32) 397 ; CHECK: S_ENDPGM 0, implicit [[BUILD_VECTOR]](<2 x s32>) 398 %0:_(s96) = COPY $vgpr0_vgpr1_vgpr2 399 %1:_(s96) = COPY $vgpr3_vgpr4_vgpr5 400 %2:_(<2 x s96>) = G_BUILD_VECTOR %0, %1 401 %3:_(<2 x s8>) = G_TRUNC %2 402 %4:_(<2 x s32>) = G_ANYEXT %3 403 S_ENDPGM 0, implicit %4 404... 405