1 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=-zcz-gp,+no-zcz-fp | FileCheck %s -check-prefixes=ALL,NONEGP,NONEFP
2 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+zcz | FileCheck %s -check-prefixes=ALL,ZEROGP,ZEROFP
3 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+zcz -mattr=+fullfp16 | FileCheck %s -check-prefixes=ALL,ZEROGP,ZERO16
4 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mattr=+zcz-gp,+no-zcz-fp | FileCheck %s -check-prefixes=ALL,ZEROGP,NONEFP
5 ; RUN: llc < %s -mtriple=aarch64-linux-gnu | FileCheck %s -check-prefixes=ALL,NONEGP,ZEROFP
6 ; RUN: llc < %s -mtriple=arm64-apple-ios -mcpu=cyclone | FileCheck %s -check-prefixes=ALL,ZEROGP,NONEFP
7 ; RUN: llc < %s -mtriple=arm64-linux-gnu -mcpu=apple-a10 | FileCheck %s -check-prefixes=ALL,ZEROGP,ZEROFP
8 ; RUN: llc < %s -mtriple=arm64-apple-ios -mcpu=cyclone -mattr=+fullfp16 | FileCheck %s -check-prefixes=ALL,ZEROGP,NONE16
9 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mcpu=exynos-m3 | FileCheck %s -check-prefixes=ALL,NONEGP,ZEROFP
10 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mcpu=kryo | FileCheck %s -check-prefixes=ALL,ZEROGP,ZEROFP
11 ; RUN: llc < %s -mtriple=aarch64-linux-gnu -mcpu=falkor | FileCheck %s -check-prefixes=ALL,ZEROGP,ZEROFP
13 declare void @bar(half, float, double, <2 x double>)
14 declare void @bari(i32, i32)
15 declare void @barl(i64, i64)
16 declare void @barf(float, float)
18 define void @t1() nounwind ssp {
22 ; NONEFP-DAG: fmov s0, wzr
23 ; NONEFP-DAG: fmov s1, wzr
24 ; NONEFP-DAG: fmov d2, xzr
25 ; NONEFP-DAG: movi{{(.16b)?}} v3{{(.2d)?}}, #0
26 ; NONE16: fmov h0, wzr
27 ; NONE16: fmov s1, wzr
28 ; NONE16: fmov d2, xzr
29 ; NONE16: movi{{(.16b)?}} v3{{(.2d)?}}, #0
30 ; ZEROFP-DAG: movi d0, #0
31 ; ZEROFP-DAG: movi d1, #0
32 ; ZEROFP-DAG: movi d2, #0
33 ; ZEROFP-DAG: movi v3.2d, #0
37 ; ZERO16: movi v3.2d, #0
38 tail call void @bar(half 0.000000e+00, float 0.000000e+00, double 0.000000e+00, <2 x double> <double 0.000000e+00, double 0.000000e+00>) nounwind
42 define void @t2() nounwind ssp {
49 tail call void @bari(i32 0, i32 0) nounwind
53 define void @t3() nounwind ssp {
60 tail call void @barl(i64 0, i64 0) nounwind
64 define void @t4() nounwind ssp {
66 ; NONEFP: fmov s{{[0-3]+}}, wzr
67 ; NONEFP: fmov s{{[0-3]+}}, wzr
70 tail call void @barf(float 0.000000e+00, float 0.000000e+00) nounwind
74 declare double @sin(double)
76 ; We used to produce spills+reloads for a Q register with zero cycle zeroing
79 ; ALL-NOT: str q{{[0-9]+}}
80 ; ALL-NOT: ldr q{{[0-9]+}}
81 define double @foo(i32 %n) {
86 %phi0 = phi double [ 1.0, %entry ], [ %v0, %for.body ]
87 %i.076 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
88 %conv21 = sitofp i32 %i.076 to double
89 %call = tail call fast double @sin(double %conv21)
90 %cmp.i = fcmp fast olt double %phi0, %call
91 %v0 = select i1 %cmp.i, double %call, double %phi0
92 %inc = add nuw nsw i32 %i.076, 1
93 %cmp = icmp slt i32 %inc, %n
94 br i1 %cmp, label %for.body, label %for.end
100 define <2 x i64> @t6() {
102 ; ALL: movi{{(.16b)?}} v0{{(.2d)?}}, #0
103 ret <2 x i64> zeroinitializer
109 ; NONEGP: mov w0, wzr
117 ; NONEGP: mov w0, wzr
125 ; NONEGP: mov w0, wzr
133 ; NONEGP: mov w0, wzr
141 ; NONEGP: mov x0, xzr
146 define float @tf32() {
149 ; NONEFP: mov s0, wzr
150 ; ZEROFP: movi d0, #0
154 define double @td64() {
157 ; NONEFP: mov d0, xzr
158 ; ZEROFP: movi d0, #0
162 define <8 x i8> @tv8i8() {
165 ; ALL: movi{{(.16b)?}} v0{{(.2d)?}}, #0
166 ret <8 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
169 define <4 x i16> @tv4i16() {
172 ; ALL: movi{{(.16b)?}} v0{{(.2d)?}}, #0
173 ret <4 x i16> <i16 0, i16 0, i16 0, i16 0>
176 define <2 x i32> @tv2i32() {
179 ; ALL: movi{{(.16b)?}} v0{{(.2d)?}}, #0
180 ret <2 x i32> <i32 0, i32 0>
183 define <2 x float> @tv2f32() {
186 ; ALL: movi{{(.16b)?}} v0{{(.2d)?}}, #0
187 ret <2 x float> <float 0.0, float 0.0>
190 define <16 x i8> @tv16i8() {
193 ; ALL: movi{{(.16b)?}} v0{{(.2d)?}}, #0
194 ret <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
197 define <8 x i16> @tv8i16() {
200 ; ALL: movi{{(.16b)?}} v0{{(.2d)?}}, #0
201 ret <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>
204 define <4 x i32> @tv4i32() {
207 ; ALL: movi{{(.16b)?}} v0{{(.2d)?}}, #0
208 ret <4 x i32> <i32 0, i32 0, i32 0, i32 0>
211 define <2 x i64> @tv2i64() {
214 ; ALL: movi{{(.16b)?}} v0{{(.2d)?}}, #0
215 ret <2 x i64> <i64 0, i64 0>
218 define <4 x float> @tv4f32() {
221 ; ALL: movi{{(.16b)?}} v0{{(.2d)?}}, #0
222 ret <4 x float> <float 0.0, float 0.0, float 0.0, float 0.0>
225 define <2 x double> @tv2d64() {
228 ; ALL: movi{{(.16b)?}} v0{{(.2d)?}}, #0
229 ret <2 x double> <double 0.0, double 0.0>