1 ; Test insertions of memory values into 0.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
6 define <16 x i8> @f1(i8 *%ptr) {
8 ; CHECK: vllezb %v24, 0(%r2)
10 %val = load i8, i8 *%ptr
11 %ret = insertelement <16 x i8> zeroinitializer, i8 %val, i32 7
15 ; Test VLLEZB with the highest in-range offset.
16 define <16 x i8> @f2(i8 *%base) {
18 ; CHECK: vllezb %v24, 4095(%r2)
20 %ptr = getelementptr i8, i8 *%base, i64 4095
21 %val = load i8, i8 *%ptr
22 %ret = insertelement <16 x i8> zeroinitializer, i8 %val, i32 7
26 ; Test VLLEZB with the next highest offset.
27 define <16 x i8> @f3(i8 *%base) {
29 ; CHECK-NOT: vllezb %v24, 4096(%r2)
31 %ptr = getelementptr i8, i8 *%base, i64 4096
32 %val = load i8, i8 *%ptr
33 %ret = insertelement <16 x i8> zeroinitializer, i8 %val, i32 7
37 ; Test that VLLEZB allows an index.
38 define <16 x i8> @f4(i8 *%base, i64 %index) {
40 ; CHECK: vllezb %v24, 0({{%r2,%r3|%r3,%r2}})
42 %ptr = getelementptr i8, i8 *%base, i64 %index
43 %val = load i8, i8 *%ptr
44 %ret = insertelement <16 x i8> zeroinitializer, i8 %val, i32 7
49 define <8 x i16> @f5(i16 *%ptr) {
51 ; CHECK: vllezh %v24, 0(%r2)
53 %val = load i16, i16 *%ptr
54 %ret = insertelement <8 x i16> zeroinitializer, i16 %val, i32 3
59 define <4 x i32> @f6(i32 *%ptr) {
61 ; CHECK: vllezf %v24, 0(%r2)
63 %val = load i32, i32 *%ptr
64 %ret = insertelement <4 x i32> zeroinitializer, i32 %val, i32 1
69 define <2 x i64> @f7(i64 *%ptr) {
71 ; CHECK: vllezg %v24, 0(%r2)
73 %val = load i64, i64 *%ptr
74 %ret = insertelement <2 x i64> zeroinitializer, i64 %val, i32 0
78 ; Test VLLEZF with a float.
79 define <4 x float> @f8(float *%ptr) {
81 ; CHECK: vllezf %v24, 0(%r2)
83 %val = load float, float *%ptr
84 %ret = insertelement <4 x float> zeroinitializer, float %val, i32 1
88 ; Test VLLEZG with a double.
89 define <2 x double> @f9(double *%ptr) {
91 ; CHECK: vllezg %v24, 0(%r2)
93 %val = load double, double *%ptr
94 %ret = insertelement <2 x double> zeroinitializer, double %val, i32 0
98 ; Test VLLEZF with a float when the result is stored to memory.
99 define void @f10(float *%ptr, <4 x float> *%res) {
101 ; CHECK: vllezf [[REG:%v[0-9]+]], 0(%r2)
102 ; CHECK: vst [[REG]], 0(%r3)
104 %val = load float, float *%ptr
105 %ret = insertelement <4 x float> zeroinitializer, float %val, i32 1
106 store <4 x float> %ret, <4 x float> *%res
110 ; Test VLLEZG with a double when the result is stored to memory.
111 define void @f11(double *%ptr, <2 x double> *%res) {
113 ; CHECK: vllezg [[REG:%v[0-9]+]], 0(%r2)
114 ; CHECK: vst [[REG]], 0(%r3)
116 %val = load double, double *%ptr
117 %ret = insertelement <2 x double> zeroinitializer, double %val, i32 0
118 store <2 x double> %ret, <2 x double> *%res
122 ; Test VLLEZG when the zeroinitializer is shared.
123 define void @f12(i64 *%ptr, <2 x i64> *%res) {
125 ; CHECK: vllezg [[REG:%v[0-9]+]], 0(%r2)
126 ; CHECK: vst [[REG]], 0(%r3)
127 ; CHECK: vllezg [[REG1:%v[0-9]+]], 0(%r2)
128 ; CHECK: vst [[REG1]], 0(%r3)
130 %val = load volatile i64, i64 *%ptr
131 %ret = insertelement <2 x i64> zeroinitializer, i64 %val, i32 0
132 store volatile <2 x i64> %ret, <2 x i64> *%res
133 %val1 = load volatile i64, i64 *%ptr
134 %ret1 = insertelement <2 x i64> zeroinitializer, i64 %val1, i32 0
135 store volatile <2 x i64> %ret1, <2 x i64> *%res