1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible-sve < %s | FileCheck %s
4 target triple = "aarch64-unknown-linux-gnu"
6 define void @build_vector_7_inc1_v4i1(ptr %a) {
7 ; CHECK-LABEL: build_vector_7_inc1_v4i1:
9 ; CHECK-NEXT: mov w8, #5 // =0x5
10 ; CHECK-NEXT: strb w8, [x0]
12 store <4 x i1> <i1 true, i1 false, i1 true, i1 false>, ptr %a, align 1
16 define void @build_vector_7_inc1_v32i8(ptr %a) {
17 ; CHECK-LABEL: build_vector_7_inc1_v32i8:
19 ; CHECK-NEXT: index z0.b, #0, #1
20 ; CHECK-NEXT: mov z1.d, z0.d
21 ; CHECK-NEXT: add z0.b, z0.b, #7 // =0x7
22 ; CHECK-NEXT: add z1.b, z1.b, #23 // =0x17
23 ; CHECK-NEXT: stp q0, q1, [x0]
25 store <32 x i8> <i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31, i8 32, i8 33, i8 34, i8 35, i8 36, i8 37, i8 38>, ptr %a, align 1
29 define void @build_vector_0_inc2_v16i16(ptr %a) {
30 ; CHECK-LABEL: build_vector_0_inc2_v16i16:
32 ; CHECK-NEXT: index z0.h, #0, #2
33 ; CHECK-NEXT: str q0, [x0]
34 ; CHECK-NEXT: add z0.h, z0.h, #16 // =0x10
35 ; CHECK-NEXT: str q0, [x0, #16]
37 store <16 x i16> <i16 0, i16 2, i16 4, i16 6, i16 8, i16 10, i16 12, i16 14, i16 16, i16 18, i16 20, i16 22, i16 24, i16 26, i16 28, i16 30>, ptr %a, align 2
41 ; Negative const stride.
42 define void @build_vector_0_dec3_v8i32(ptr %a) {
43 ; CHECK-LABEL: build_vector_0_dec3_v8i32:
45 ; CHECK-NEXT: index z0.s, #0, #-3
46 ; CHECK-NEXT: mov z1.s, #-12 // =0xfffffffffffffff4
47 ; CHECK-NEXT: add z1.s, z0.s, z1.s
48 ; CHECK-NEXT: stp q0, q1, [x0]
50 store <8 x i32> <i32 0, i32 -3, i32 -6, i32 -9, i32 -12, i32 -15, i32 -18, i32 -21>, ptr %a, align 4
54 ; Constant stride that's too big to be directly encoded into the index.
55 define void @build_vector_minus2_dec32_v4i64(ptr %a) {
56 ; CHECK-LABEL: build_vector_minus2_dec32_v4i64:
58 ; CHECK-NEXT: mov x8, #-32 // =0xffffffffffffffe0
59 ; CHECK-NEXT: mov z1.d, #-66 // =0xffffffffffffffbe
60 ; CHECK-NEXT: mov z2.d, #-2 // =0xfffffffffffffffe
61 ; CHECK-NEXT: index z0.d, #0, x8
62 ; CHECK-NEXT: add z1.d, z0.d, z1.d
63 ; CHECK-NEXT: add z0.d, z0.d, z2.d
64 ; CHECK-NEXT: stp q0, q1, [x0]
66 store <4 x i64> <i64 -2, i64 -34, i64 -66, i64 -98>, ptr %a, align 8
70 ; Constant but not a sequence.
71 define void @build_vector_no_stride_v4i64(ptr %a) {
72 ; CHECK-LABEL: build_vector_no_stride_v4i64:
74 ; CHECK-NEXT: index z0.d, #1, #7
75 ; CHECK-NEXT: index z1.d, #0, #4
76 ; CHECK-NEXT: stp q1, q0, [x0]
78 store <4 x i64> <i64 0, i64 4, i64 1, i64 8>, ptr %a, align 8
82 define void @build_vector_0_inc2_v16f16(ptr %a) {
83 ; CHECK-LABEL: build_vector_0_inc2_v16f16:
85 ; CHECK-NEXT: adrp x8, .LCPI6_0
86 ; CHECK-NEXT: adrp x9, .LCPI6_1
87 ; CHECK-NEXT: ldr q0, [x8, :lo12:.LCPI6_0]
88 ; CHECK-NEXT: ldr q1, [x9, :lo12:.LCPI6_1]
89 ; CHECK-NEXT: stp q1, q0, [x0]
91 store <16 x half> <half 0.0, half 2.0, half 4.0, half 6.0, half 8.0, half 10.0, half 12.0, half 14.0, half 16.0, half 18.0, half 20.0, half 22.0, half 24.0, half 26.0, half 28.0, half 30.0>, ptr %a, align 2
95 ; Negative const stride.
96 define void @build_vector_0_dec3_v8f32(ptr %a) {
97 ; CHECK-LABEL: build_vector_0_dec3_v8f32:
99 ; CHECK-NEXT: adrp x8, .LCPI7_0
100 ; CHECK-NEXT: adrp x9, .LCPI7_1
101 ; CHECK-NEXT: ldr q0, [x8, :lo12:.LCPI7_0]
102 ; CHECK-NEXT: ldr q1, [x9, :lo12:.LCPI7_1]
103 ; CHECK-NEXT: stp q1, q0, [x0]
105 store <8 x float> <float 0.0, float -3.0, float -6.0, float -9.0, float -12.0, float -15.0, float -18.0, float -21.0>, ptr %a, align 4
109 ; Constant stride that's too big to be directly encoded into the index.
110 define void @build_vector_minus2_dec32_v4f64(ptr %a) {
111 ; CHECK-LABEL: build_vector_minus2_dec32_v4f64:
113 ; CHECK-NEXT: adrp x8, .LCPI8_0
114 ; CHECK-NEXT: adrp x9, .LCPI8_1
115 ; CHECK-NEXT: ldr q0, [x8, :lo12:.LCPI8_0]
116 ; CHECK-NEXT: ldr q1, [x9, :lo12:.LCPI8_1]
117 ; CHECK-NEXT: stp q1, q0, [x0]
119 store <4 x double> <double -2.0, double -34.0, double -66.0, double -98.0>, ptr %a, align 8
123 ; Constant but not a sequence.
124 define void @build_vector_no_stride_v4f64(ptr %a) {
125 ; CHECK-LABEL: build_vector_no_stride_v4f64:
127 ; CHECK-NEXT: adrp x8, .LCPI9_0
128 ; CHECK-NEXT: adrp x9, .LCPI9_1
129 ; CHECK-NEXT: ldr q0, [x8, :lo12:.LCPI9_0]
130 ; CHECK-NEXT: ldr q1, [x9, :lo12:.LCPI9_1]
131 ; CHECK-NEXT: stp q1, q0, [x0]
133 store <4 x double> <double 0.0, double 4.0, double 1.0, double 8.0>, ptr %a, align 8