1 ; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
3 ;;; Test vector floating reciprocal square root intrinsic instructions
6 ;;; We test VRSQRT*vl, VRSQRT*vl_v, PVRSQRT*vl, and PVRSQRT*vl_v
9 ; Function Attrs: nounwind readnone
10 define fastcc <256 x double> @vrsqrtd_vvl(<256 x double> %0) {
11 ; CHECK-LABEL: vrsqrtd_vvl:
13 ; CHECK-NEXT: lea %s0, 256
15 ; CHECK-NEXT: vrsqrt.d %v0, %v0
16 ; CHECK-NEXT: b.l.t (, %s10)
17 %2 = tail call fast <256 x double> @llvm.ve.vl.vrsqrtd.vvl(<256 x double> %0, i32 256)
21 ; Function Attrs: nounwind readnone
22 declare <256 x double> @llvm.ve.vl.vrsqrtd.vvl(<256 x double>, i32)
24 ; Function Attrs: nounwind readnone
25 define fastcc <256 x double> @vrsqrtd_vvvl(<256 x double> %0, <256 x double> %1) {
26 ; CHECK-LABEL: vrsqrtd_vvvl:
28 ; CHECK-NEXT: lea %s0, 128
30 ; CHECK-NEXT: vrsqrt.d %v1, %v0
31 ; CHECK-NEXT: lea %s16, 256
32 ; CHECK-NEXT: lvl %s16
33 ; CHECK-NEXT: vor %v0, (0)1, %v1
34 ; CHECK-NEXT: b.l.t (, %s10)
35 %3 = tail call fast <256 x double> @llvm.ve.vl.vrsqrtd.vvvl(<256 x double> %0, <256 x double> %1, i32 128)
39 ; Function Attrs: nounwind readnone
40 declare <256 x double> @llvm.ve.vl.vrsqrtd.vvvl(<256 x double>, <256 x double>, i32)
42 ; Function Attrs: nounwind readnone
43 define fastcc <256 x double> @vrsqrts_vvl(<256 x double> %0) {
44 ; CHECK-LABEL: vrsqrts_vvl:
46 ; CHECK-NEXT: lea %s0, 256
48 ; CHECK-NEXT: vrsqrt.s %v0, %v0
49 ; CHECK-NEXT: b.l.t (, %s10)
50 %2 = tail call fast <256 x double> @llvm.ve.vl.vrsqrts.vvl(<256 x double> %0, i32 256)
54 ; Function Attrs: nounwind readnone
55 declare <256 x double> @llvm.ve.vl.vrsqrts.vvl(<256 x double>, i32)
57 ; Function Attrs: nounwind readnone
58 define fastcc <256 x double> @vrsqrts_vvvl(<256 x double> %0, <256 x double> %1) {
59 ; CHECK-LABEL: vrsqrts_vvvl:
61 ; CHECK-NEXT: lea %s0, 128
63 ; CHECK-NEXT: vrsqrt.s %v1, %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 %3 = tail call fast <256 x double> @llvm.ve.vl.vrsqrts.vvvl(<256 x double> %0, <256 x double> %1, i32 128)
72 ; Function Attrs: nounwind readnone
73 declare <256 x double> @llvm.ve.vl.vrsqrts.vvvl(<256 x double>, <256 x double>, i32)
75 ; Function Attrs: nounwind readnone
76 define fastcc <256 x double> @vrsqrtdnex_vvl(<256 x double> %0) {
77 ; CHECK-LABEL: vrsqrtdnex_vvl:
79 ; CHECK-NEXT: lea %s0, 256
81 ; CHECK-NEXT: vrsqrt.d.nex %v0, %v0
82 ; CHECK-NEXT: b.l.t (, %s10)
83 %2 = tail call fast <256 x double> @llvm.ve.vl.vrsqrtdnex.vvl(<256 x double> %0, i32 256)
87 ; Function Attrs: nounwind readnone
88 declare <256 x double> @llvm.ve.vl.vrsqrtdnex.vvl(<256 x double>, i32)
90 ; Function Attrs: nounwind readnone
91 define fastcc <256 x double> @vrsqrtdnex_vvvl(<256 x double> %0, <256 x double> %1) {
92 ; CHECK-LABEL: vrsqrtdnex_vvvl:
94 ; CHECK-NEXT: lea %s0, 128
96 ; CHECK-NEXT: vrsqrt.d.nex %v1, %v0
97 ; CHECK-NEXT: lea %s16, 256
98 ; CHECK-NEXT: lvl %s16
99 ; CHECK-NEXT: vor %v0, (0)1, %v1
100 ; CHECK-NEXT: b.l.t (, %s10)
101 %3 = tail call fast <256 x double> @llvm.ve.vl.vrsqrtdnex.vvvl(<256 x double> %0, <256 x double> %1, i32 128)
102 ret <256 x double> %3
105 ; Function Attrs: nounwind readnone
106 declare <256 x double> @llvm.ve.vl.vrsqrtdnex.vvvl(<256 x double>, <256 x double>, i32)
108 ; Function Attrs: nounwind readnone
109 define fastcc <256 x double> @vrsqrtsnex_vvl(<256 x double> %0) {
110 ; CHECK-LABEL: vrsqrtsnex_vvl:
112 ; CHECK-NEXT: lea %s0, 256
113 ; CHECK-NEXT: lvl %s0
114 ; CHECK-NEXT: vrsqrt.s.nex %v0, %v0
115 ; CHECK-NEXT: b.l.t (, %s10)
116 %2 = tail call fast <256 x double> @llvm.ve.vl.vrsqrtsnex.vvl(<256 x double> %0, i32 256)
117 ret <256 x double> %2
120 ; Function Attrs: nounwind readnone
121 declare <256 x double> @llvm.ve.vl.vrsqrtsnex.vvl(<256 x double>, i32)
123 ; Function Attrs: nounwind readnone
124 define fastcc <256 x double> @vrsqrtsnex_vvvl(<256 x double> %0, <256 x double> %1) {
125 ; CHECK-LABEL: vrsqrtsnex_vvvl:
127 ; CHECK-NEXT: lea %s0, 128
128 ; CHECK-NEXT: lvl %s0
129 ; CHECK-NEXT: vrsqrt.s.nex %v1, %v0
130 ; CHECK-NEXT: lea %s16, 256
131 ; CHECK-NEXT: lvl %s16
132 ; CHECK-NEXT: vor %v0, (0)1, %v1
133 ; CHECK-NEXT: b.l.t (, %s10)
134 %3 = tail call fast <256 x double> @llvm.ve.vl.vrsqrtsnex.vvvl(<256 x double> %0, <256 x double> %1, i32 128)
135 ret <256 x double> %3
138 ; Function Attrs: nounwind readnone
139 declare <256 x double> @llvm.ve.vl.vrsqrtsnex.vvvl(<256 x double>, <256 x double>, i32)
141 ; Function Attrs: nounwind readnone
142 define fastcc <256 x double> @pvrsqrt_vvl(<256 x double> %0) {
143 ; CHECK-LABEL: pvrsqrt_vvl:
145 ; CHECK-NEXT: lea %s0, 256
146 ; CHECK-NEXT: lvl %s0
147 ; CHECK-NEXT: pvrsqrt %v0, %v0
148 ; CHECK-NEXT: b.l.t (, %s10)
149 %2 = tail call fast <256 x double> @llvm.ve.vl.pvrsqrt.vvl(<256 x double> %0, i32 256)
150 ret <256 x double> %2
153 ; Function Attrs: nounwind readnone
154 declare <256 x double> @llvm.ve.vl.pvrsqrt.vvl(<256 x double>, i32)
156 ; Function Attrs: nounwind readnone
157 define fastcc <256 x double> @pvrsqrt_vvvl(<256 x double> %0, <256 x double> %1) {
158 ; CHECK-LABEL: pvrsqrt_vvvl:
160 ; CHECK-NEXT: lea %s0, 128
161 ; CHECK-NEXT: lvl %s0
162 ; CHECK-NEXT: pvrsqrt %v1, %v0
163 ; CHECK-NEXT: lea %s16, 256
164 ; CHECK-NEXT: lvl %s16
165 ; CHECK-NEXT: vor %v0, (0)1, %v1
166 ; CHECK-NEXT: b.l.t (, %s10)
167 %3 = tail call fast <256 x double> @llvm.ve.vl.pvrsqrt.vvvl(<256 x double> %0, <256 x double> %1, i32 128)
168 ret <256 x double> %3
171 ; Function Attrs: nounwind readnone
172 declare <256 x double> @llvm.ve.vl.pvrsqrt.vvvl(<256 x double>, <256 x double>, i32)
174 ; Function Attrs: nounwind readnone
175 define fastcc <256 x double> @pvrsqrtnex_vvl(<256 x double> %0) {
176 ; CHECK-LABEL: pvrsqrtnex_vvl:
178 ; CHECK-NEXT: lea %s0, 256
179 ; CHECK-NEXT: lvl %s0
180 ; CHECK-NEXT: pvrsqrt.nex %v0, %v0
181 ; CHECK-NEXT: b.l.t (, %s10)
182 %2 = tail call fast <256 x double> @llvm.ve.vl.pvrsqrtnex.vvl(<256 x double> %0, i32 256)
183 ret <256 x double> %2
186 ; Function Attrs: nounwind readnone
187 declare <256 x double> @llvm.ve.vl.pvrsqrtnex.vvl(<256 x double>, i32)
189 ; Function Attrs: nounwind readnone
190 define fastcc <256 x double> @pvrsqrtnex_vvvl(<256 x double> %0, <256 x double> %1) {
191 ; CHECK-LABEL: pvrsqrtnex_vvvl:
193 ; CHECK-NEXT: lea %s0, 128
194 ; CHECK-NEXT: lvl %s0
195 ; CHECK-NEXT: pvrsqrt.nex %v1, %v0
196 ; CHECK-NEXT: lea %s16, 256
197 ; CHECK-NEXT: lvl %s16
198 ; CHECK-NEXT: vor %v0, (0)1, %v1
199 ; CHECK-NEXT: b.l.t (, %s10)
200 %3 = tail call fast <256 x double> @llvm.ve.vl.pvrsqrtnex.vvvl(<256 x double> %0, <256 x double> %1, i32 128)
201 ret <256 x double> %3
204 ; Function Attrs: nounwind readnone
205 declare <256 x double> @llvm.ve.vl.pvrsqrtnex.vvvl(<256 x double>, <256 x double>, i32)