brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.3 KiB · 9a370af Raw
146 lines · plain
1; Test vector shift left double immediate.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s4 5; Test a v16i8 shift with the lowest useful shift amount.6define <16 x i8> @f1(<16 x i8> %val1, <16 x i8> %val2) {7; CHECK-LABEL: f1:8; CHECK: vsldb %v24, %v24, %v26, 19; CHECK: br %r1410  %ret = shufflevector <16 x i8> %val1, <16 x i8> %val2,11                       <16 x i32> <i32 1, i32 2, i32 3, i32 4,12                                   i32 5, i32 6, i32 7, i32 8,13                                   i32 9, i32 10, i32 11, i32 12,14                                   i32 13, i32 14, i32 15, i32 16>15  ret <16 x i8> %ret16}17 18; Test a v16i8 shift with the highest shift amount.19define <16 x i8> @f2(<16 x i8> %val1, <16 x i8> %val2) {20; CHECK-LABEL: f2:21; CHECK: vsldb %v24, %v24, %v26, 1522; CHECK: br %r1423  %ret = shufflevector <16 x i8> %val1, <16 x i8> %val2,24                       <16 x i32> <i32 15, i32 16, i32 17, i32 18,25                                   i32 19, i32 20, i32 21, i32 22,26                                   i32 23, i32 24, i32 25, i32 26,27                                   i32 27, i32 28, i32 29, i32 30>28  ret <16 x i8> %ret29}30 31; Test a v16i8 shift in which the operands need to be reversed.32define <16 x i8> @f3(<16 x i8> %val1, <16 x i8> %val2) {33; CHECK-LABEL: f3:34; CHECK: vsldb %v24, %v26, %v24, 435; CHECK: br %r1436  %ret = shufflevector <16 x i8> %val1, <16 x i8> %val2,37                       <16 x i32> <i32 20, i32 21, i32 22, i32 23,38                                   i32 24, i32 25, i32 26, i32 27,39                                   i32 28, i32 29, i32 30, i32 31,40                                   i32 0, i32 1, i32 2, i32 3>41  ret <16 x i8> %ret42}43 44; Test a v16i8 shift in which the operands need to be duplicated.45define <16 x i8> @f4(<16 x i8> %val) {46; CHECK-LABEL: f4:47; CHECK: vsldb %v24, %v24, %v24, 748; CHECK: br %r1449  %ret = shufflevector <16 x i8> %val, <16 x i8> undef,50                       <16 x i32> <i32 7, i32 8, i32 9, i32 10,51                                   i32 11, i32 12, i32 13, i32 14,52                                   i32 15, i32 0, i32 1, i32 2,53                                   i32 3, i32 4, i32 5, i32 6>54  ret <16 x i8> %ret55}56 57; Test a v16i8 shift in which some of the indices are undefs.58define <16 x i8> @f5(<16 x i8> %val1, <16 x i8> %val2) {59; CHECK-LABEL: f5:60; CHECK: vsldb %v24, %v24, %v26, 1161; CHECK: br %r1462  %ret = shufflevector <16 x i8> %val1, <16 x i8> %val2,63                       <16 x i32> <i32 undef, i32 undef, i32 undef, i32 undef,64                                   i32 15, i32 16, i32 undef, i32 18,65                                   i32 19, i32 20, i32 21, i32 22,66                                   i32 23, i32 24, i32 25, i32 26>67  ret <16 x i8> %ret68}69 70; ...and again with reversed operands.71define <16 x i8> @f6(<16 x i8> %val1, <16 x i8> %val2) {72; CHECK-LABEL: f6:73; CHECK: vsldb %v24, %v26, %v24, 1374; CHECK: br %r1475  %ret = shufflevector <16 x i8> %val1, <16 x i8> %val2,76                       <16 x i32> <i32 undef, i32 undef, i32 31, i32 0,77                                   i32 1, i32 2, i32 3, i32 4,78                                   i32 5, i32 6, i32 7, i32 8,79                                   i32 9, i32 10, i32 11, i32 12>80  ret <16 x i8> %ret81}82 83; Test a v8i16 shift with the lowest useful shift amount.84define <8 x i16> @f7(<8 x i16> %val1, <8 x i16> %val2) {85; CHECK-LABEL: f7:86; CHECK: vsldb %v24, %v24, %v26, 287; CHECK: br %r1488  %ret = shufflevector <8 x i16> %val1, <8 x i16> %val2,89                       <8 x i32> <i32 1, i32 2, i32 3, i32 4,90                                  i32 5, i32 6, i32 7, i32 8>91  ret <8 x i16> %ret92}93 94; Test a v8i16 shift with the highest useful shift amount.95define <8 x i16> @f8(<8 x i16> %val1, <8 x i16> %val2) {96; CHECK-LABEL: f8:97; CHECK: vsldb %v24, %v24, %v26, 1498; CHECK: br %r1499  %ret = shufflevector <8 x i16> %val1, <8 x i16> %val2,100                       <8 x i32> <i32 7, i32 8, i32 9, i32 10,101                                  i32 11, i32 12, i32 13, i32 14>102  ret <8 x i16> %ret103}104 105; Test a v4i32 shift with the lowest useful shift amount.106define <4 x i32> @f9(<4 x i32> %val1, <4 x i32> %val2) {107; CHECK-LABEL: f9:108; CHECK: vsldb %v24, %v24, %v26, 4109; CHECK: br %r14110  %ret = shufflevector <4 x i32> %val1, <4 x i32> %val2,111                       <4 x i32> <i32 1, i32 2, i32 3, i32 4>112  ret <4 x i32> %ret113}114 115; Test a v4i32 shift with the highest useful shift amount.116define <4 x i32> @f10(<4 x i32> %val1, <4 x i32> %val2) {117; CHECK-LABEL: f10:118; CHECK: vsldb %v24, %v24, %v26, 12119; CHECK: br %r14120  %ret = shufflevector <4 x i32> %val1, <4 x i32> %val2,121                       <4 x i32> <i32 3, i32 4, i32 5, i32 6>122  ret <4 x i32> %ret123}124 125; Test a v4f32 shift with the lowest useful shift amount.126define <4 x float> @f12(<4 x float> %val1, <4 x float> %val2) {127; CHECK-LABEL: f12:128; CHECK: vsldb %v24, %v24, %v26, 4129; CHECK: br %r14130  %ret = shufflevector <4 x float> %val1, <4 x float> %val2,131                       <4 x i32> <i32 1, i32 2, i32 3, i32 4>132  ret <4 x float> %ret133}134 135; Test a v4f32 shift with the highest useful shift amount.136define <4 x float> @f13(<4 x float> %val1, <4 x float> %val2) {137; CHECK-LABEL: f13:138; CHECK: vsldb %v24, %v24, %v26, 12139; CHECK: br %r14140  %ret = shufflevector <4 x float> %val1, <4 x float> %val2,141                       <4 x i32> <i32 3, i32 4, i32 5, i32 6>142  ret <4 x float> %ret143}144 145; We use VPDI for v2i64 shuffles.146