1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2# RUN: llc -O0 -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s 3 4--- | 5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" 6 7 define void @bitcast_s32_gpr() { ret void } 8 define void @bitcast_s32_fpr() { ret void } 9 define void @bitcast_s32_gpr_fpr() { ret void } 10 define void @bitcast_s32_fpr_gpr() { ret void } 11 define void @bitcast_s64_gpr() { ret void } 12 define void @bitcast_s64_fpr() { ret void } 13 define void @bitcast_s64_gpr_fpr() { ret void } 14 define void @bitcast_s64_fpr_gpr() { ret void } 15 define void @bitcast_s64_v2f32_fpr() { ret void } 16 define void @bitcast_s64_v8i8_fpr() { ret void } 17... 18 19--- 20name: bitcast_s32_gpr 21legalized: true 22regBankSelected: true 23registers: 24 - { id: 0, class: gpr } 25 - { id: 1, class: fpr } 26 - { id: 2, class: gpr } 27body: | 28 bb.0: 29 liveins: $w0 30 31 ; CHECK-LABEL: name: bitcast_s32_gpr 32 ; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY $w0 33 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY [[COPY]] 34 ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[COPY1]] 35 ; CHECK: $w0 = COPY [[COPY2]] 36 %0(s32) = COPY $w0 37 %1(<2 x s16>) = G_BITCAST %0 38 %2(s32) = G_BITCAST %1 39 $w0 = COPY %2 40... 41 42--- 43name: bitcast_s32_fpr 44legalized: true 45regBankSelected: true 46 47registers: 48 - { id: 0, class: fpr } 49 - { id: 1, class: gpr } 50 - { id: 2, class: fpr } 51body: | 52 bb.0: 53 liveins: $s0 54 55 ; CHECK-LABEL: name: bitcast_s32_fpr 56 ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0 57 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[COPY]] 58 ; CHECK: [[COPY2:%[0-9]+]]:fpr32 = COPY [[COPY1]] 59 ; CHECK: $s0 = COPY [[COPY2]] 60 %0(s32) = COPY $s0 61 %1(<2 x s16>) = G_BITCAST %0 62 %2(s32) = G_BITCAST %1 63 $s0 = COPY %2 64... 65 66--- 67name: bitcast_s32_gpr_fpr 68legalized: true 69regBankSelected: true 70 71registers: 72 - { id: 0, class: gpr } 73 - { id: 1, class: fpr } 74 75body: | 76 bb.0: 77 liveins: $w0 78 79 ; CHECK-LABEL: name: bitcast_s32_gpr_fpr 80 ; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY $w0 81 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY [[COPY]] 82 ; CHECK: $s0 = COPY [[COPY1]] 83 %0(s32) = COPY $w0 84 %1(<2 x s16>) = G_BITCAST %0 85 $s0 = COPY %1 86... 87 88--- 89name: bitcast_s32_fpr_gpr 90legalized: true 91regBankSelected: true 92 93registers: 94 - { id: 0, class: fpr } 95 - { id: 1, class: gpr } 96 97body: | 98 bb.0: 99 liveins: $s0 100 101 ; CHECK-LABEL: name: bitcast_s32_fpr_gpr 102 ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0 103 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[COPY]] 104 ; CHECK: $w0 = COPY [[COPY1]] 105 %0(<2 x s16>) = COPY $s0 106 %1(s32) = G_BITCAST %0 107 $w0 = COPY %1(s32) 108... 109 110--- 111name: bitcast_s64_gpr 112legalized: true 113regBankSelected: true 114 115registers: 116 - { id: 0, class: gpr } 117 - { id: 1, class: fpr } 118 - { id: 2, class: gpr } 119 120body: | 121 bb.0: 122 liveins: $x0 123 124 ; CHECK-LABEL: name: bitcast_s64_gpr 125 ; CHECK: [[COPY:%[0-9]+]]:gpr64all = COPY $x0 126 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY [[COPY]] 127 ; CHECK: [[COPY2:%[0-9]+]]:gpr64 = COPY [[COPY1]] 128 ; CHECK: $x0 = COPY [[COPY2]] 129 %0(s64) = COPY $x0 130 %1(<2 x s32>) = G_BITCAST %0 131 %2(s64) = G_BITCAST %1 132 $x0 = COPY %2(s64) 133... 134 135--- 136name: bitcast_s64_fpr 137legalized: true 138regBankSelected: true 139 140registers: 141 - { id: 0, class: fpr } 142 - { id: 1, class: fpr } 143 144body: | 145 bb.0: 146 liveins: $d0 147 148 ; CHECK-LABEL: name: bitcast_s64_fpr 149 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0 150 ; CHECK: $d0 = COPY [[COPY]] 151 %0(s64) = COPY $d0 152 %1(<2 x s32>) = G_BITCAST %0 153 $d0 = COPY %1 154... 155 156--- 157name: bitcast_s64_gpr_fpr 158legalized: true 159regBankSelected: true 160 161registers: 162 - { id: 0, class: gpr } 163 - { id: 1, class: fpr } 164body: | 165 bb.0: 166 liveins: $x0 167 168 ; CHECK-LABEL: name: bitcast_s64_gpr_fpr 169 ; CHECK: [[COPY:%[0-9]+]]:gpr64all = COPY $x0 170 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY [[COPY]] 171 ; CHECK: $d0 = COPY [[COPY1]] 172 %0(s64) = COPY $x0 173 %1(<2 x s32>) = G_BITCAST %0 174 $d0 = COPY %1 175... 176 177--- 178name: bitcast_s64_fpr_gpr 179legalized: true 180regBankSelected: true 181 182registers: 183 - { id: 0, class: fpr } 184 - { id: 1, class: gpr } 185 186body: | 187 bb.0: 188 liveins: $d0 189 190 ; CHECK-LABEL: name: bitcast_s64_fpr_gpr 191 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0 192 ; CHECK: [[COPY1:%[0-9]+]]:gpr64all = COPY [[COPY]] 193 ; CHECK: $x0 = COPY [[COPY1]] 194 %0(s64) = COPY $d0 195 %1(<2 x s32>) = G_BITCAST %0 196 $x0 = COPY %1 197... 198 199--- 200name: bitcast_s64_v2f32_fpr 201legalized: true 202regBankSelected: true 203 204registers: 205 - { id: 0, class: fpr } 206 - { id: 1, class: fpr } 207 208body: | 209 bb.0: 210 liveins: $d0 211 212 ; CHECK-LABEL: name: bitcast_s64_v2f32_fpr 213 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0 214 ; CHECK: $x0 = COPY [[COPY]] 215 %0(s64) = COPY $d0 216 %1(<2 x s32>) = G_BITCAST %0 217 $x0 = COPY %1(<2 x s32>) 218... 219 220--- 221name: bitcast_s64_v8i8_fpr 222legalized: true 223regBankSelected: true 224 225registers: 226 - { id: 0, class: fpr } 227 - { id: 1, class: fpr } 228 229body: | 230 bb.0: 231 liveins: $d0 232 233 ; CHECK-LABEL: name: bitcast_s64_v8i8_fpr 234 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0 235 ; CHECK: $x0 = COPY [[COPY]] 236 %0(s64) = COPY $d0 237 %1(<8 x s8>) = G_BITCAST %0 238 $x0 = COPY %1(<8 x s8>) 239... 240