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(s32) = G_CONSTANT i32 1
28 ; CHECK: [[IVEC:%[0-9]+]]:fpr(<4 x s32>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s32), [[C]](s32)
29 ; CHECK: $q0 = COPY [[IVEC]](<4 x s32>)
30 ; CHECK: RET_ReallyLR implicit $q0
32 %1:_(<4 x s32>) = COPY $q1
33 %3:_(s32) = G_CONSTANT i32 1
34 %2:_(<4 x s32>) = G_INSERT_VECTOR_ELT %1, %0(s32), %3(s32)
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
50 ; CHECK: [[COPY:%[0-9]+]]:gpr(s32) = COPY $w0
51 ; CHECK: [[COPY1:%[0-9]+]]:fpr(<4 x s32>) = COPY $q0
52 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
53 ; CHECK: [[IVEC:%[0-9]+]]:fpr(<4 x s32>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s32), [[C]](s32)
54 ; CHECK: $q0 = COPY [[IVEC]](<4 x s32>)
55 ; CHECK: RET_ReallyLR implicit $q0
57 %1:_(<4 x s32>) = COPY $q0
58 %3:_(s32) = G_CONSTANT i32 1
59 %2:_(<4 x s32>) = G_INSERT_VECTOR_ELT %1, %0(s32), %3(s32)
60 $q0 = COPY %2(<4 x s32>)
61 RET_ReallyLR implicit $q0
68 tracksRegLiveness: true
73 ; CHECK-LABEL: name: v2s64_fpr
74 ; CHECK: liveins: $d0, $q1
75 ; CHECK: [[COPY:%[0-9]+]]:fpr(s64) = COPY $d0
76 ; CHECK: [[COPY1:%[0-9]+]]:fpr(<2 x s64>) = COPY $q1
77 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
78 ; CHECK: [[IVEC:%[0-9]+]]:fpr(<2 x s64>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s64), [[C]](s32)
79 ; CHECK: $q0 = COPY [[IVEC]](<2 x s64>)
80 ; CHECK: RET_ReallyLR implicit $q0
82 %1:_(<2 x s64>) = COPY $q1
83 %3:_(s32) = G_CONSTANT i32 1
84 %2:_(<2 x s64>) = G_INSERT_VECTOR_ELT %1, %0(s64), %3(s32)
85 $q0 = COPY %2(<2 x s64>)
86 RET_ReallyLR implicit $q0
93 tracksRegLiveness: true
98 ; CHECK-LABEL: name: v2s64_gpr
99 ; CHECK: liveins: $q0, $x0
100 ; CHECK: [[COPY:%[0-9]+]]:gpr(s64) = COPY $x0
101 ; CHECK: [[COPY1:%[0-9]+]]:fpr(<2 x s64>) = COPY $q0
102 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 0
103 ; CHECK: [[IVEC:%[0-9]+]]:fpr(<2 x s64>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s64), [[C]](s32)
104 ; CHECK: $q0 = COPY [[IVEC]](<2 x s64>)
105 ; CHECK: RET_ReallyLR implicit $q0
107 %1:_(<2 x s64>) = COPY $q0
108 %3:_(s32) = G_CONSTANT i32 0
109 %2:_(<2 x s64>) = G_INSERT_VECTOR_ELT %1, %0(s64), %3(s32)
110 $q0 = COPY %2(<2 x s64>)
111 RET_ReallyLR implicit $q0
118 tracksRegLiveness: true
123 ; CHECK-LABEL: name: v2s32_fpr
124 ; CHECK: liveins: $d1, $s0
125 ; CHECK: [[COPY:%[0-9]+]]:fpr(s32) = COPY $s0
126 ; CHECK: [[COPY1:%[0-9]+]]:fpr(<2 x s32>) = COPY $d1
127 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
128 ; CHECK: [[IVEC:%[0-9]+]]:fpr(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s32), [[C]](s32)
129 ; CHECK: $d0 = COPY [[IVEC]](<2 x s32>)
130 ; CHECK: RET_ReallyLR implicit $d0
132 %1:_(<2 x s32>) = COPY $d1
133 %3:_(s32) = G_CONSTANT i32 1
134 %2:_(<2 x s32>) = G_INSERT_VECTOR_ELT %1, %0(s32), %3(s32)
135 $d0 = COPY %2(<2 x s32>)
136 RET_ReallyLR implicit $d0
143 tracksRegLiveness: true
148 ; CHECK-LABEL: name: v2s32_gpr
149 ; CHECK: liveins: $d0, $w0
150 ; CHECK: [[COPY:%[0-9]+]]:gpr(s32) = COPY $w0
151 ; CHECK: [[COPY1:%[0-9]+]]:fpr(<2 x s32>) = COPY $d0
152 ; CHECK: [[C:%[0-9]+]]:gpr(s32) = G_CONSTANT i32 1
153 ; CHECK: [[IVEC:%[0-9]+]]:fpr(<2 x s32>) = G_INSERT_VECTOR_ELT [[COPY1]], [[COPY]](s32), [[C]](s32)
154 ; CHECK: $d0 = COPY [[IVEC]](<2 x s32>)
155 ; CHECK: RET_ReallyLR implicit $d0
157 %1:_(<2 x s32>) = COPY $d0
158 %3:_(s32) = G_CONSTANT i32 1
159 %2:_(<2 x s32>) = G_INSERT_VECTOR_ELT %1, %0(s32), %3(s32)
160 $d0 = COPY %2(<2 x s32>)
161 RET_ReallyLR implicit $d0