Debian Codegraph @

llvm/test/CodeGen/VE/VELIntrinsics/vrsqrt.ll

raw
1 ; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
2
3 ;;; Test vector floating reciprocal square root intrinsic instructions
4 ;;;
5 ;;; Note:
6 ;;; We test VRSQRT*vl, VRSQRT*vl_v, PVRSQRT*vl, and PVRSQRT*vl_v
7 ;;; instructions.
8
9 ; Function Attrs: nounwind readnone
10 define fastcc <256 x double> @vrsqrtd_vvl(<256 x double> %0) {
11 ; CHECK-LABEL: vrsqrtd_vvl:
12 ; CHECK: # %bb.0:
13 ; CHECK-NEXT: lea %s0, 256
14 ; CHECK-NEXT: lvl %s0
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)
18 ret <256 x double> %2
19 }
20
21 ; Function Attrs: nounwind readnone
22 declare <256 x double> @llvm.ve.vl.vrsqrtd.vvl(<256 x double>, i32)
23
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:
27 ; CHECK: # %bb.0:
28 ; CHECK-NEXT: lea %s0, 128
29 ; CHECK-NEXT: lvl %s0
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)
36 ret <256 x double> %3
37 }
38
39 ; Function Attrs: nounwind readnone
40 declare <256 x double> @llvm.ve.vl.vrsqrtd.vvvl(<256 x double>, <256 x double>, i32)
41
42 ; Function Attrs: nounwind readnone
43 define fastcc <256 x double> @vrsqrts_vvl(<256 x double> %0) {
44 ; CHECK-LABEL: vrsqrts_vvl:
45 ; CHECK: # %bb.0:
46 ; CHECK-NEXT: lea %s0, 256
47 ; CHECK-NEXT: lvl %s0
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)
51 ret <256 x double> %2
52 }
53
54 ; Function Attrs: nounwind readnone
55 declare <256 x double> @llvm.ve.vl.vrsqrts.vvl(<256 x double>, i32)
56
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:
60 ; CHECK: # %bb.0:
61 ; CHECK-NEXT: lea %s0, 128
62 ; CHECK-NEXT: lvl %s0
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)
69 ret <256 x double> %3
70 }
71
72 ; Function Attrs: nounwind readnone
73 declare <256 x double> @llvm.ve.vl.vrsqrts.vvvl(<256 x double>, <256 x double>, i32)
74
75 ; Function Attrs: nounwind readnone
76 define fastcc <256 x double> @vrsqrtdnex_vvl(<256 x double> %0) {
77 ; CHECK-LABEL: vrsqrtdnex_vvl:
78 ; CHECK: # %bb.0:
79 ; CHECK-NEXT: lea %s0, 256
80 ; CHECK-NEXT: lvl %s0
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)
84 ret <256 x double> %2
85 }
86
87 ; Function Attrs: nounwind readnone
88 declare <256 x double> @llvm.ve.vl.vrsqrtdnex.vvl(<256 x double>, i32)
89
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:
93 ; CHECK: # %bb.0:
94 ; CHECK-NEXT: lea %s0, 128
95 ; CHECK-NEXT: lvl %s0
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
103 }
104
105 ; Function Attrs: nounwind readnone
106 declare <256 x double> @llvm.ve.vl.vrsqrtdnex.vvvl(<256 x double>, <256 x double>, i32)
107
108 ; Function Attrs: nounwind readnone
109 define fastcc <256 x double> @vrsqrtsnex_vvl(<256 x double> %0) {
110 ; CHECK-LABEL: vrsqrtsnex_vvl:
111 ; CHECK: # %bb.0:
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
118 }
119
120 ; Function Attrs: nounwind readnone
121 declare <256 x double> @llvm.ve.vl.vrsqrtsnex.vvl(<256 x double>, i32)
122
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:
126 ; CHECK: # %bb.0:
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
136 }
137
138 ; Function Attrs: nounwind readnone
139 declare <256 x double> @llvm.ve.vl.vrsqrtsnex.vvvl(<256 x double>, <256 x double>, i32)
140
141 ; Function Attrs: nounwind readnone
142 define fastcc <256 x double> @pvrsqrt_vvl(<256 x double> %0) {
143 ; CHECK-LABEL: pvrsqrt_vvl:
144 ; CHECK: # %bb.0:
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
151 }
152
153 ; Function Attrs: nounwind readnone
154 declare <256 x double> @llvm.ve.vl.pvrsqrt.vvl(<256 x double>, i32)
155
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:
159 ; CHECK: # %bb.0:
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
169 }
170
171 ; Function Attrs: nounwind readnone
172 declare <256 x double> @llvm.ve.vl.pvrsqrt.vvvl(<256 x double>, <256 x double>, i32)
173
174 ; Function Attrs: nounwind readnone
175 define fastcc <256 x double> @pvrsqrtnex_vvl(<256 x double> %0) {
176 ; CHECK-LABEL: pvrsqrtnex_vvl:
177 ; CHECK: # %bb.0:
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
184 }
185
186 ; Function Attrs: nounwind readnone
187 declare <256 x double> @llvm.ve.vl.pvrsqrtnex.vvl(<256 x double>, i32)
188
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:
192 ; CHECK: # %bb.0:
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
202 }
203
204 ; Function Attrs: nounwind readnone
205 declare <256 x double> @llvm.ve.vl.pvrsqrtnex.vvvl(<256 x double>, <256 x double>, i32)