1 ; Test insertions of memory values into 0. 2 ; 3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s 4 5 ; Test VLLEZB. 6 define <16 x i8> @f1(i8 *%ptr) { 7 ; CHECK-LABEL: f1: 8 ; CHECK: vllezb %v24, 0(%r2) 9 ; CHECK: br %r14 10 %val = load i8, i8 *%ptr 11 %ret = insertelement <16 x i8> zeroinitializer, i8 %val, i32 7 12 ret <16 x i8> %ret 13 } 14 15 ; Test VLLEZB with the highest in-range offset. 16 define <16 x i8> @f2(i8 *%base) { 17 ; CHECK-LABEL: f2: 18 ; CHECK: vllezb %v24, 4095(%r2) 19 ; CHECK: br %r14 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 23 ret <16 x i8> %ret 24 } 25 26 ; Test VLLEZB with the next highest offset. 27 define <16 x i8> @f3(i8 *%base) { 28 ; CHECK-LABEL: f3: 29 ; CHECK-NOT: vllezb %v24, 4096(%r2) 30 ; CHECK: br %r14 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 34 ret <16 x i8> %ret 35 } 36 37 ; Test that VLLEZB allows an index. 38 define <16 x i8> @f4(i8 *%base, i64 %index) { 39 ; CHECK-LABEL: f4: 40 ; CHECK: vllezb %v24, 0({{%r2,%r3|%r3,%r2}}) 41 ; CHECK: br %r14 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 45 ret <16 x i8> %ret 46 } 47 48 ; Test VLLEZH. 49 define <8 x i16> @f5(i16 *%ptr) { 50 ; CHECK-LABEL: f5: 51 ; CHECK: vllezh %v24, 0(%r2) 52 ; CHECK: br %r14 53 %val = load i16, i16 *%ptr 54 %ret = insertelement <8 x i16> zeroinitializer, i16 %val, i32 3 55 ret <8 x i16> %ret 56 } 57 58 ; Test VLLEZF. 59 define <4 x i32> @f6(i32 *%ptr) { 60 ; CHECK-LABEL: f6: 61 ; CHECK: vllezf %v24, 0(%r2) 62 ; CHECK: br %r14 63 %val = load i32, i32 *%ptr 64 %ret = insertelement <4 x i32> zeroinitializer, i32 %val, i32 1 65 ret <4 x i32> %ret 66 } 67 68 ; Test VLLEZG. 69 define <2 x i64> @f7(i64 *%ptr) { 70 ; CHECK-LABEL: f7: 71 ; CHECK: vllezg %v24, 0(%r2) 72 ; CHECK: br %r14 73 %val = load i64, i64 *%ptr 74 %ret = insertelement <2 x i64> zeroinitializer, i64 %val, i32 0 75 ret <2 x i64> %ret 76 } 77 78 ; Test VLLEZF with a float. 79 define <4 x float> @f8(float *%ptr) { 80 ; CHECK-LABEL: f8: 81 ; CHECK: vllezf %v24, 0(%r2) 82 ; CHECK: br %r14 83 %val = load float, float *%ptr 84 %ret = insertelement <4 x float> zeroinitializer, float %val, i32 1 85 ret <4 x float> %ret 86 } 87 88 ; Test VLLEZG with a double. 89 define <2 x double> @f9(double *%ptr) { 90 ; CHECK-LABEL: f9: 91 ; CHECK: vllezg %v24, 0(%r2) 92 ; CHECK: br %r14 93 %val = load double, double *%ptr 94 %ret = insertelement <2 x double> zeroinitializer, double %val, i32 0 95 ret <2 x double> %ret 96 } 97