1 ; Test v8i16 maximum. 2 ; 3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s 4 5 ; Test with slt. 6 define <8 x i16> @f1(<8 x i16> %val1, <8 x i16> %val2) { 7 ; CHECK-LABEL: f1: 8 ; CHECK: vmxh %v24, {{%v24, %v26|%v26, %v24}} 9 ; CHECK: br %r14 10 %cmp = icmp slt <8 x i16> %val1, %val2 11 %ret = select <8 x i1> %cmp, <8 x i16> %val2, <8 x i16> %val1 12 ret <8 x i16> %ret 13 } 14 15 ; Test with sle. 16 define <8 x i16> @f2(<8 x i16> %val1, <8 x i16> %val2) { 17 ; CHECK-LABEL: f2: 18 ; CHECK: vmxh %v24, {{%v24, %v26|%v26, %v24}} 19 ; CHECK: br %r14 20 %cmp = icmp sle <8 x i16> %val1, %val2 21 %ret = select <8 x i1> %cmp, <8 x i16> %val2, <8 x i16> %val1 22 ret <8 x i16> %ret 23 } 24 25 ; Test with sgt. 26 define <8 x i16> @f3(<8 x i16> %val1, <8 x i16> %val2) { 27 ; CHECK-LABEL: f3: 28 ; CHECK: vmxh %v24, {{%v24, %v26|%v26, %v24}} 29 ; CHECK: br %r14 30 %cmp = icmp sgt <8 x i16> %val1, %val2 31 %ret = select <8 x i1> %cmp, <8 x i16> %val1, <8 x i16> %val2 32 ret <8 x i16> %ret 33 } 34 35 ; Test with sge. 36 define <8 x i16> @f4(<8 x i16> %val1, <8 x i16> %val2) { 37 ; CHECK-LABEL: f4: 38 ; CHECK: vmxh %v24, {{%v24, %v26|%v26, %v24}} 39 ; CHECK: br %r14 40 %cmp = icmp sge <8 x i16> %val1, %val2 41 %ret = select <8 x i1> %cmp, <8 x i16> %val1, <8 x i16> %val2 42 ret <8 x i16> %ret 43 } 44 45 ; Test with ult. 46 define <8 x i16> @f5(<8 x i16> %val1, <8 x i16> %val2) { 47 ; CHECK-LABEL: f5: 48 ; CHECK: vmxlh %v24, {{%v24, %v26|%v26, %v24}} 49 ; CHECK: br %r14 50 %cmp = icmp ult <8 x i16> %val1, %val2 51 %ret = select <8 x i1> %cmp, <8 x i16> %val2, <8 x i16> %val1 52 ret <8 x i16> %ret 53 } 54 55 ; Test with ule. 56 define <8 x i16> @f6(<8 x i16> %val1, <8 x i16> %val2) { 57 ; CHECK-LABEL: f6: 58 ; CHECK: vmxlh %v24, {{%v24, %v26|%v26, %v24}} 59 ; CHECK: br %r14 60 %cmp = icmp ule <8 x i16> %val1, %val2 61 %ret = select <8 x i1> %cmp, <8 x i16> %val2, <8 x i16> %val1 62 ret <8 x i16> %ret 63 } 64 65 ; Test with ugt. 66 define <8 x i16> @f7(<8 x i16> %val1, <8 x i16> %val2) { 67 ; CHECK-LABEL: f7: 68 ; CHECK: vmxlh %v24, {{%v24, %v26|%v26, %v24}} 69 ; CHECK: br %r14 70 %cmp = icmp ugt <8 x i16> %val1, %val2 71 %ret = select <8 x i1> %cmp, <8 x i16> %val1, <8 x i16> %val2 72 ret <8 x i16> %ret 73 } 74 75 ; Test with uge. 76 define <8 x i16> @f8(<8 x i16> %val1, <8 x i16> %val2) { 77 ; CHECK-LABEL: f8: 78 ; CHECK: vmxlh %v24, {{%v24, %v26|%v26, %v24}} 79 ; CHECK: br %r14 80 %cmp = icmp uge <8 x i16> %val1, %val2 81 %ret = select <8 x i1> %cmp, <8 x i16> %val1, <8 x i16> %val2 82 ret <8 x i16> %ret 83 } 84