1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -verify-machineinstrs -mtriple aarch64-unknown-unknown -run-pass=regbankselect %s -o - | FileCheck %s
4 # The following should hold here:
6 # 1) The first and second operands of G_INSERT_VECTOR_ELT should be FPRs since
9 # 2) The third operand should be on the register bank given in the test name
10 # (e.g, v4s32_fpr). AArch64 supports native inserts of GPRs, so we need to
13 # 3) The fourth operand should be a GPR, since it's a constant.
18 tracksRegLiveness: true
23 ; CHECK-LABEL: name: v4s32_fpr
24 ; CHECK: liveins: $q1, $s0
25 ; CHECK: [[COPY:%[0-9]+]]:fpr(s32) = COPY $s0
26 ; CHECK: [[COPY1:%[0-9]+]]:fpr(<4 x s32>) = COPY $q1
27 ; CHECK: [[C:%[0-9]+]]:gpr(s64) = G_CONSTANT i64 1
28 ; CHECK: [[IVEC:%[0-9]+]]:fpr(<4 x s32>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s32), [[C]](s64)
29 ; CHECK: $q0 = COPY [[IVEC]](<4 x s32>)
30 ; CHECK: RET_ReallyLR implicit $q0
32 %1:_(<4 x s32>) = COPY $q1
33 %3:_(s64) = G_CONSTANT i64 1
34 %2:_(<4 x s32>) = G_INSERT_VECTOR_ELT %1, %0(s32), %3(s64)
35 $q0 = COPY %2(<4 x s32>)
36 RET_ReallyLR implicit $q0
43 tracksRegLiveness: true
48 ; CHECK-LABEL: name: v4s32_gpr
49 ; CHECK: liveins: $q0, $w0
51 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr(s32) = COPY $w0
52 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr(<4 x s32>) = COPY $q0
53 ; CHECK-NEXT: [[C:%[0-9]+]]:gpr(s64) = G_CONSTANT i64 1
54 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:fpr(<4 x s32>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s32), [[C]](s64)
55 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<4 x s32>)
56 ; CHECK-NEXT: RET_ReallyLR implicit $q0
58 %1:_(<4 x s32>) = COPY $q0
59 %3:_(s64) = G_CONSTANT i64 1
60 %2:_(<4 x s32>) = G_INSERT_VECTOR_ELT %1, %0(s32), %3(s64)
61 $q0 = COPY %2(<4 x s32>)
62 RET_ReallyLR implicit $q0
69 tracksRegLiveness: true
74 ; CHECK-LABEL: name: v2s64_fpr
75 ; CHECK: liveins: $d0, $q1
77 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr(s64) = COPY $d0
78 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr(<2 x s64>) = COPY $q1
79 ; CHECK-NEXT: [[C:%[0-9]+]]:gpr(s64) = G_CONSTANT i64 1
80 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:fpr(<2 x s64>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s64), [[C]](s64)
81 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<2 x s64>)
82 ; CHECK-NEXT: RET_ReallyLR implicit $q0
84 %1:_(<2 x s64>) = COPY $q1
85 %3:_(s64) = G_CONSTANT i64 1
86 %2:_(<2 x s64>) = G_INSERT_VECTOR_ELT %1, %0(s64), %3(s64)
87 $q0 = COPY %2(<2 x s64>)
88 RET_ReallyLR implicit $q0
95 tracksRegLiveness: true
100 ; CHECK-LABEL: name: v2s64_gpr
101 ; CHECK: liveins: $q0, $x0
103 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr(s64) = COPY $x0
104 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr(<2 x s64>) = COPY $q0
105 ; CHECK-NEXT: [[C:%[0-9]+]]:gpr(s64) = G_CONSTANT i64 0
106 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:fpr(<2 x s64>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s64), [[C]](s64)
107 ; CHECK-NEXT: $q0 = COPY [[IVEC]](<2 x s64>)
108 ; CHECK-NEXT: RET_ReallyLR implicit $q0
110 %1:_(<2 x s64>) = COPY $q0
111 %3:_(s64) = G_CONSTANT i64 0
112 %2:_(<2 x s64>) = G_INSERT_VECTOR_ELT %1, %0(s64), %3(s64)
113 $q0 = COPY %2(<2 x s64>)
114 RET_ReallyLR implicit $q0
121 tracksRegLiveness: true
126 ; CHECK-LABEL: name: v2s32_fpr
127 ; CHECK: liveins: $d1, $s0
129 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr(s32) = COPY $s0
130 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr(<2 x s32>) = COPY $d1
131 ; CHECK-NEXT: [[C:%[0-9]+]]:gpr(s64) = G_CONSTANT i64 1
132 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:fpr(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s32), [[C]](s64)
133 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<2 x s32>)
134 ; CHECK-NEXT: RET_ReallyLR implicit $d0
136 %1:_(<2 x s32>) = COPY $d1
137 %3:_(s64) = G_CONSTANT i64 1
138 %2:_(<2 x s32>) = G_INSERT_VECTOR_ELT %1, %0(s32), %3(s64)
139 $d0 = COPY %2(<2 x s32>)
140 RET_ReallyLR implicit $d0
147 tracksRegLiveness: true
152 ; CHECK-LABEL: name: v2s32_gpr
153 ; CHECK: liveins: $d0, $w0
155 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr(s32) = COPY $w0
156 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr(<2 x s32>) = COPY $d0
157 ; CHECK-NEXT: [[C:%[0-9]+]]:gpr(s64) = G_CONSTANT i64 1
158 ; CHECK-NEXT: [[IVEC:%[0-9]+]]:fpr(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s32), [[C]](s64)
159 ; CHECK-NEXT: $d0 = COPY [[IVEC]](<2 x s32>)
160 ; CHECK-NEXT: RET_ReallyLR implicit $d0
162 %1:_(<2 x s32>) = COPY $d0
163 %3:_(s64) = G_CONSTANT i64 1
164 %2:_(<2 x s32>) = G_INSERT_VECTOR_ELT %1, %0(s32), %3(s64)
165 $d0 = COPY %2(<2 x s32>)
166 RET_ReallyLR implicit $d0