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(ptr %ptr) {
8 ; CHECK: vllezb %v24, 0(%r2)
10 %val = load i8, ptr %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(ptr %base) {
18 ; CHECK: vllezb %v24, 4095(%r2)
20 %ptr = getelementptr i8, ptr %base, i64 4095
21 %val = load i8, ptr %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(ptr %base) {
29 ; CHECK-NOT: vllezb %v24, 4096(%r2)
31 %ptr = getelementptr i8, ptr %base, i64 4096
32 %val = load i8, ptr %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(ptr %base, i64 %index) {
40 ; CHECK: vllezb %v24, 0({{%r2,%r3|%r3,%r2}})
42 %ptr = getelementptr i8, ptr %base, i64 %index
43 %val = load i8, ptr %ptr
44 %ret = insertelement <16 x i8> zeroinitializer, i8 %val, i32 7
49 define <8 x i16> @f5(ptr %ptr) {
51 ; CHECK: vllezh %v24, 0(%r2)
53 %val = load i16, ptr %ptr
54 %ret = insertelement <8 x i16> zeroinitializer, i16 %val, i32 3
59 define <4 x i32> @f6(ptr %ptr) {
61 ; CHECK: vllezf %v24, 0(%r2)
63 %val = load i32, ptr %ptr
64 %ret = insertelement <4 x i32> zeroinitializer, i32 %val, i32 1
69 define <2 x i64> @f7(ptr %ptr) {
71 ; CHECK: vllezg %v24, 0(%r2)
73 %val = load i64, ptr %ptr
74 %ret = insertelement <2 x i64> zeroinitializer, i64 %val, i32 0
78 ; Test VLLEZF with a float.
79 define <4 x float> @f8(ptr %ptr) {
81 ; CHECK: vllezf %v24, 0(%r2)
83 %val = load float, ptr %ptr
84 %ret = insertelement <4 x float> zeroinitializer, float %val, i32 1
88 ; Test VLLEZG with a double.
89 define <2 x double> @f9(ptr %ptr) {
91 ; CHECK: vllezg %v24, 0(%r2)
93 %val = load double, ptr %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(ptr %ptr, ptr %res) {
101 ; CHECK: vllezf [[REG:%v[0-9]+]], 0(%r2)
102 ; CHECK: vst [[REG]], 0(%r3)
104 %val = load float, ptr %ptr
105 %ret = insertelement <4 x float> zeroinitializer, float %val, i32 1
106 store <4 x float> %ret, ptr %res
110 ; Test VLLEZG with a double when the result is stored to memory.
111 define void @f11(ptr %ptr, ptr %res) {
113 ; CHECK: vllezg [[REG:%v[0-9]+]], 0(%r2)
114 ; CHECK: vst [[REG]], 0(%r3)
116 %val = load double, ptr %ptr
117 %ret = insertelement <2 x double> zeroinitializer, double %val, i32 0
118 store <2 x double> %ret, ptr %res
122 ; Test VLLEZG when the zeroinitializer is shared.
123 define void @f12(ptr %ptr, ptr %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, ptr %ptr
131 %ret = insertelement <2 x i64> zeroinitializer, i64 %val, i32 0
132 store volatile <2 x i64> %ret, ptr %res
133 %val1 = load volatile i64, ptr %ptr
134 %ret1 = insertelement <2 x i64> zeroinitializer, i64 %val1, i32 0
135 store volatile <2 x i64> %ret1, ptr %res