1 ; Test insertions of memory values into a nonzero index of an undef.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 ; Test v16i8 insertion into an undef, with an arbitrary index.
6 define <16 x i8> @f1(i8 *%ptr) {
8 ; CHECK: vlrepb %v24, 0(%r2)
10 %val = load i8, i8 *%ptr
11 %ret = insertelement <16 x i8> undef, i8 %val, i32 12
15 ; Test v16i8 insertion into an undef, with the first good index for VLVGP.
16 define <16 x i8> @f2(i8 *%ptr) {
18 ; CHECK: {{vlrepb|vllezb}} %v24, 0(%r2)
20 %val = load i8, i8 *%ptr
21 %ret = insertelement <16 x i8> undef, i8 %val, i32 7
25 ; Test v16i8 insertion into an undef, with the second good index for VLVGP.
26 define <16 x i8> @f3(i8 *%ptr) {
28 ; CHECK: vlrepb %v24, 0(%r2)
30 %val = load i8, i8 *%ptr
31 %ret = insertelement <16 x i8> undef, i8 %val, i32 15
35 ; Test v8i16 insertion into an undef, with an arbitrary index.
36 define <8 x i16> @f4(i16 *%ptr) {
38 ; CHECK: vlreph %v24, 0(%r2)
40 %val = load i16, i16 *%ptr
41 %ret = insertelement <8 x i16> undef, i16 %val, i32 5
45 ; Test v8i16 insertion into an undef, with the first good index for VLVGP.
46 define <8 x i16> @f5(i16 *%ptr) {
48 ; CHECK: {{vlreph|vllezh}} %v24, 0(%r2)
50 %val = load i16, i16 *%ptr
51 %ret = insertelement <8 x i16> undef, i16 %val, i32 3
55 ; Test v8i16 insertion into an undef, with the second good index for VLVGP.
56 define <8 x i16> @f6(i16 *%ptr) {
58 ; CHECK: vlreph %v24, 0(%r2)
60 %val = load i16, i16 *%ptr
61 %ret = insertelement <8 x i16> undef, i16 %val, i32 7
65 ; Test v4i32 insertion into an undef, with an arbitrary index.
66 define <4 x i32> @f7(i32 *%ptr) {
68 ; CHECK: vlrepf %v24, 0(%r2)
70 %val = load i32, i32 *%ptr
71 %ret = insertelement <4 x i32> undef, i32 %val, i32 2
75 ; Test v4i32 insertion into an undef, with the first good index for VLVGP.
76 define <4 x i32> @f8(i32 *%ptr) {
78 ; CHECK: {{vlrepf|vllezf}} %v24, 0(%r2)
80 %val = load i32, i32 *%ptr
81 %ret = insertelement <4 x i32> undef, i32 %val, i32 1
85 ; Test v4i32 insertion into an undef, with the second good index for VLVGP.
86 define <4 x i32> @f9(i32 *%ptr) {
88 ; CHECK: vlrepf %v24, 0(%r2)
90 %val = load i32, i32 *%ptr
91 %ret = insertelement <4 x i32> undef, i32 %val, i32 3
95 ; Test v2i64 insertion into an undef.
96 define <2 x i64> @f10(i64 *%ptr) {
98 ; CHECK: vlrepg %v24, 0(%r2)
100 %val = load i64, i64 *%ptr
101 %ret = insertelement <2 x i64> undef, i64 %val, i32 1
105 ; Test v4f32 insertion into an undef.
106 define <4 x float> @f11(float *%ptr) {
108 ; CHECK: vlrepf %v24, 0(%r2)
110 %val = load float, float *%ptr
111 %ret = insertelement <4 x float> undef, float %val, i32 2
115 ; Test v2f64 insertion into an undef.
116 define <2 x double> @f12(double *%ptr) {
118 ; CHECK: vlrepg %v24, 0(%r2)
120 %val = load double, double *%ptr
121 %ret = insertelement <2 x double> undef, double %val, i32 1
122 ret <2 x double> %ret