3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
6 define <16 x i8> @f1(ptr %ptr) {
8 ; CHECK: vl %v24, 0(%r2), 3
10 %ret = load <16 x i8>, ptr %ptr
15 define <8 x i16> @f2(ptr %ptr) {
17 ; CHECK: vl %v24, 0(%r2), 3
19 %ret = load <8 x i16>, ptr %ptr
24 define <4 x i32> @f3(ptr %ptr) {
26 ; CHECK: vl %v24, 0(%r2), 3
28 %ret = load <4 x i32>, ptr %ptr
33 define <2 x i64> @f4(ptr %ptr) {
35 ; CHECK: vl %v24, 0(%r2), 3
37 %ret = load <2 x i64>, ptr %ptr
42 define <4 x float> @f5(ptr %ptr) {
44 ; CHECK: vl %v24, 0(%r2), 3
46 %ret = load <4 x float>, ptr %ptr
51 define <2 x double> @f6(ptr %ptr) {
53 ; CHECK: vl %v24, 0(%r2), 3
55 %ret = load <2 x double>, ptr %ptr
59 ; Test the highest aligned in-range offset.
60 define <16 x i8> @f7(ptr %base) {
62 ; CHECK: vl %v24, 4080(%r2), 3
64 %ptr = getelementptr <16 x i8>, ptr %base, i64 255
65 %ret = load <16 x i8>, ptr %ptr
69 ; Test the highest unaligned in-range offset.
70 define <16 x i8> @f8(ptr %base) {
72 ; CHECK: vl %v24, 4095(%r2)
74 %addr = getelementptr i8, ptr %base, i64 4095
75 %ret = load <16 x i8>, ptr %addr, align 1
79 ; Test the next offset up, which requires separate address logic,
80 define <16 x i8> @f9(ptr %base) {
82 ; CHECK: aghi %r2, 4096
83 ; CHECK: vl %v24, 0(%r2), 3
85 %ptr = getelementptr <16 x i8>, ptr %base, i64 256
86 %ret = load <16 x i8>, ptr %ptr
90 ; Test negative offsets, which also require separate address logic,
91 define <16 x i8> @f10(ptr %base) {
93 ; CHECK: aghi %r2, -16
94 ; CHECK: vl %v24, 0(%r2), 3
96 %ptr = getelementptr <16 x i8>, ptr %base, i64 -1
97 %ret = load <16 x i8>, ptr %ptr
101 ; Check that indexes are allowed.
102 define <16 x i8> @f11(ptr %base, i64 %index) {
104 ; CHECK: vl %v24, 0(%r3,%r2)
106 %addr = getelementptr i8, ptr %base, i64 %index
107 %ret = load <16 x i8>, ptr %addr, align 1
112 define <2 x i8> @f12(ptr %ptr) {
114 ; CHECK: vlreph %v24, 0(%r2)
116 %ret = load <2 x i8>, ptr %ptr
121 define <4 x i8> @f13(ptr %ptr) {
123 ; CHECK: vlrepf %v24, 0(%r2)
125 %ret = load <4 x i8>, ptr %ptr
130 define <8 x i8> @f14(ptr %ptr) {
132 ; CHECK: vlrepg %v24, 0(%r2)
134 %ret = load <8 x i8>, ptr %ptr
139 define <2 x i16> @f15(ptr %ptr) {
141 ; CHECK: vlrepf %v24, 0(%r2)
143 %ret = load <2 x i16>, ptr %ptr
148 define <4 x i16> @f16(ptr %ptr) {
150 ; CHECK: vlrepg %v24, 0(%r2)
152 %ret = load <4 x i16>, ptr %ptr
157 define <2 x i32> @f17(ptr %ptr) {
159 ; CHECK: vlrepg %v24, 0(%r2)
161 %ret = load <2 x i32>, ptr %ptr
166 define <2 x float> @f18(ptr %ptr) {
168 ; CHECK: vlrepg %v24, 0(%r2)
170 %ret = load <2 x float>, ptr %ptr
174 ; Test quadword-aligned loads.
175 define <16 x i8> @f19(ptr %ptr) {
177 ; CHECK: vl %v24, 0(%r2), 4
179 %ret = load <16 x i8>, ptr %ptr, align 16