108 lines · plain
1; Test vector (or (and X, Z), (and Y, (not Z))) patterns.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s4 5; Test v16i8.6define <16 x i8> @f1(<16 x i8> %val1, <16 x i8> %val2, <16 x i8> %val3) {7; CHECK-LABEL: f1:8; CHECK: vsel %v24, %v24, %v26, %v289; CHECK: br %r1410 %not = xor <16 x i8> %val3, <i8 -1, i8 -1, i8 -1, i8 -1,11 i8 -1, i8 -1, i8 -1, i8 -1,12 i8 -1, i8 -1, i8 -1, i8 -1,13 i8 -1, i8 -1, i8 -1, i8 -1>14 %and1 = and <16 x i8> %val1, %val315 %and2 = and <16 x i8> %val2, %not16 %ret = or <16 x i8> %and1, %and217 ret <16 x i8> %ret18}19 20; ...and again with the XOR applied to the other operand of the AND.21define <16 x i8> @f2(<16 x i8> %val1, <16 x i8> %val2, <16 x i8> %val3) {22; CHECK-LABEL: f2:23; CHECK: vsel %v24, %v26, %v24, %v2824; CHECK: br %r1425 %not = xor <16 x i8> %val3, <i8 -1, i8 -1, i8 -1, i8 -1,26 i8 -1, i8 -1, i8 -1, i8 -1,27 i8 -1, i8 -1, i8 -1, i8 -1,28 i8 -1, i8 -1, i8 -1, i8 -1>29 %and1 = and <16 x i8> %val1, %not30 %and2 = and <16 x i8> %val2, %val331 %ret = or <16 x i8> %and1, %and232 ret <16 x i8> %ret33}34 35; Test v8i16.36define <8 x i16> @f3(<8 x i16> %val1, <8 x i16> %val2, <8 x i16> %val3) {37; CHECK-LABEL: f3:38; CHECK: vsel %v24, %v24, %v26, %v2839; CHECK: br %r1440 %not = xor <8 x i16> %val3, <i16 -1, i16 -1, i16 -1, i16 -1,41 i16 -1, i16 -1, i16 -1, i16 -1>42 %and1 = and <8 x i16> %val1, %val343 %and2 = and <8 x i16> %val2, %not44 %ret = or <8 x i16> %and1, %and245 ret <8 x i16> %ret46}47 48; ...and again with the XOR applied to the other operand of the AND.49define <8 x i16> @f4(<8 x i16> %val1, <8 x i16> %val2, <8 x i16> %val3) {50; CHECK-LABEL: f4:51; CHECK: vsel %v24, %v26, %v24, %v2852; CHECK: br %r1453 %not = xor <8 x i16> %val3, <i16 -1, i16 -1, i16 -1, i16 -1,54 i16 -1, i16 -1, i16 -1, i16 -1>55 %and1 = and <8 x i16> %val1, %not56 %and2 = and <8 x i16> %val2, %val357 %ret = or <8 x i16> %and1, %and258 ret <8 x i16> %ret59}60 61; Test v4i32.62define <4 x i32> @f5(<4 x i32> %val1, <4 x i32> %val2, <4 x i32> %val3) {63; CHECK-LABEL: f5:64; CHECK: vsel %v24, %v24, %v26, %v2865; CHECK: br %r1466 %not = xor <4 x i32> %val3, <i32 -1, i32 -1, i32 -1, i32 -1>67 %and1 = and <4 x i32> %val1, %val368 %and2 = and <4 x i32> %val2, %not69 %ret = or <4 x i32> %and1, %and270 ret <4 x i32> %ret71}72 73; ...and again with the XOR applied to the other operand of the AND.74define <4 x i32> @f6(<4 x i32> %val1, <4 x i32> %val2, <4 x i32> %val3) {75; CHECK-LABEL: f6:76; CHECK: vsel %v24, %v26, %v24, %v2877; CHECK: br %r1478 %not = xor <4 x i32> %val3, <i32 -1, i32 -1, i32 -1, i32 -1>79 %and1 = and <4 x i32> %val1, %not80 %and2 = and <4 x i32> %val2, %val381 %ret = or <4 x i32> %and1, %and282 ret <4 x i32> %ret83}84 85; Test v2i64.86define <2 x i64> @f7(<2 x i64> %val1, <2 x i64> %val2, <2 x i64> %val3) {87; CHECK-LABEL: f7:88; CHECK: vsel %v24, %v24, %v26, %v2889; CHECK: br %r1490 %not = xor <2 x i64> %val3, <i64 -1, i64 -1>91 %and1 = and <2 x i64> %val1, %val392 %and2 = and <2 x i64> %val2, %not93 %ret = or <2 x i64> %and1, %and294 ret <2 x i64> %ret95}96 97; ...and again with the XOR applied to the other operand of the AND.98define <2 x i64> @f8(<2 x i64> %val1, <2 x i64> %val2, <2 x i64> %val3) {99; CHECK-LABEL: f8:100; CHECK: vsel %v24, %v26, %v24, %v28101; CHECK: br %r14102 %not = xor <2 x i64> %val3, <i64 -1, i64 -1>103 %and1 = and <2 x i64> %val1, %not104 %and2 = and <2 x i64> %val2, %val3105 %ret = or <2 x i64> %and1, %and2106 ret <2 x i64> %ret107}108