1/* Optimized cosf function.
2 Copyright (C) 2012-2017 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
18
19#include <sysdep.h>
20#include <errno.h>
21
22/* Short algorithm description:
23 *
24 * 1) if |x| == 0: return 1.0-|x|.
25 * 2) if |x| < 2^-27: return 1.0-|x|.
26 * 3) if |x| < 2^-5 : return 1.0+x^2*DP_COS2_0+x^5*DP_COS2_1.
27 * 4) if |x| < Pi/4: return 1.0+x^2*(C0+x^2*(C1+x^2*(C2+x^2*(C3+x^2*C4)))).
28 * 5) if |x| < 9*Pi/4:
29 * 5.1) Range reduction: k=trunc(|x|/(Pi/4)), j=(k+1)&0x0e, n=k+3,
30 * t=|x|-j*Pi/4.
31 * 5.2) Reconstruction:
32 * s = (-1.0)^((n>>2)&1)
33 * if(n&2 != 0) {
34 * using cos(t) polynomial for |t|<Pi/4, result is
35 * s * (1.0+t^2*(C0+t^2*(C1+t^2*(C2+t^2*(C3+t^2*C4))))).
36 * } else {
37 * using sin(t) polynomial for |t|<Pi/4, result is
38 * s * t * (1.0+t^2*(S0+t^2*(S1+t^2*(S2+t^2*(S3+t^2*S4))))).
39 * }
40 * 6) if |x| < 2^23, large args:
41 * 6.1) Range reduction: k=trunc(|x|/(Pi/4)), j=(k+1)&0xfffffffe, n=k+3,
42 * t=|x|-j*Pi/4.
43 * 6.2) Reconstruction same as (5.2).
44 * 7) if |x| >= 2^23, very large args:
45 * 7.1) Range reduction: k=trunc(|x|/(Pi/4)), j=(k+1)&0xfffffffe, n=k+3,
46 * t=|x|-j*Pi/4.
47 * 7.2) Reconstruction same as (5.2).
48 * 8) if x is Inf, return x-x, and set errno=EDOM.
49 * 9) if x is NaN, return x-x.
50 *
51 * Special cases:
52 * cos(+-0) = 1 not raising inexact,
53 * cos(subnormal) raises inexact,
54 * cos(min_normalized) raises inexact,
55 * cos(normalized) raises inexact,
56 * cos(Inf) = NaN, raises invalid, sets errno to EDOM,
57 * cos(NaN) = NaN.
58 */
59
60 .text
61ENTRY(__cosf)
62 /* Input: single precision x in %xmm0 */
63
64 movd %xmm0, %eax /* Bits of x */
65 movaps %xmm0, %xmm7 /* Copy of x */
66 cvtss2sd %xmm0, %xmm0 /* DP x */
67 movss L(SP_ABS_MASK)(%rip), %xmm3
68 andl $0x7fffffff, %eax /* |x| */
69
70 cmpl $0x3f490fdb, %eax /* |x|<Pi/4? */
71 jb L(arg_less_pio4)
72
73 /* Here if |x|>=Pi/4 */
74 andps %xmm7, %xmm3 /* SP |x| */
75 andpd L(DP_ABS_MASK)(%rip), %xmm0 /* DP |x| */
76 movss L(SP_INVPIO4)(%rip), %xmm2 /* SP 1/(Pi/4) */
77
78 cmpl $0x40e231d6, %eax /* |x|<9*Pi/4? */
79 jae L(large_args)
80
81 /* Here if Pi/4<=|x|<9*Pi/4 */
82 mulss %xmm3, %xmm2 /* SP |x|/(Pi/4) */
83 cvttss2si %xmm2, %eax /* k, number of Pi/4 in x */
84 lea L(PIO4J)(%rip), %rsi
85 addl $1, %eax /* k+1 */
86 movl $0x0e, %edx
87 andl %eax, %edx /* j = (k+1)&0x0e */
88 addl $2, %eax /* n */
89 subsd (%rsi,%rdx,8), %xmm0 /* t = |x| - j * Pi/4 */
90
91L(reconstruction):
92 /* Input: %eax=n, %xmm0=t */
93 testl $2, %eax /* n&2 != 0? */
94 jz L(sin_poly)
95
96/*L(cos_poly):*/
97 /* Here if cos(x) calculated using cos(t) polynomial for |t|<Pi/4:
98 * y = t*t; z = y*y;
99 * s = sign(x) * (-1.0)^((n>>2)&1)
100 * result = s * (1.0+t^2*(C0+t^2*(C1+t^2*(C2+t^2*(C3+t^2*C4)))))
101 */
102 shrl $2, %eax /* n>>2 */
103 mulsd %xmm0, %xmm0 /* y=t^2 */
104 andl $1, %eax /* (n>>2)&1 */
105 movaps %xmm0, %xmm1 /* y */
106 mulsd %xmm0, %xmm0 /* z=t^4 */
107
108 movsd L(DP_C4)(%rip), %xmm4 /* C4 */
109 mulsd %xmm0, %xmm4 /* z*C4 */
110 movsd L(DP_C3)(%rip), %xmm3 /* C3 */
111 mulsd %xmm0, %xmm3 /* z*C3 */
112 lea L(DP_ONES)(%rip), %rsi
113 addsd L(DP_C2)(%rip), %xmm4 /* C2+z*C4 */
114 mulsd %xmm0, %xmm4 /* z*(C2+z*C4) */
115 addsd L(DP_C1)(%rip), %xmm3 /* C1+z*C3 */
116 mulsd %xmm0, %xmm3 /* z*(C1+z*C3) */
117 addsd L(DP_C0)(%rip), %xmm4 /* C0+z*(C2+z*C4) */
118 mulsd %xmm1, %xmm4 /* y*(C0+z*(C2+z*C4)) */
119
120 addsd %xmm4, %xmm3 /* y*(C0+y*(C1+y*(C2+y*(C3+y*C4)))) */
121 /* 1.0+y*(C0+y*(C1+y*(C2+y*(C3+y*C4)))) */
122 addsd L(DP_ONES)(%rip), %xmm3
123
124 mulsd (%rsi,%rax,8), %xmm3 /* DP result */
125 cvtsd2ss %xmm3, %xmm0 /* SP result */
126 ret
127
128 .p2align 4
129L(sin_poly):
130 /* Here if cos(x) calculated using sin(t) polynomial for |t|<Pi/4:
131 * y = t*t; z = y*y;
132 * s = sign(x) * (-1.0)^((n>>2)&1)
133 * result = s * t * (1.0+t^2*(S0+t^2*(S1+t^2*(S2+t^2*(S3+t^2*S4)))))
134 */
135
136 movaps %xmm0, %xmm4 /* t */
137 shrl $2, %eax /* n>>2 */
138 mulsd %xmm0, %xmm0 /* y=t^2 */
139 andl $1, %eax /* (n>>2)&1 */
140 movaps %xmm0, %xmm1 /* y */
141 mulsd %xmm0, %xmm0 /* z=t^4 */
142
143 movsd L(DP_S4)(%rip), %xmm2 /* S4 */
144 mulsd %xmm0, %xmm2 /* z*S4 */
145 movsd L(DP_S3)(%rip), %xmm3 /* S3 */
146 mulsd %xmm0, %xmm3 /* z*S3 */
147 lea L(DP_ONES)(%rip), %rsi
148 addsd L(DP_S2)(%rip), %xmm2 /* S2+z*S4 */
149 mulsd %xmm0, %xmm2 /* z*(S2+z*S4) */
150 addsd L(DP_S1)(%rip), %xmm3 /* S1+z*S3 */
151 mulsd %xmm0, %xmm3 /* z*(S1+z*S3) */
152 addsd L(DP_S0)(%rip), %xmm2 /* S0+z*(S2+z*S4) */
153 mulsd %xmm1, %xmm2 /* y*(S0+z*(S2+z*S4)) */
154 /* t*s, where s = sign(x) * (-1.0)^((n>>2)&1) */
155 mulsd (%rsi,%rax,8), %xmm4
156 /* y*(S0+y*(S1+y*(S2+y*(S3+y*S4)))) */
157 addsd %xmm2, %xmm3
158 /* t*s*y*(S0+y*(S1+y*(S2+y*(S3+y*S4)))) */
159 mulsd %xmm4, %xmm3
160 /* t*s*(1.0+y*(S0+y*(S1+y*(S2+y*(S3+y*S4)))) */
161 addsd %xmm4, %xmm3
162 cvtsd2ss %xmm3, %xmm0 /* SP result */
163 ret
164
165 .p2align 4
166L(large_args):
167 /* Here if |x|>=9*Pi/4 */
168 cmpl $0x7f800000, %eax /* x is Inf or NaN? */
169 jae L(arg_inf_or_nan)
170
171 /* Here if finite |x|>=9*Pi/4 */
172 cmpl $0x4b000000, %eax /* |x|<2^23? */
173 jae L(very_large_args)
174
175 /* Here if 9*Pi/4<=|x|<2^23 */
176 movsd L(DP_INVPIO4)(%rip), %xmm1 /* 1/(Pi/4) */
177 mulsd %xmm0, %xmm1 /* |x|/(Pi/4) */
178 cvttsd2si %xmm1, %eax /* k=trunc(|x|/(Pi/4)) */
179 addl $1, %eax /* k+1 */
180 movl %eax, %edx
181 andl $0xfffffffe, %edx /* j=(k+1)&0xfffffffe */
182 cvtsi2sdl %edx, %xmm4 /* DP j */
183 movsd L(DP_PIO4HI)(%rip), %xmm2 /* -PIO4HI = high part of -Pi/4 */
184 mulsd %xmm4, %xmm2 /* -j*PIO4HI */
185 movsd L(DP_PIO4LO)(%rip), %xmm3 /* -PIO4LO = low part of -Pi/4 */
186 addsd %xmm2, %xmm0 /* |x| - j*PIO4HI */
187 addl $2, %eax /* n */
188 mulsd %xmm3, %xmm4 /* j*PIO4LO */
189 addsd %xmm4, %xmm0 /* t = |x| - j*PIO4HI - j*PIO4LO */
190 jmp L(reconstruction)
191
192 .p2align 4
193L(very_large_args):
194 /* Here if finite |x|>=2^23 */
195
196 /* bitpos = (ix>>23) - BIAS_32 + 59; */
197 shrl $23, %eax /* eb = biased exponent of x */
198 /* bitpos = eb - 0x7f + 59, where 0x7f is exponent bias */
199 subl $68, %eax
200 movl $28, %ecx /* %cl=28 */
201 movl %eax, %edx /* bitpos copy */
202
203 /* j = bitpos/28; */
204 div %cl /* j in register %al=%ax/%cl */
205 movapd %xmm0, %xmm3 /* |x| */
206 /* clear unneeded remainder from %ah */
207 andl $0xff, %eax
208
209 imull $28, %eax, %ecx /* j*28 */
210 lea L(_FPI)(%rip), %rsi
211 movsd L(DP_HI_MASK)(%rip), %xmm4 /* DP_HI_MASK */
212 movapd %xmm0, %xmm5 /* |x| */
213 mulsd -16(%rsi,%rax,8), %xmm3 /* tmp3 = FPI[j-2]*|x| */
214 movapd %xmm0, %xmm1 /* |x| */
215 mulsd -8(%rsi,%rax,8), %xmm5 /* tmp2 = FPI[j-1]*|x| */
216 mulsd (%rsi,%rax,8), %xmm0 /* tmp0 = FPI[j]*|x| */
217 addl $19, %ecx /* j*28+19 */
218 mulsd 8(%rsi,%rax,8), %xmm1 /* tmp1 = FPI[j+1]*|x| */
219 cmpl %ecx, %edx /* bitpos>=j*28+19? */
220 jl L(very_large_skip1)
221
222 /* Here if bitpos>=j*28+19 */
223 andpd %xmm3, %xmm4 /* HI(tmp3) */
224 subsd %xmm4, %xmm3 /* tmp3 = tmp3 - HI(tmp3) */
225L(very_large_skip1):
226
227 movsd L(DP_2POW52)(%rip), %xmm6
228 movapd %xmm5, %xmm2 /* tmp2 copy */
229 addsd %xmm3, %xmm5 /* tmp5 = tmp3 + tmp2 */
230 movl $1, %edx
231 addsd %xmm5, %xmm6 /* tmp6 = tmp5 + 2^52 */
232 movsd 8+L(DP_2POW52)(%rip), %xmm4
233 movd %xmm6, %eax /* k = I64_LO(tmp6); */
234 addsd %xmm6, %xmm4 /* tmp4 = tmp6 - 2^52 */
235 comisd %xmm5, %xmm4 /* tmp4 > tmp5? */
236 jbe L(very_large_skip2)
237
238 /* Here if tmp4 > tmp5 */
239 subl $1, %eax /* k-- */
240 addsd 8+L(DP_ONES)(%rip), %xmm4 /* tmp4 -= 1.0 */
241L(very_large_skip2):
242
243 andl %eax, %edx /* k&1 */
244 lea L(DP_ZERONE)(%rip), %rsi
245 subsd %xmm4, %xmm3 /* tmp3 -= tmp4 */
246 addsd (%rsi,%rdx,8), %xmm3 /* t = DP_ZERONE[k&1] + tmp3 */
247 addsd %xmm2, %xmm3 /* t += tmp2 */
248 addsd %xmm3, %xmm0 /* t += tmp0 */
249 addl $3, %eax /* n=k+3 */
250 addsd %xmm1, %xmm0 /* t += tmp1 */
251 mulsd L(DP_PIO4)(%rip), %xmm0 /* t *= PI04 */
252
253 jmp L(reconstruction) /* end of very_large_args peth */
254
255 .p2align 4
256L(arg_less_pio4):
257 /* Here if |x|<Pi/4 */
258 cmpl $0x3d000000, %eax /* |x|<2^-5? */
259 jl L(arg_less_2pn5)
260
261 /* Here if 2^-5<=|x|<Pi/4 */
262 mulsd %xmm0, %xmm0 /* y=x^2 */
263 movaps %xmm0, %xmm1 /* y */
264 mulsd %xmm0, %xmm0 /* z=x^4 */
265 movsd L(DP_C4)(%rip), %xmm3 /* C4 */
266 mulsd %xmm0, %xmm3 /* z*C4 */
267 movsd L(DP_C3)(%rip), %xmm5 /* C3 */
268 mulsd %xmm0, %xmm5 /* z*C3 */
269 addsd L(DP_C2)(%rip), %xmm3 /* C2+z*C4 */
270 mulsd %xmm0, %xmm3 /* z*(C2+z*C4) */
271 addsd L(DP_C1)(%rip), %xmm5 /* C1+z*C3 */
272 mulsd %xmm0, %xmm5 /* z*(C1+z*C3) */
273 addsd L(DP_C0)(%rip), %xmm3 /* C0+z*(C2+z*C4) */
274 mulsd %xmm1, %xmm3 /* y*(C0+z*(C2+z*C4)) */
275 /* y*(C0+y*(C1+y*(C2+y*(C3+y*C4)))) */
276 addsd %xmm5, %xmm3
277 /* 1.0 + y*(C0+y*(C1+y*(C2+y*(C3+y*C4)))) */
278 addsd L(DP_ONES)(%rip), %xmm3
279 cvtsd2ss %xmm3, %xmm0 /* SP result */
280 ret
281
282 .p2align 4
283L(arg_less_2pn5):
284 /* Here if |x|<2^-5 */
285 cmpl $0x32000000, %eax /* |x|<2^-27? */
286 jl L(arg_less_2pn27)
287
288 /* Here if 2^-27<=|x|<2^-5 */
289 mulsd %xmm0, %xmm0 /* DP x^2 */
290 movsd L(DP_COS2_1)(%rip), %xmm3 /* DP DP_COS2_1 */
291 mulsd %xmm0, %xmm3 /* DP x^2*DP_COS2_1 */
292 addsd L(DP_COS2_0)(%rip), %xmm3 /* DP DP_COS2_0+x^2*DP_COS2_1 */
293 mulsd %xmm0, %xmm3 /* DP x^2*DP_COS2_0+x^4*DP_COS2_1 */
294 /* DP 1.0+x^2*DP_COS2_0+x^4*DP_COS2_1 */
295 addsd L(DP_ONES)(%rip), %xmm3
296 cvtsd2ss %xmm3, %xmm0 /* SP result */
297 ret
298
299 .p2align 4
300L(arg_less_2pn27):
301 /* Here if |x|<2^-27 */
302 andps L(SP_ABS_MASK)(%rip),%xmm7 /* |x| */
303 movss L(SP_ONE)(%rip), %xmm0 /* 1.0 */
304 subss %xmm7, %xmm0 /* result is 1.0-|x| */
305 ret
306
307 .p2align 4
308L(arg_inf_or_nan):
309 /* Here if |x| is Inf or NAN */
310 jne L(skip_errno_setting) /* in case of x is NaN */
311
312 /* Align stack to 16 bytes. */
313 subq $8, %rsp
314 cfi_adjust_cfa_offset (8)
315 /* Here if x is Inf. Set errno to EDOM. */
316 call JUMPTARGET(__errno_location)
317 addq $8, %rsp
318 cfi_adjust_cfa_offset (-8)
319
320 movl $EDOM, (%rax)
321
322 .p2align 4
323L(skip_errno_setting):
324 /* Here if |x| is Inf or NAN. Continued. */
325 movaps %xmm7, %xmm0 /* load x */
326 subss %xmm0, %xmm0 /* Result is NaN */
327 ret
328END(__cosf)
329
330 .section .rodata, "a"
331 .p2align 3
332L(PIO4J): /* Table of j*Pi/4, for j=0,1,..,10 */
333 .long 0x00000000,0x00000000
334 .long 0x54442d18,0x3fe921fb
335 .long 0x54442d18,0x3ff921fb
336 .long 0x7f3321d2,0x4002d97c
337 .long 0x54442d18,0x400921fb
338 .long 0x2955385e,0x400f6a7a
339 .long 0x7f3321d2,0x4012d97c
340 .long 0xe9bba775,0x4015fdbb
341 .long 0x54442d18,0x401921fb
342 .long 0xbeccb2bb,0x401c463a
343 .long 0x2955385e,0x401f6a7a
344 .type L(PIO4J), @object
345 ASM_SIZE_DIRECTIVE(L(PIO4J))
346
347 .p2align 3
348L(_FPI): /* 4/Pi broken into sum of positive DP values */
349 .long 0x00000000,0x00000000
350 .long 0x6c000000,0x3ff45f30
351 .long 0x2a000000,0x3e3c9c88
352 .long 0xa8000000,0x3c54fe13
353 .long 0xd0000000,0x3aaf47d4
354 .long 0x6c000000,0x38fbb81b
355 .long 0xe0000000,0x3714acc9
356 .long 0x7c000000,0x3560e410
357 .long 0x56000000,0x33bca2c7
358 .long 0xac000000,0x31fbd778
359 .long 0xe0000000,0x300b7246
360 .long 0xe8000000,0x2e5d2126
361 .long 0x48000000,0x2c970032
362 .long 0xe8000000,0x2ad77504
363 .long 0xe0000000,0x290921cf
364 .long 0xb0000000,0x274deb1c
365 .long 0xe0000000,0x25829a73
366 .long 0xbe000000,0x23fd1046
367 .long 0x10000000,0x2224baed
368 .long 0x8e000000,0x20709d33
369 .long 0x80000000,0x1e535a2f
370 .long 0x64000000,0x1cef904e
371 .long 0x30000000,0x1b0d6398
372 .long 0x24000000,0x1964ce7d
373 .long 0x16000000,0x17b908bf
374 .type L(_FPI), @object
375 ASM_SIZE_DIRECTIVE(L(_FPI))
376
377/* Coefficients of polynomial
378 for cos(x)~=1.0+x^2*DP_COS2_0+x^4*DP_COS2_1, |x|<2^-5. */
379 .p2align 3
380L(DP_COS2_0):
381 .long 0xff5cc6fd,0xbfdfffff
382 .type L(DP_COS2_0), @object
383 ASM_SIZE_DIRECTIVE(L(DP_COS2_0))
384
385 .p2align 3
386L(DP_COS2_1):
387 .long 0xb178dac5,0x3fa55514
388 .type L(DP_COS2_1), @object
389 ASM_SIZE_DIRECTIVE(L(DP_COS2_1))
390
391 .p2align 3
392L(DP_ZERONE):
393 .long 0x00000000,0x00000000 /* 0.0 */
394 .long 0x00000000,0xbff00000 /* 1.0 */
395 .type L(DP_ZERONE), @object
396 ASM_SIZE_DIRECTIVE(L(DP_ZERONE))
397
398 .p2align 3
399L(DP_ONES):
400 .long 0x00000000,0x3ff00000 /* +1.0 */
401 .long 0x00000000,0xbff00000 /* -1.0 */
402 .type L(DP_ONES), @object
403 ASM_SIZE_DIRECTIVE(L(DP_ONES))
404
405/* Coefficients of polynomial
406 for sin(t)~=t+t^3*(S0+t^2*(S1+t^2*(S2+t^2*(S3+t^2*S4)))), |t|<Pi/4. */
407 .p2align 3
408L(DP_S3):
409 .long 0x64e6b5b4,0x3ec71d72
410 .type L(DP_S3), @object
411 ASM_SIZE_DIRECTIVE(L(DP_S3))
412
413 .p2align 3
414L(DP_S1):
415 .long 0x10c2688b,0x3f811111
416 .type L(DP_S1), @object
417 ASM_SIZE_DIRECTIVE(L(DP_S1))
418
419 .p2align 3
420L(DP_S4):
421 .long 0x1674b58a,0xbe5a947e
422 .type L(DP_S4), @object
423 ASM_SIZE_DIRECTIVE(L(DP_S4))
424
425 .p2align 3
426L(DP_S2):
427 .long 0x8b4bd1f9,0xbf2a019f
428 .type L(DP_S2),@object
429 ASM_SIZE_DIRECTIVE(L(DP_S2))
430
431 .p2align 3
432L(DP_S0):
433 .long 0x55551cd9,0xbfc55555
434 .type L(DP_S0), @object
435 ASM_SIZE_DIRECTIVE(L(DP_S0))
436
437/* Coefficients of polynomial
438 for cos(t)~=1.0+t^2*(C0+t^2*(C1+t^2*(C2+t^2*(C3+t^2*C4)))), |t|<Pi/4. */
439 .p2align 3
440L(DP_C3):
441 .long 0x9ac43cc0,0x3efa00eb
442 .type L(DP_C3), @object
443 ASM_SIZE_DIRECTIVE(L(DP_C3))
444
445 .p2align 3
446L(DP_C1):
447 .long 0x545c50c7,0x3fa55555
448 .type L(DP_C1), @object
449 ASM_SIZE_DIRECTIVE(L(DP_C1))
450
451 .p2align 3
452L(DP_C4):
453 .long 0xdd8844d7,0xbe923c97
454 .type L(DP_C4), @object
455 ASM_SIZE_DIRECTIVE(L(DP_C4))
456
457 .p2align 3
458L(DP_C2):
459 .long 0x348b6874,0xbf56c16b
460 .type L(DP_C2), @object
461 ASM_SIZE_DIRECTIVE(L(DP_C2))
462
463 .p2align 3
464L(DP_C0):
465 .long 0xfffe98ae,0xbfdfffff
466 .type L(DP_C0), @object
467 ASM_SIZE_DIRECTIVE(L(DP_C0))
468
469 .p2align 3
470L(DP_PIO4):
471 .long 0x54442d18,0x3fe921fb /* Pi/4 */
472 .type L(DP_PIO4), @object
473 ASM_SIZE_DIRECTIVE(L(DP_PIO4))
474
475 .p2align 3
476L(DP_2POW52):
477 .long 0x00000000,0x43300000 /* +2^52 */
478 .long 0x00000000,0xc3300000 /* -2^52 */
479 .type L(DP_2POW52), @object
480 ASM_SIZE_DIRECTIVE(L(DP_2POW52))
481
482 .p2align 3
483L(DP_INVPIO4):
484 .long 0x6dc9c883,0x3ff45f30 /* 4/Pi */
485 .type L(DP_INVPIO4), @object
486 ASM_SIZE_DIRECTIVE(L(DP_INVPIO4))
487
488 .p2align 3
489L(DP_PIO4HI):
490 .long 0x54000000,0xbfe921fb /* High part of Pi/4 */
491 .type L(DP_PIO4HI), @object
492 ASM_SIZE_DIRECTIVE(L(DP_PIO4HI))
493
494 .p2align 3
495L(DP_PIO4LO):
496 .long 0x11A62633,0xbe010b46 /* Low part of Pi/4 */
497 .type L(DP_PIO4LO), @object
498 ASM_SIZE_DIRECTIVE(L(DP_PIO4LO))
499
500 .p2align 2
501L(SP_INVPIO4):
502 .long 0x3fa2f983 /* 4/Pi */
503 .type L(SP_INVPIO4), @object
504 ASM_SIZE_DIRECTIVE(L(SP_INVPIO4))
505
506 .p2align 4
507L(DP_ABS_MASK): /* Mask for getting DP absolute value */
508 .long 0xffffffff,0x7fffffff
509 .long 0xffffffff,0x7fffffff
510 .type L(DP_ABS_MASK), @object
511 ASM_SIZE_DIRECTIVE(L(DP_ABS_MASK))
512
513 .p2align 3
514L(DP_HI_MASK): /* Mask for getting high 21 bits of DP value */
515 .long 0x00000000,0xffffffff
516 .type L(DP_HI_MASK), @object
517 ASM_SIZE_DIRECTIVE(L(DP_HI_MASK))
518
519 .p2align 4
520L(SP_ABS_MASK): /* Mask for getting SP absolute value */
521 .long 0x7fffffff,0x7fffffff
522 .long 0x7fffffff,0x7fffffff
523 .type L(SP_ABS_MASK), @object
524 ASM_SIZE_DIRECTIVE(L(SP_ABS_MASK))
525
526 .p2align 2
527L(SP_ONE):
528 .long 0x3f800000 /* 1.0 */
529 .type L(SP_ONE), @object
530 ASM_SIZE_DIRECTIVE(L(SP_ONE))
531
532weak_alias(__cosf, cosf)
533