1 ; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
3 ;;; Test floating divide intrinsic instructions
6 ;;; We test VFDIV*vvl, VFDIV*vvl_v, VFDIV*rvl, VFDIV*rvl_v, VFDIV*vvml_v, and
7 ;;; VFDIV*rvml_v instructions.
9 ; Function Attrs: nounwind readnone
10 define fastcc <256 x double> @vfdivd_vvvl(<256 x double> %0, <256 x double> %1) {
11 ; CHECK-LABEL: vfdivd_vvvl:
13 ; CHECK-NEXT: lea %s0, 256
15 ; CHECK-NEXT: vfdiv.d %v0, %v0, %v1
16 ; CHECK-NEXT: b.l.t (, %s10)
17 %3 = tail call fast <256 x double> @llvm.ve.vl.vfdivd.vvvl(<256 x double> %0, <256 x double> %1, i32 256)
21 ; Function Attrs: nounwind readnone
22 declare <256 x double> @llvm.ve.vl.vfdivd.vvvl(<256 x double>, <256 x double>, i32)
24 ; Function Attrs: nounwind readnone
25 define fastcc <256 x double> @vfdivd_vvvvl(<256 x double> %0, <256 x double> %1, <256 x double> %2) {
26 ; CHECK-LABEL: vfdivd_vvvvl:
28 ; CHECK-NEXT: lea %s0, 128
30 ; CHECK-NEXT: vfdiv.d %v2, %v0, %v1
31 ; CHECK-NEXT: lea %s16, 256
32 ; CHECK-NEXT: lvl %s16
33 ; CHECK-NEXT: vor %v0, (0)1, %v2
34 ; CHECK-NEXT: b.l.t (, %s10)
35 %4 = tail call fast <256 x double> @llvm.ve.vl.vfdivd.vvvvl(<256 x double> %0, <256 x double> %1, <256 x double> %2, i32 128)
39 ; Function Attrs: nounwind readnone
40 declare <256 x double> @llvm.ve.vl.vfdivd.vvvvl(<256 x double>, <256 x double>, <256 x double>, i32)
42 ; Function Attrs: nounwind readnone
43 define fastcc <256 x double> @vfdivd_vsvl(double %0, <256 x double> %1) {
44 ; CHECK-LABEL: vfdivd_vsvl:
46 ; CHECK-NEXT: lea %s1, 256
48 ; CHECK-NEXT: vfdiv.d %v0, %s0, %v0
49 ; CHECK-NEXT: b.l.t (, %s10)
50 %3 = tail call fast <256 x double> @llvm.ve.vl.vfdivd.vsvl(double %0, <256 x double> %1, i32 256)
54 ; Function Attrs: nounwind readnone
55 declare <256 x double> @llvm.ve.vl.vfdivd.vsvl(double, <256 x double>, i32)
57 ; Function Attrs: nounwind readnone
58 define fastcc <256 x double> @vfdivd_vsvvl(double %0, <256 x double> %1, <256 x double> %2) {
59 ; CHECK-LABEL: vfdivd_vsvvl:
61 ; CHECK-NEXT: lea %s1, 128
63 ; CHECK-NEXT: vfdiv.d %v1, %s0, %v0
64 ; CHECK-NEXT: lea %s16, 256
65 ; CHECK-NEXT: lvl %s16
66 ; CHECK-NEXT: vor %v0, (0)1, %v1
67 ; CHECK-NEXT: b.l.t (, %s10)
68 %4 = tail call fast <256 x double> @llvm.ve.vl.vfdivd.vsvvl(double %0, <256 x double> %1, <256 x double> %2, i32 128)
72 ; Function Attrs: nounwind readnone
73 declare <256 x double> @llvm.ve.vl.vfdivd.vsvvl(double, <256 x double>, <256 x double>, i32)
75 ; Function Attrs: nounwind readnone
76 define fastcc <256 x double> @vfdivd_vvvmvl(<256 x double> %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3) {
77 ; CHECK-LABEL: vfdivd_vvvmvl:
79 ; CHECK-NEXT: lea %s0, 128
81 ; CHECK-NEXT: vfdiv.d %v2, %v0, %v1, %vm1
82 ; CHECK-NEXT: lea %s16, 256
83 ; CHECK-NEXT: lvl %s16
84 ; CHECK-NEXT: vor %v0, (0)1, %v2
85 ; CHECK-NEXT: b.l.t (, %s10)
86 %5 = tail call fast <256 x double> @llvm.ve.vl.vfdivd.vvvmvl(<256 x double> %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3, i32 128)
90 ; Function Attrs: nounwind readnone
91 declare <256 x double> @llvm.ve.vl.vfdivd.vvvmvl(<256 x double>, <256 x double>, <256 x i1>, <256 x double>, i32)
93 ; Function Attrs: nounwind readnone
94 define fastcc <256 x double> @vfdivd_vsvmvl(double %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3) {
95 ; CHECK-LABEL: vfdivd_vsvmvl:
97 ; CHECK-NEXT: lea %s1, 128
99 ; CHECK-NEXT: vfdiv.d %v1, %s0, %v0, %vm1
100 ; CHECK-NEXT: lea %s16, 256
101 ; CHECK-NEXT: lvl %s16
102 ; CHECK-NEXT: vor %v0, (0)1, %v1
103 ; CHECK-NEXT: b.l.t (, %s10)
104 %5 = tail call fast <256 x double> @llvm.ve.vl.vfdivd.vsvmvl(double %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3, i32 128)
105 ret <256 x double> %5
108 ; Function Attrs: nounwind readnone
109 declare <256 x double> @llvm.ve.vl.vfdivd.vsvmvl(double, <256 x double>, <256 x i1>, <256 x double>, i32)
111 ; Function Attrs: nounwind readnone
112 define fastcc <256 x double> @vfdivs_vvvl(<256 x double> %0, <256 x double> %1) {
113 ; CHECK-LABEL: vfdivs_vvvl:
115 ; CHECK-NEXT: lea %s0, 256
116 ; CHECK-NEXT: lvl %s0
117 ; CHECK-NEXT: vfdiv.s %v0, %v0, %v1
118 ; CHECK-NEXT: b.l.t (, %s10)
119 %3 = tail call fast <256 x double> @llvm.ve.vl.vfdivs.vvvl(<256 x double> %0, <256 x double> %1, i32 256)
120 ret <256 x double> %3
123 ; Function Attrs: nounwind readnone
124 declare <256 x double> @llvm.ve.vl.vfdivs.vvvl(<256 x double>, <256 x double>, i32)
126 ; Function Attrs: nounwind readnone
127 define fastcc <256 x double> @vfdivs_vvvvl(<256 x double> %0, <256 x double> %1, <256 x double> %2) {
128 ; CHECK-LABEL: vfdivs_vvvvl:
130 ; CHECK-NEXT: lea %s0, 128
131 ; CHECK-NEXT: lvl %s0
132 ; CHECK-NEXT: vfdiv.s %v2, %v0, %v1
133 ; CHECK-NEXT: lea %s16, 256
134 ; CHECK-NEXT: lvl %s16
135 ; CHECK-NEXT: vor %v0, (0)1, %v2
136 ; CHECK-NEXT: b.l.t (, %s10)
137 %4 = tail call fast <256 x double> @llvm.ve.vl.vfdivs.vvvvl(<256 x double> %0, <256 x double> %1, <256 x double> %2, i32 128)
138 ret <256 x double> %4
141 ; Function Attrs: nounwind readnone
142 declare <256 x double> @llvm.ve.vl.vfdivs.vvvvl(<256 x double>, <256 x double>, <256 x double>, i32)
144 ; Function Attrs: nounwind readnone
145 define fastcc <256 x double> @vfdivs_vsvl(float %0, <256 x double> %1) {
146 ; CHECK-LABEL: vfdivs_vsvl:
148 ; CHECK-NEXT: lea %s1, 256
149 ; CHECK-NEXT: lvl %s1
150 ; CHECK-NEXT: vfdiv.s %v0, %s0, %v0
151 ; CHECK-NEXT: b.l.t (, %s10)
152 %3 = tail call fast <256 x double> @llvm.ve.vl.vfdivs.vsvl(float %0, <256 x double> %1, i32 256)
153 ret <256 x double> %3
156 ; Function Attrs: nounwind readnone
157 declare <256 x double> @llvm.ve.vl.vfdivs.vsvl(float, <256 x double>, i32)
159 ; Function Attrs: nounwind readnone
160 define fastcc <256 x double> @vfdivs_vsvvl(float %0, <256 x double> %1, <256 x double> %2) {
161 ; CHECK-LABEL: vfdivs_vsvvl:
163 ; CHECK-NEXT: lea %s1, 128
164 ; CHECK-NEXT: lvl %s1
165 ; CHECK-NEXT: vfdiv.s %v1, %s0, %v0
166 ; CHECK-NEXT: lea %s16, 256
167 ; CHECK-NEXT: lvl %s16
168 ; CHECK-NEXT: vor %v0, (0)1, %v1
169 ; CHECK-NEXT: b.l.t (, %s10)
170 %4 = tail call fast <256 x double> @llvm.ve.vl.vfdivs.vsvvl(float %0, <256 x double> %1, <256 x double> %2, i32 128)
171 ret <256 x double> %4
174 ; Function Attrs: nounwind readnone
175 declare <256 x double> @llvm.ve.vl.vfdivs.vsvvl(float, <256 x double>, <256 x double>, i32)
177 ; Function Attrs: nounwind readnone
178 define fastcc <256 x double> @vfdivs_vvvmvl(<256 x double> %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3) {
179 ; CHECK-LABEL: vfdivs_vvvmvl:
181 ; CHECK-NEXT: lea %s0, 128
182 ; CHECK-NEXT: lvl %s0
183 ; CHECK-NEXT: vfdiv.s %v2, %v0, %v1, %vm1
184 ; CHECK-NEXT: lea %s16, 256
185 ; CHECK-NEXT: lvl %s16
186 ; CHECK-NEXT: vor %v0, (0)1, %v2
187 ; CHECK-NEXT: b.l.t (, %s10)
188 %5 = tail call fast <256 x double> @llvm.ve.vl.vfdivs.vvvmvl(<256 x double> %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3, i32 128)
189 ret <256 x double> %5
192 ; Function Attrs: nounwind readnone
193 declare <256 x double> @llvm.ve.vl.vfdivs.vvvmvl(<256 x double>, <256 x double>, <256 x i1>, <256 x double>, i32)
195 ; Function Attrs: nounwind readnone
196 define fastcc <256 x double> @vfdivs_vsvmvl(float %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3) {
197 ; CHECK-LABEL: vfdivs_vsvmvl:
199 ; CHECK-NEXT: lea %s1, 128
200 ; CHECK-NEXT: lvl %s1
201 ; CHECK-NEXT: vfdiv.s %v1, %s0, %v0, %vm1
202 ; CHECK-NEXT: lea %s16, 256
203 ; CHECK-NEXT: lvl %s16
204 ; CHECK-NEXT: vor %v0, (0)1, %v1
205 ; CHECK-NEXT: b.l.t (, %s10)
206 %5 = tail call fast <256 x double> @llvm.ve.vl.vfdivs.vsvmvl(float %0, <256 x double> %1, <256 x i1> %2, <256 x double> %3, i32 128)
207 ret <256 x double> %5
210 ; Function Attrs: nounwind readnone
211 declare <256 x double> @llvm.ve.vl.vfdivs.vsvmvl(float, <256 x double>, <256 x i1>, <256 x double>, i32)