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