1 ; Test insertions of register 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 %val) {
8 ; CHECK: vlvgb %v24, %r2, 12
10 %ret = insertelement <16 x i8> undef, i8 %val, i32 12
14 ; Test v16i8 insertion into an undef, with the first good index for VLVGP.
15 define <16 x i8> @f2(i8 %val) {
17 ; CHECK: vlvgp %v24, %r2, %r2
19 %ret = insertelement <16 x i8> undef, i8 %val, i32 7
23 ; Test v16i8 insertion into an undef, with the second good index for VLVGP.
24 define <16 x i8> @f3(i8 %val) {
26 ; CHECK: vlvgp %v24, %r2, %r2
28 %ret = insertelement <16 x i8> undef, i8 %val, i32 15
32 ; Test v8i16 insertion into an undef, with an arbitrary index.
33 define <8 x i16> @f4(i16 %val) {
35 ; CHECK: vlvgh %v24, %r2, 5
37 %ret = insertelement <8 x i16> undef, i16 %val, i32 5
41 ; Test v8i16 insertion into an undef, with the first good index for VLVGP.
42 define <8 x i16> @f5(i16 %val) {
44 ; CHECK: vlvgp %v24, %r2, %r2
46 %ret = insertelement <8 x i16> undef, i16 %val, i32 3
50 ; Test v8i16 insertion into an undef, with the second good index for VLVGP.
51 define <8 x i16> @f6(i16 %val) {
53 ; CHECK: vlvgp %v24, %r2, %r2
55 %ret = insertelement <8 x i16> undef, i16 %val, i32 7
59 ; Test v4i32 insertion into an undef, with an arbitrary index.
60 define <4 x i32> @f7(i32 %val) {
62 ; CHECK: vlvgf %v24, %r2, 2
64 %ret = insertelement <4 x i32> undef, i32 %val, i32 2
68 ; Test v4i32 insertion into an undef, with the first good index for VLVGP.
69 define <4 x i32> @f8(i32 %val) {
71 ; CHECK: vlvgp %v24, %r2, %r2
73 %ret = insertelement <4 x i32> undef, i32 %val, i32 1
77 ; Test v4i32 insertion into an undef, with the second good index for VLVGP.
78 define <4 x i32> @f9(i32 %val) {
80 ; CHECK: vlvgp %v24, %r2, %r2
82 %ret = insertelement <4 x i32> undef, i32 %val, i32 3
86 ; Test v2i64 insertion into an undef.
87 define <2 x i64> @f10(i64 %val) {
89 ; CHECK: vlvgp %v24, %r2, %r2
91 %ret = insertelement <2 x i64> undef, i64 %val, i32 1
95 ; Test v4f32 insertion into an undef.
96 define <4 x float> @f11(float %val) {
98 ; CHECK: vrepf %v24, %v0, 0
100 %ret = insertelement <4 x float> undef, float %val, i32 2
104 ; Test v2f64 insertion into an undef.
105 define <2 x double> @f12(double %val) {
107 ; CHECK: vrepg %v24, %v0, 0
109 %ret = insertelement <2 x double> undef, double %val, i32 1
110 ret <2 x double> %ret