1 ; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
3 ;;; Test vector floating compare and select maximum intrinsic instructions
6 ;;; We test VFRMAX*vl and VFRMAX*vl_v instructions.
8 ; Function Attrs: nounwind readnone
9 define fastcc <256 x double> @vfrmaxdfst_vvl(<256 x double> %0) {
10 ; CHECK-LABEL: vfrmaxdfst_vvl:
12 ; CHECK-NEXT: lea %s0, 256
14 ; CHECK-NEXT: vfrmax.d.fst %v0, %v0
15 ; CHECK-NEXT: b.l.t (, %s10)
16 %2 = tail call fast <256 x double> @llvm.ve.vl.vfrmaxdfst.vvl(<256 x double> %0, i32 256)
20 ; Function Attrs: nounwind readnone
21 declare <256 x double> @llvm.ve.vl.vfrmaxdfst.vvl(<256 x double>, i32)
23 ; Function Attrs: nounwind readnone
24 define fastcc <256 x double> @vfrmaxdfst_vvvl(<256 x double> %0, <256 x double> %1) {
25 ; CHECK-LABEL: vfrmaxdfst_vvvl:
27 ; CHECK-NEXT: lea %s0, 128
29 ; CHECK-NEXT: vfrmax.d.fst %v1, %v0
30 ; CHECK-NEXT: lea %s16, 256
31 ; CHECK-NEXT: lvl %s16
32 ; CHECK-NEXT: vor %v0, (0)1, %v1
33 ; CHECK-NEXT: b.l.t (, %s10)
34 %3 = tail call fast <256 x double> @llvm.ve.vl.vfrmaxdfst.vvvl(<256 x double> %0, <256 x double> %1, i32 128)
38 ; Function Attrs: nounwind readnone
39 declare <256 x double> @llvm.ve.vl.vfrmaxdfst.vvvl(<256 x double>, <256 x double>, i32)
41 ; Function Attrs: nounwind readnone
42 define fastcc <256 x double> @vfrmaxdlst_vvl(<256 x double> %0) {
43 ; CHECK-LABEL: vfrmaxdlst_vvl:
45 ; CHECK-NEXT: lea %s0, 256
47 ; CHECK-NEXT: vfrmax.d.lst %v0, %v0
48 ; CHECK-NEXT: b.l.t (, %s10)
49 %2 = tail call fast <256 x double> @llvm.ve.vl.vfrmaxdlst.vvl(<256 x double> %0, i32 256)
53 ; Function Attrs: nounwind readnone
54 declare <256 x double> @llvm.ve.vl.vfrmaxdlst.vvl(<256 x double>, i32)
56 ; Function Attrs: nounwind readnone
57 define fastcc <256 x double> @vfrmaxdlst_vvvl(<256 x double> %0, <256 x double> %1) {
58 ; CHECK-LABEL: vfrmaxdlst_vvvl:
60 ; CHECK-NEXT: lea %s0, 128
62 ; CHECK-NEXT: vfrmax.d.lst %v1, %v0
63 ; CHECK-NEXT: lea %s16, 256
64 ; CHECK-NEXT: lvl %s16
65 ; CHECK-NEXT: vor %v0, (0)1, %v1
66 ; CHECK-NEXT: b.l.t (, %s10)
67 %3 = tail call fast <256 x double> @llvm.ve.vl.vfrmaxdlst.vvvl(<256 x double> %0, <256 x double> %1, i32 128)
71 ; Function Attrs: nounwind readnone
72 declare <256 x double> @llvm.ve.vl.vfrmaxdlst.vvvl(<256 x double>, <256 x double>, i32)
74 ; Function Attrs: nounwind readnone
75 define fastcc <256 x double> @vfrmaxsfst_vvl(<256 x double> %0) {
76 ; CHECK-LABEL: vfrmaxsfst_vvl:
78 ; CHECK-NEXT: lea %s0, 256
80 ; CHECK-NEXT: vfrmax.s.fst %v0, %v0
81 ; CHECK-NEXT: b.l.t (, %s10)
82 %2 = tail call fast <256 x double> @llvm.ve.vl.vfrmaxsfst.vvl(<256 x double> %0, i32 256)
86 ; Function Attrs: nounwind readnone
87 declare <256 x double> @llvm.ve.vl.vfrmaxsfst.vvl(<256 x double>, i32)
89 ; Function Attrs: nounwind readnone
90 define fastcc <256 x double> @vfrmaxsfst_vvvl(<256 x double> %0, <256 x double> %1) {
91 ; CHECK-LABEL: vfrmaxsfst_vvvl:
93 ; CHECK-NEXT: lea %s0, 128
95 ; CHECK-NEXT: vfrmax.s.fst %v1, %v0
96 ; CHECK-NEXT: lea %s16, 256
97 ; CHECK-NEXT: lvl %s16
98 ; CHECK-NEXT: vor %v0, (0)1, %v1
99 ; CHECK-NEXT: b.l.t (, %s10)
100 %3 = tail call fast <256 x double> @llvm.ve.vl.vfrmaxsfst.vvvl(<256 x double> %0, <256 x double> %1, i32 128)
101 ret <256 x double> %3
104 ; Function Attrs: nounwind readnone
105 declare <256 x double> @llvm.ve.vl.vfrmaxsfst.vvvl(<256 x double>, <256 x double>, i32)
107 ; Function Attrs: nounwind readnone
108 define fastcc <256 x double> @vfrmaxslst_vvl(<256 x double> %0) {
109 ; CHECK-LABEL: vfrmaxslst_vvl:
111 ; CHECK-NEXT: lea %s0, 256
112 ; CHECK-NEXT: lvl %s0
113 ; CHECK-NEXT: vfrmax.s.lst %v0, %v0
114 ; CHECK-NEXT: b.l.t (, %s10)
115 %2 = tail call fast <256 x double> @llvm.ve.vl.vfrmaxslst.vvl(<256 x double> %0, i32 256)
116 ret <256 x double> %2
119 ; Function Attrs: nounwind readnone
120 declare <256 x double> @llvm.ve.vl.vfrmaxslst.vvl(<256 x double>, i32)
122 ; Function Attrs: nounwind readnone
123 define fastcc <256 x double> @vfrmaxslst_vvvl(<256 x double> %0, <256 x double> %1) {
124 ; CHECK-LABEL: vfrmaxslst_vvvl:
126 ; CHECK-NEXT: lea %s0, 128
127 ; CHECK-NEXT: lvl %s0
128 ; CHECK-NEXT: vfrmax.s.lst %v1, %v0
129 ; CHECK-NEXT: lea %s16, 256
130 ; CHECK-NEXT: lvl %s16
131 ; CHECK-NEXT: vor %v0, (0)1, %v1
132 ; CHECK-NEXT: b.l.t (, %s10)
133 %3 = tail call fast <256 x double> @llvm.ve.vl.vfrmaxslst.vvvl(<256 x double> %0, <256 x double> %1, i32 128)
134 ret <256 x double> %3
137 ; Function Attrs: nounwind readnone
138 declare <256 x double> @llvm.ve.vl.vfrmaxslst.vvvl(<256 x double>, <256 x double>, i32)