1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64"
7 define <4 x float> @test_f32(float %a, float %b, float %c, float %d) {
11 define <2 x double> @test_f64(double %a, double %b) {
12 ret <2 x double> undef
15 define <4 x i32> @test_i32(i32 %a, i32 %b, i32 %c, i32 %d) {
19 define <2 x i64> @test_i64(i64 %a, i64 %b) {
23 define void @test_p0(i64 *%a, i64 *%b) { ret void }
29 exposesReturnsTwice: false
34 tracksRegLiveness: true
37 liveins: $s0, $s1, $s2, $s3
39 ; CHECK-LABEL: name: test_f32
40 ; CHECK: liveins: $s0, $s1, $s2, $s3
41 ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
42 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
43 ; CHECK: [[COPY2:%[0-9]+]]:fpr32 = COPY $s2
44 ; CHECK: [[COPY3:%[0-9]+]]:fpr32 = COPY $s3
45 ; CHECK: [[DEF:%[0-9]+]]:fpr128 = IMPLICIT_DEF
46 ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF]], [[COPY]], %subreg.ssub
47 ; CHECK: [[DEF1:%[0-9]+]]:fpr128 = IMPLICIT_DEF
48 ; CHECK: [[INSERT_SUBREG1:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF1]], [[COPY1]], %subreg.ssub
49 ; CHECK: [[INSvi32lane:%[0-9]+]]:fpr128 = INSvi32lane [[INSERT_SUBREG]], 1, [[INSERT_SUBREG1]], 0
50 ; CHECK: [[DEF2:%[0-9]+]]:fpr128 = IMPLICIT_DEF
51 ; CHECK: [[INSERT_SUBREG2:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF2]], [[COPY2]], %subreg.ssub
52 ; CHECK: [[INSvi32lane1:%[0-9]+]]:fpr128 = INSvi32lane [[INSvi32lane]], 2, [[INSERT_SUBREG2]], 0
53 ; CHECK: [[DEF3:%[0-9]+]]:fpr128 = IMPLICIT_DEF
54 ; CHECK: [[INSERT_SUBREG3:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF3]], [[COPY3]], %subreg.ssub
55 ; CHECK: [[INSvi32lane2:%[0-9]+]]:fpr128 = INSvi32lane [[INSvi32lane1]], 3, [[INSERT_SUBREG3]], 0
56 ; CHECK: $q0 = COPY [[INSvi32lane2]]
57 ; CHECK: RET_ReallyLR implicit $q0
58 %0:fpr(s32) = COPY $s0
59 %1:fpr(s32) = COPY $s1
60 %2:fpr(s32) = COPY $s2
61 %3:fpr(s32) = COPY $s3
62 %4:fpr(<4 x s32>) = G_BUILD_VECTOR %0(s32), %1(s32), %2(s32), %3(s32)
63 $q0 = COPY %4(<4 x s32>)
64 RET_ReallyLR implicit $q0
70 exposesReturnsTwice: false
75 tracksRegLiveness: true
78 liveins: $d0, $d1, $d2, $d3
80 ; CHECK-LABEL: name: test_f64
81 ; CHECK: liveins: $d0, $d1, $d2, $d3
82 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
83 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
84 ; CHECK: [[DEF:%[0-9]+]]:fpr128 = IMPLICIT_DEF
85 ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF]], [[COPY]], %subreg.dsub
86 ; CHECK: [[DEF1:%[0-9]+]]:fpr128 = IMPLICIT_DEF
87 ; CHECK: [[INSERT_SUBREG1:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF1]], [[COPY1]], %subreg.dsub
88 ; CHECK: [[INSvi64lane:%[0-9]+]]:fpr128 = INSvi64lane [[INSERT_SUBREG]], 1, [[INSERT_SUBREG1]], 0
89 ; CHECK: $q0 = COPY [[INSvi64lane]]
90 ; CHECK: RET_ReallyLR implicit $q0
91 %0:fpr(s64) = COPY $d0
92 %1:fpr(s64) = COPY $d1
93 %4:fpr(<2 x s64>) = G_BUILD_VECTOR %0(s64), %1(s64)
94 $q0 = COPY %4(<2 x s64>)
95 RET_ReallyLR implicit $q0
101 exposesReturnsTwice: false
103 regBankSelected: true
106 tracksRegLiveness: true
109 liveins: $w0, $w1, $w2, $w3
111 ; CHECK-LABEL: name: test_i32
112 ; CHECK: liveins: $w0, $w1, $w2, $w3
113 ; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY $w0
114 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
115 ; CHECK: [[COPY2:%[0-9]+]]:gpr32 = COPY $w2
116 ; CHECK: [[COPY3:%[0-9]+]]:gpr32 = COPY $w3
117 ; CHECK: [[DEF:%[0-9]+]]:fpr128 = IMPLICIT_DEF
118 ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF]], [[COPY]], %subreg.ssub
119 ; CHECK: [[INSvi32gpr:%[0-9]+]]:fpr128 = INSvi32gpr [[INSERT_SUBREG]], 1, [[COPY1]]
120 ; CHECK: [[INSvi32gpr1:%[0-9]+]]:fpr128 = INSvi32gpr [[INSvi32gpr]], 2, [[COPY2]]
121 ; CHECK: [[INSvi32gpr2:%[0-9]+]]:fpr128 = INSvi32gpr [[INSvi32gpr1]], 3, [[COPY3]]
122 ; CHECK: $q0 = COPY [[INSvi32gpr2]]
123 ; CHECK: RET_ReallyLR implicit $q0
124 %0:gpr(s32) = COPY $w0
125 %1:gpr(s32) = COPY $w1
126 %2:gpr(s32) = COPY $w2
127 %3:gpr(s32) = COPY $w3
128 %4:fpr(<4 x s32>) = G_BUILD_VECTOR %0(s32), %1(s32), %2(s32), %3(s32)
129 $q0 = COPY %4(<4 x s32>)
130 RET_ReallyLR implicit $q0
136 exposesReturnsTwice: false
138 regBankSelected: true
141 tracksRegLiveness: true
146 ; CHECK-LABEL: name: test_i64
147 ; CHECK: liveins: $x0, $x1
148 ; CHECK: [[COPY:%[0-9]+]]:gpr64all = COPY $x0
149 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
150 ; CHECK: [[DEF:%[0-9]+]]:fpr128 = IMPLICIT_DEF
151 ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF]], [[COPY]], %subreg.dsub
152 ; CHECK: [[INSvi64gpr:%[0-9]+]]:fpr128 = INSvi64gpr [[INSERT_SUBREG]], 1, [[COPY1]]
153 ; CHECK: $q0 = COPY [[INSvi64gpr]]
154 ; CHECK: RET_ReallyLR implicit $q0
155 %0:gpr(s64) = COPY $x0
156 %1:gpr(s64) = COPY $x1
157 %4:fpr(<2 x s64>) = G_BUILD_VECTOR %0(s64), %1(s64)
158 $q0 = COPY %4(<2 x s64>)
159 RET_ReallyLR implicit $q0
165 exposesReturnsTwice: false
167 regBankSelected: true
170 tracksRegLiveness: true
175 ; CHECK-LABEL: name: test_p0
176 ; CHECK: liveins: $x0, $x1
177 ; CHECK: [[COPY:%[0-9]+]]:gpr64all = COPY $x0
178 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
179 ; CHECK: [[DEF:%[0-9]+]]:fpr128 = IMPLICIT_DEF
180 ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF]], [[COPY]], %subreg.dsub
181 ; CHECK: [[INSvi64gpr:%[0-9]+]]:fpr128 = INSvi64gpr [[INSERT_SUBREG]], 1, [[COPY1]]
182 ; CHECK: $q0 = COPY [[INSvi64gpr]]
183 ; CHECK: RET_ReallyLR implicit $q0
184 %0:gpr(p0) = COPY $x0
185 %1:gpr(p0) = COPY $x1
186 %4:fpr(<2 x p0>) = G_BUILD_VECTOR %0(p0), %1(p0)
187 $q0 = COPY %4(<2 x p0>)
188 RET_ReallyLR implicit $q0