xref: /titanic_51/usr/src/lib/libmvec/common/vis/__vatan2.S (revision 25c28e83beb90e7c80452a7c818c5e6f73a07dc8)
1*25c28e83SPiotr Jasiukajtis/*
2*25c28e83SPiotr Jasiukajtis * CDDL HEADER START
3*25c28e83SPiotr Jasiukajtis *
4*25c28e83SPiotr Jasiukajtis * The contents of this file are subject to the terms of the
5*25c28e83SPiotr Jasiukajtis * Common Development and Distribution License (the "License").
6*25c28e83SPiotr Jasiukajtis * You may not use this file except in compliance with the License.
7*25c28e83SPiotr Jasiukajtis *
8*25c28e83SPiotr Jasiukajtis * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*25c28e83SPiotr Jasiukajtis * or http://www.opensolaris.org/os/licensing.
10*25c28e83SPiotr Jasiukajtis * See the License for the specific language governing permissions
11*25c28e83SPiotr Jasiukajtis * and limitations under the License.
12*25c28e83SPiotr Jasiukajtis *
13*25c28e83SPiotr Jasiukajtis * When distributing Covered Code, include this CDDL HEADER in each
14*25c28e83SPiotr Jasiukajtis * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*25c28e83SPiotr Jasiukajtis * If applicable, add the following below this CDDL HEADER, with the
16*25c28e83SPiotr Jasiukajtis * fields enclosed by brackets "[]" replaced with your own identifying
17*25c28e83SPiotr Jasiukajtis * information: Portions Copyright [yyyy] [name of copyright owner]
18*25c28e83SPiotr Jasiukajtis *
19*25c28e83SPiotr Jasiukajtis * CDDL HEADER END
20*25c28e83SPiotr Jasiukajtis */
21*25c28e83SPiotr Jasiukajtis/*
22*25c28e83SPiotr Jasiukajtis * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
23*25c28e83SPiotr Jasiukajtis */
24*25c28e83SPiotr Jasiukajtis/*
25*25c28e83SPiotr Jasiukajtis * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
26*25c28e83SPiotr Jasiukajtis * Use is subject to license terms.
27*25c28e83SPiotr Jasiukajtis */
28*25c28e83SPiotr Jasiukajtis
29*25c28e83SPiotr Jasiukajtis	.file	"__vatan2.S"
30*25c28e83SPiotr Jasiukajtis
31*25c28e83SPiotr Jasiukajtis#include "libm.h"
32*25c28e83SPiotr Jasiukajtis
33*25c28e83SPiotr Jasiukajtis	RO_DATA
34*25c28e83SPiotr Jasiukajtis	.align	64
35*25c28e83SPiotr Jasiukajtisconstants:
36*25c28e83SPiotr Jasiukajtis	.word	0x3ff921fb,0x54442d18	! pio2
37*25c28e83SPiotr Jasiukajtis	.word	0x3c91a626,0x33145c07	! pio2_lo
38*25c28e83SPiotr Jasiukajtis	.word	0xbfd55555,0x555554ee	! p1
39*25c28e83SPiotr Jasiukajtis	.word	0x3fc99999,0x997a1559	! p2
40*25c28e83SPiotr Jasiukajtis	.word	0xbfc24923,0x158dfe02	! p3
41*25c28e83SPiotr Jasiukajtis	.word	0x3fbc639d,0x0ed1347b	! p4
42*25c28e83SPiotr Jasiukajtis	.word	0xffffffff,0x00000000	! mask
43*25c28e83SPiotr Jasiukajtis	.word	0x3fc00000,0x00000000	! twom3
44*25c28e83SPiotr Jasiukajtis	.word	0x46d00000,0x00000000	! two110
45*25c28e83SPiotr Jasiukajtis	.word	0x3fe921fb,0x54442d18	! pio4
46*25c28e83SPiotr Jasiukajtis
47*25c28e83SPiotr Jasiukajtis! local storage indices
48*25c28e83SPiotr Jasiukajtis
49*25c28e83SPiotr Jasiukajtis#define xscl		STACK_BIAS-0x8
50*25c28e83SPiotr Jasiukajtis#define yscl		STACK_BIAS-0x10
51*25c28e83SPiotr Jasiukajtis#define twom3		STACK_BIAS-0x18
52*25c28e83SPiotr Jasiukajtis#define two110		STACK_BIAS-0x20
53*25c28e83SPiotr Jasiukajtis#define pio4		STACK_BIAS-0x28
54*25c28e83SPiotr Jasiukajtis#define junk		STACK_BIAS-0x30
55*25c28e83SPiotr Jasiukajtis! sizeof temp storage - must be a multiple of 16 for V9
56*25c28e83SPiotr Jasiukajtis#define tmps		0x30
57*25c28e83SPiotr Jasiukajtis
58*25c28e83SPiotr Jasiukajtis! register use
59*25c28e83SPiotr Jasiukajtis
60*25c28e83SPiotr Jasiukajtis! i0  n
61*25c28e83SPiotr Jasiukajtis! i1  y
62*25c28e83SPiotr Jasiukajtis! i2  stridey
63*25c28e83SPiotr Jasiukajtis! i3  x
64*25c28e83SPiotr Jasiukajtis! i4  stridex
65*25c28e83SPiotr Jasiukajtis! i5  z
66*25c28e83SPiotr Jasiukajtis
67*25c28e83SPiotr Jasiukajtis! l0  k0
68*25c28e83SPiotr Jasiukajtis! l1  k1
69*25c28e83SPiotr Jasiukajtis! l2  k2
70*25c28e83SPiotr Jasiukajtis! l3  hx
71*25c28e83SPiotr Jasiukajtis! l4  pz0
72*25c28e83SPiotr Jasiukajtis! l5  pz1
73*25c28e83SPiotr Jasiukajtis! l6  pz2
74*25c28e83SPiotr Jasiukajtis! l7  stridez
75*25c28e83SPiotr Jasiukajtis
76*25c28e83SPiotr Jasiukajtis! the following are 64-bit registers in both V8+ and V9
77*25c28e83SPiotr Jasiukajtis
78*25c28e83SPiotr Jasiukajtis! g1  __vlibm_TBL_atan2
79*25c28e83SPiotr Jasiukajtis! g5
80*25c28e83SPiotr Jasiukajtis
81*25c28e83SPiotr Jasiukajtis! o0  hy
82*25c28e83SPiotr Jasiukajtis! o1  0x00004000
83*25c28e83SPiotr Jasiukajtis! o2  0x1420
84*25c28e83SPiotr Jasiukajtis! o3  0x7fe00000
85*25c28e83SPiotr Jasiukajtis! o4  0x03600000
86*25c28e83SPiotr Jasiukajtis! o5  0x00100000
87*25c28e83SPiotr Jasiukajtis! o7
88*25c28e83SPiotr Jasiukajtis
89*25c28e83SPiotr Jasiukajtis! f0  y0
90*25c28e83SPiotr Jasiukajtis! f2  x0
91*25c28e83SPiotr Jasiukajtis! f4  t0
92*25c28e83SPiotr Jasiukajtis! f6  ah0
93*25c28e83SPiotr Jasiukajtis! f8  al0
94*25c28e83SPiotr Jasiukajtis! f10 y1
95*25c28e83SPiotr Jasiukajtis! f12 x1
96*25c28e83SPiotr Jasiukajtis! f14 t1
97*25c28e83SPiotr Jasiukajtis! f16 ah1
98*25c28e83SPiotr Jasiukajtis! f18 al1
99*25c28e83SPiotr Jasiukajtis! f20 y2
100*25c28e83SPiotr Jasiukajtis! f22 x2
101*25c28e83SPiotr Jasiukajtis! f24 t2
102*25c28e83SPiotr Jasiukajtis! f26 ah2
103*25c28e83SPiotr Jasiukajtis! f28 al2
104*25c28e83SPiotr Jasiukajtis! f30
105*25c28e83SPiotr Jasiukajtis! f32
106*25c28e83SPiotr Jasiukajtis! f34
107*25c28e83SPiotr Jasiukajtis! f36 sx0
108*25c28e83SPiotr Jasiukajtis! f38 sx1
109*25c28e83SPiotr Jasiukajtis! f40 sx2
110*25c28e83SPiotr Jasiukajtis! f42 sy0
111*25c28e83SPiotr Jasiukajtis! f44 sy1
112*25c28e83SPiotr Jasiukajtis! f46 sy2
113*25c28e83SPiotr Jasiukajtis
114*25c28e83SPiotr Jasiukajtis#define mask	%f48
115*25c28e83SPiotr Jasiukajtis#define signbit	%f50
116*25c28e83SPiotr Jasiukajtis#define pio2	%f52
117*25c28e83SPiotr Jasiukajtis#define pio2_lo	%f54
118*25c28e83SPiotr Jasiukajtis#define p1	%f56
119*25c28e83SPiotr Jasiukajtis#define p2	%f58
120*25c28e83SPiotr Jasiukajtis#define p3	%f60
121*25c28e83SPiotr Jasiukajtis#define p4	%f62
122*25c28e83SPiotr Jasiukajtis
123*25c28e83SPiotr Jasiukajtis	ENTRY(__vatan2)
124*25c28e83SPiotr Jasiukajtis	save	%sp,-SA(MINFRAME)-tmps,%sp
125*25c28e83SPiotr Jasiukajtis	PIC_SETUP(l7)
126*25c28e83SPiotr Jasiukajtis	PIC_SET(l7,constants,o0)
127*25c28e83SPiotr Jasiukajtis	PIC_SET(l7,__vlibm_TBL_atan2,o1)
128*25c28e83SPiotr Jasiukajtis	wr	%g0,0x82,%asi		! set %asi for non-faulting loads
129*25c28e83SPiotr Jasiukajtis	mov	%o1, %g1
130*25c28e83SPiotr Jasiukajtis#ifdef __sparcv9
131*25c28e83SPiotr Jasiukajtis	ldx	[%fp+STACK_BIAS+0xb0],%l7
132*25c28e83SPiotr Jasiukajtis#else
133*25c28e83SPiotr Jasiukajtis	ld	[%fp+0x5c],%l7
134*25c28e83SPiotr Jasiukajtis#endif
135*25c28e83SPiotr Jasiukajtis	ldd	[%o0+0x00],pio2		! load/set up constants
136*25c28e83SPiotr Jasiukajtis	ldd	[%o0+0x08],pio2_lo
137*25c28e83SPiotr Jasiukajtis	ldd	[%o0+0x10],p1
138*25c28e83SPiotr Jasiukajtis	ldd	[%o0+0x18],p2
139*25c28e83SPiotr Jasiukajtis	ldd	[%o0+0x20],p3
140*25c28e83SPiotr Jasiukajtis	ldd	[%o0+0x28],p4
141*25c28e83SPiotr Jasiukajtis	ldd	[%o0+0x30],mask
142*25c28e83SPiotr Jasiukajtis	fzero	signbit
143*25c28e83SPiotr Jasiukajtis	fnegd	signbit,signbit
144*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x00004000),%o1
145*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x1420),%o2
146*25c28e83SPiotr Jasiukajtis	or	%o2,%lo(0x1420),%o2
147*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x7fe00000),%o3
148*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x03600000),%o4
149*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x00100000),%o5
150*25c28e83SPiotr Jasiukajtis	ldd	[%o0+0x38],%f0		! copy rarely used constants to stack
151*25c28e83SPiotr Jasiukajtis	ldd	[%o0+0x40],%f2
152*25c28e83SPiotr Jasiukajtis	ldd	[%o0+0x48],%f4
153*25c28e83SPiotr Jasiukajtis	std	%f0,[%fp+twom3]
154*25c28e83SPiotr Jasiukajtis	std	%f2,[%fp+two110]
155*25c28e83SPiotr Jasiukajtis	std	%f4,[%fp+pio4]
156*25c28e83SPiotr Jasiukajtis	sll	%i2,3,%i2		! scale strides
157*25c28e83SPiotr Jasiukajtis	sll	%i4,3,%i4
158*25c28e83SPiotr Jasiukajtis	sll	%l7,3,%l7
159*25c28e83SPiotr Jasiukajtis	fzero	%f20			! loop prologue
160*25c28e83SPiotr Jasiukajtis	fzero	%f22
161*25c28e83SPiotr Jasiukajtis	fzero	%f24
162*25c28e83SPiotr Jasiukajtis	fzero	%f26
163*25c28e83SPiotr Jasiukajtis	fzero	%f46
164*25c28e83SPiotr Jasiukajtis	add	%fp,junk,%l6
165*25c28e83SPiotr Jasiukajtis	ld	[%i1],%f0		! *y
166*25c28e83SPiotr Jasiukajtis	ld	[%i1+4],%f1
167*25c28e83SPiotr Jasiukajtis	ld	[%i3],%f8		! *x
168*25c28e83SPiotr Jasiukajtis	ld	[%i3+4],%f9
169*25c28e83SPiotr Jasiukajtis	ld	[%i1],%o0		! hy
170*25c28e83SPiotr Jasiukajtis	ba	.loop
171*25c28e83SPiotr Jasiukajtis	ld	[%i3],%l3		! hx
172*25c28e83SPiotr Jasiukajtis
173*25c28e83SPiotr Jasiukajtis! 16-byte aligned
174*25c28e83SPiotr Jasiukajtis	.align	16
175*25c28e83SPiotr Jasiukajtis.loop:
176*25c28e83SPiotr Jasiukajtis	fabsd	%f0,%f4
177*25c28e83SPiotr Jasiukajtis	mov	%i5,%l4
178*25c28e83SPiotr Jasiukajtis	add	%i1,%i2,%i1		! y += stridey
179*25c28e83SPiotr Jasiukajtis
180*25c28e83SPiotr Jasiukajtis	fabsd	%f8,%f2
181*25c28e83SPiotr Jasiukajtis	add	%i3,%i4,%i3		! x += stridex
182*25c28e83SPiotr Jasiukajtis	add	%i5,%l7,%i5		! z += stridez
183*25c28e83SPiotr Jasiukajtis
184*25c28e83SPiotr Jasiukajtis	fand	%f0,signbit,%f42
185*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x80000000),%g5
186*25c28e83SPiotr Jasiukajtis
187*25c28e83SPiotr Jasiukajtis	fand	%f8,signbit,%f36
188*25c28e83SPiotr Jasiukajtis	andn	%o0,%g5,%o0
189*25c28e83SPiotr Jasiukajtis	andn	%l3,%g5,%l3
190*25c28e83SPiotr Jasiukajtis
191*25c28e83SPiotr Jasiukajtis	fcmpd	%fcc0,%f4,%f2
192*25c28e83SPiotr Jasiukajtis
193*25c28e83SPiotr Jasiukajtis	fmovd	%f4,%f0
194*25c28e83SPiotr Jasiukajtis
195*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc0,%f2,%f0		! swap if |y| > |x|
196*25c28e83SPiotr Jasiukajtis
197*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc0,%f4,%f2
198*25c28e83SPiotr Jasiukajtis	mov	%o0,%o7
199*25c28e83SPiotr Jasiukajtis	 lda	[%i1]%asi,%f10		! preload next argument
200*25c28e83SPiotr Jasiukajtis
201*25c28e83SPiotr Jasiukajtis	  faddd	%f26,%f20,%f26
202*25c28e83SPiotr Jasiukajtis	 lda	[%i1+4]%asi,%f11
203*25c28e83SPiotr Jasiukajtis
204*25c28e83SPiotr Jasiukajtis	  faddd	%f22,%f24,%f22
205*25c28e83SPiotr Jasiukajtis	movg	%fcc0,%l3,%o0
206*25c28e83SPiotr Jasiukajtis
207*25c28e83SPiotr Jasiukajtis	movg	%fcc0,%o7,%l3
208*25c28e83SPiotr Jasiukajtis
209*25c28e83SPiotr Jasiukajtis	fbu,pn	%fcc0,.nan0		! if x or y is nan
210*25c28e83SPiotr Jasiukajtis! delay slot
211*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%f18
212*25c28e83SPiotr Jasiukajtis
213*25c28e83SPiotr Jasiukajtis	sub	%l3,%o0,%l0		! hx - hy
214*25c28e83SPiotr Jasiukajtis	sub	%l3,%o3,%g5
215*25c28e83SPiotr Jasiukajtis	 fabsd	%f10,%f14
216*25c28e83SPiotr Jasiukajtis	 lda	[%i3+4]%asi,%f19
217*25c28e83SPiotr Jasiukajtis
218*25c28e83SPiotr Jasiukajtis	sub	%l0,%o4,%o7
219*25c28e83SPiotr Jasiukajtis	  faddd	%f22,%f26,%f26
220*25c28e83SPiotr Jasiukajtis
221*25c28e83SPiotr Jasiukajtis	andcc	%g5,%o7,%g0
222*25c28e83SPiotr Jasiukajtis	bge,pn	%icc,.big0		! if |x| or |x/y| is big
223*25c28e83SPiotr Jasiukajtis! delay slot
224*25c28e83SPiotr Jasiukajtis	nop
225*25c28e83SPiotr Jasiukajtis
226*25c28e83SPiotr Jasiukajtis	 fabsd	%f18,%f12
227*25c28e83SPiotr Jasiukajtis	cmp	%o0,%o5
228*25c28e83SPiotr Jasiukajtis	bl,pn	%icc,.small0		! if |y| is small
229*25c28e83SPiotr Jasiukajtis! delay slot
230*25c28e83SPiotr Jasiukajtis	 lda	[%i1]%asi,%o0
231*25c28e83SPiotr Jasiukajtis
232*25c28e83SPiotr Jasiukajtis	add	%l0,%o1,%l0		! k
233*25c28e83SPiotr Jasiukajtis	addcc	%i0,-1,%i0
234*25c28e83SPiotr Jasiukajtis	ble,pn	%icc,.last1
235*25c28e83SPiotr Jasiukajtis! delay slot
236*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%l3
237*25c28e83SPiotr Jasiukajtis
238*25c28e83SPiotr Jasiukajtis.cont1:
239*25c28e83SPiotr Jasiukajtis	srl	%l0,10,%l0
240*25c28e83SPiotr Jasiukajtis	 mov	%i5,%l5
241*25c28e83SPiotr Jasiukajtis	  fxor	%f26,%f46,%f26
242*25c28e83SPiotr Jasiukajtis	  st	%f26,[%l6]
243*25c28e83SPiotr Jasiukajtis
244*25c28e83SPiotr Jasiukajtis	 fand	%f10,signbit,%f44
245*25c28e83SPiotr Jasiukajtis	andn	%l0,0x1f,%l0
246*25c28e83SPiotr Jasiukajtis	 add	%i1,%i2,%i1
247*25c28e83SPiotr Jasiukajtis	  st	%f27,[%l6+4]
248*25c28e83SPiotr Jasiukajtis
249*25c28e83SPiotr Jasiukajtis	 fand	%f18,signbit,%f38
250*25c28e83SPiotr Jasiukajtis	cmp	%l0,%o2
251*25c28e83SPiotr Jasiukajtis	movg	%icc,%o2,%l0
252*25c28e83SPiotr Jasiukajtis
253*25c28e83SPiotr Jasiukajtis	 fcmpd	%fcc1,%f14,%f12
254*25c28e83SPiotr Jasiukajtis	 add	%i3,%i4,%i3
255*25c28e83SPiotr Jasiukajtis	 add	%i5,%l7,%i5
256*25c28e83SPiotr Jasiukajtis
257*25c28e83SPiotr Jasiukajtis	 fmovd	%f14,%f10
258*25c28e83SPiotr Jasiukajtis	add	%l0,%g1,%l0
259*25c28e83SPiotr Jasiukajtis	 sethi	%hi(0x80000000),%g5
260*25c28e83SPiotr Jasiukajtis
261*25c28e83SPiotr Jasiukajtis	ldd	[%l0+0x10],%f4
262*25c28e83SPiotr Jasiukajtis	fand	%f2,mask,%f6
263*25c28e83SPiotr Jasiukajtis	 andn	%o0,%g5,%o0
264*25c28e83SPiotr Jasiukajtis	 andn	%l3,%g5,%l3
265*25c28e83SPiotr Jasiukajtis
266*25c28e83SPiotr Jasiukajtis	 fmovdg	%fcc1,%f12,%f10
267*25c28e83SPiotr Jasiukajtis
268*25c28e83SPiotr Jasiukajtis	 fmovdg	%fcc1,%f14,%f12
269*25c28e83SPiotr Jasiukajtis	 mov	%o0,%o7
270*25c28e83SPiotr Jasiukajtis	  lda	[%i1]%asi,%f20
271*25c28e83SPiotr Jasiukajtis
272*25c28e83SPiotr Jasiukajtis	fsubd	%f2,%f6,%f30
273*25c28e83SPiotr Jasiukajtis	fmuld	%f6,%f4,%f6
274*25c28e83SPiotr Jasiukajtis	 movg	%fcc1,%l3,%o0
275*25c28e83SPiotr Jasiukajtis
276*25c28e83SPiotr Jasiukajtis	fmuld	%f0,%f4,%f8
277*25c28e83SPiotr Jasiukajtis	 movg	%fcc1,%o7,%l3
278*25c28e83SPiotr Jasiukajtis
279*25c28e83SPiotr Jasiukajtis	  lda	[%i1+4]%asi,%f21
280*25c28e83SPiotr Jasiukajtis	 fbu,pn	%fcc1,.nan1
281*25c28e83SPiotr Jasiukajtis! delay slot
282*25c28e83SPiotr Jasiukajtis	 nop
283*25c28e83SPiotr Jasiukajtis
284*25c28e83SPiotr Jasiukajtis	  lda	[%i3]%asi,%f28
285*25c28e83SPiotr Jasiukajtis	 sub	%l3,%o0,%l1
286*25c28e83SPiotr Jasiukajtis	 sub	%l3,%o3,%g5
287*25c28e83SPiotr Jasiukajtis
288*25c28e83SPiotr Jasiukajtis	  lda	[%i3+4]%asi,%f29
289*25c28e83SPiotr Jasiukajtis	fmuld	%f30,%f4,%f30
290*25c28e83SPiotr Jasiukajtis	fsubd	%f0,%f6,%f4
291*25c28e83SPiotr Jasiukajtis	 sub	%l1,%o4,%o7
292*25c28e83SPiotr Jasiukajtis
293*25c28e83SPiotr Jasiukajtis	  fabsd	%f20,%f24
294*25c28e83SPiotr Jasiukajtis	 andcc	%g5,%o7,%g0
295*25c28e83SPiotr Jasiukajtis	 bge,pn	%icc,.big1
296*25c28e83SPiotr Jasiukajtis! delay slot
297*25c28e83SPiotr Jasiukajtis	 nop
298*25c28e83SPiotr Jasiukajtis
299*25c28e83SPiotr Jasiukajtis	faddd	%f2,%f8,%f8
300*25c28e83SPiotr Jasiukajtis	 cmp	%o0,%o5
301*25c28e83SPiotr Jasiukajtis	 bl,pn	%icc,.small1
302*25c28e83SPiotr Jasiukajtis! delay slot
303*25c28e83SPiotr Jasiukajtis	  lda	[%i1]%asi,%o0
304*25c28e83SPiotr Jasiukajtis
305*25c28e83SPiotr Jasiukajtis	  fabsd	%f28,%f22
306*25c28e83SPiotr Jasiukajtis	 add	%l1,%o1,%l1
307*25c28e83SPiotr Jasiukajtis	 addcc	%i0,-1,%i0
308*25c28e83SPiotr Jasiukajtis	  lda	[%i3]%asi,%l3
309*25c28e83SPiotr Jasiukajtis
310*25c28e83SPiotr Jasiukajtis	fsubd	%f4,%f30,%f4
311*25c28e83SPiotr Jasiukajtis	 srl	%l1,10,%l1
312*25c28e83SPiotr Jasiukajtis	 ble,pn	%icc,.last2
313*25c28e83SPiotr Jasiukajtis! delay slot
314*25c28e83SPiotr Jasiukajtis	  mov	%i5,%l6
315*25c28e83SPiotr Jasiukajtis
316*25c28e83SPiotr Jasiukajtis.cont2:
317*25c28e83SPiotr Jasiukajtis	  fand	%f20,signbit,%f46
318*25c28e83SPiotr Jasiukajtis	 andn	%l1,0x1f,%l1
319*25c28e83SPiotr Jasiukajtis	  add	%i1,%i2,%i1
320*25c28e83SPiotr Jasiukajtis
321*25c28e83SPiotr Jasiukajtis	  fand	%f28,signbit,%f40
322*25c28e83SPiotr Jasiukajtis	 cmp	%l1,%o2
323*25c28e83SPiotr Jasiukajtis	 movg	%icc,%o2,%l1
324*25c28e83SPiotr Jasiukajtis
325*25c28e83SPiotr Jasiukajtis	  fcmpd	%fcc2,%f24,%f22
326*25c28e83SPiotr Jasiukajtis	  add	%i3,%i4,%i3
327*25c28e83SPiotr Jasiukajtis	  add	%i5,%l7,%i5
328*25c28e83SPiotr Jasiukajtis
329*25c28e83SPiotr Jasiukajtis	fdivd	%f4,%f8,%f4
330*25c28e83SPiotr Jasiukajtis	  fmovd	%f24,%f20
331*25c28e83SPiotr Jasiukajtis	 add	%l1,%g1,%l1
332*25c28e83SPiotr Jasiukajtis	  sethi	%hi(0x80000000),%g5
333*25c28e83SPiotr Jasiukajtis
334*25c28e83SPiotr Jasiukajtis	 ldd	[%l1+0x10],%f14
335*25c28e83SPiotr Jasiukajtis	 fand	%f12,mask,%f16
336*25c28e83SPiotr Jasiukajtis	  andn	%o0,%g5,%o0
337*25c28e83SPiotr Jasiukajtis	  andn	%l3,%g5,%l3
338*25c28e83SPiotr Jasiukajtis
339*25c28e83SPiotr Jasiukajtis	  fmovdg %fcc2,%f22,%f20
340*25c28e83SPiotr Jasiukajtis
341*25c28e83SPiotr Jasiukajtis	  fmovdg %fcc2,%f24,%f22
342*25c28e83SPiotr Jasiukajtis	  mov	%o0,%o7
343*25c28e83SPiotr Jasiukajtis
344*25c28e83SPiotr Jasiukajtis	 fsubd	%f12,%f16,%f32
345*25c28e83SPiotr Jasiukajtis	 fmuld	%f16,%f14,%f16
346*25c28e83SPiotr Jasiukajtis	  movg	%fcc2,%l3,%o0
347*25c28e83SPiotr Jasiukajtis
348*25c28e83SPiotr Jasiukajtis	fnegd	pio2_lo,%f8		! al
349*25c28e83SPiotr Jasiukajtis	 fmuld	%f10,%f14,%f18
350*25c28e83SPiotr Jasiukajtis	  movg	%fcc2,%o7,%l3
351*25c28e83SPiotr Jasiukajtis
352*25c28e83SPiotr Jasiukajtis	fzero	%f0
353*25c28e83SPiotr Jasiukajtis	  fbu,pn %fcc2,.nan2
354*25c28e83SPiotr Jasiukajtis! delay slot
355*25c28e83SPiotr Jasiukajtis	  nop
356*25c28e83SPiotr Jasiukajtis
357*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc0,signbit,%f0
358*25c28e83SPiotr Jasiukajtis	  sub	%l3,%o0,%l2
359*25c28e83SPiotr Jasiukajtis	  sub	%l3,%o3,%g5
360*25c28e83SPiotr Jasiukajtis
361*25c28e83SPiotr Jasiukajtis	 fmuld	%f32,%f14,%f32
362*25c28e83SPiotr Jasiukajtis	 fsubd	%f10,%f16,%f14
363*25c28e83SPiotr Jasiukajtis	  sub	%l2,%o4,%o7
364*25c28e83SPiotr Jasiukajtis
365*25c28e83SPiotr Jasiukajtis	 faddd	%f12,%f18,%f18
366*25c28e83SPiotr Jasiukajtis	  andcc	%g5,%o7,%g0
367*25c28e83SPiotr Jasiukajtis	  bge,pn %icc,.big2
368*25c28e83SPiotr Jasiukajtis! delay slot
369*25c28e83SPiotr Jasiukajtis	  nop
370*25c28e83SPiotr Jasiukajtis
371*25c28e83SPiotr Jasiukajtis	fxor	%f36,%f0,%f36
372*25c28e83SPiotr Jasiukajtis	  cmp	%o0,%o5
373*25c28e83SPiotr Jasiukajtis	  bl,pn	%icc,.small2
374*25c28e83SPiotr Jasiukajtis! delay slot
375*25c28e83SPiotr Jasiukajtis	  nop
376*25c28e83SPiotr Jasiukajtis
377*25c28e83SPiotr Jasiukajtis.cont3:
378*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc0,signbit,%f8
379*25c28e83SPiotr Jasiukajtis	  add	%l2,%o1,%l2
380*25c28e83SPiotr Jasiukajtis
381*25c28e83SPiotr Jasiukajtis	 fsubd	%f14,%f32,%f14
382*25c28e83SPiotr Jasiukajtis	  srl	%l2,10,%l2
383*25c28e83SPiotr Jasiukajtis
384*25c28e83SPiotr Jasiukajtis	fxor	%f36,pio2_lo,%f30	! al
385*25c28e83SPiotr Jasiukajtis	  andn	%l2,0x1f,%l2
386*25c28e83SPiotr Jasiukajtis
387*25c28e83SPiotr Jasiukajtis	fxor	%f36,pio2,%f0		! ah
388*25c28e83SPiotr Jasiukajtis	  cmp	%l2,%o2
389*25c28e83SPiotr Jasiukajtis	  movg	%icc,%o2,%l2
390*25c28e83SPiotr Jasiukajtis
391*25c28e83SPiotr Jasiukajtis	fxor	%f42,%f36,%f42		! sy
392*25c28e83SPiotr Jasiukajtis
393*25c28e83SPiotr Jasiukajtis	faddd	%f8,%f30,%f8
394*25c28e83SPiotr Jasiukajtis	ldd	[%l0+0x8],%f30
395*25c28e83SPiotr Jasiukajtis	  add	%l2,%g1,%l2
396*25c28e83SPiotr Jasiukajtis
397*25c28e83SPiotr Jasiukajtis	 fdivd	%f14,%f18,%f14
398*25c28e83SPiotr Jasiukajtis	 fzero	%f10
399*25c28e83SPiotr Jasiukajtis
400*25c28e83SPiotr Jasiukajtis	  ldd	[%l2+0x10],%f24
401*25c28e83SPiotr Jasiukajtis	  fand	%f22,mask,%f26
402*25c28e83SPiotr Jasiukajtis
403*25c28e83SPiotr Jasiukajtis	 fmovdg	%fcc1,signbit,%f10
404*25c28e83SPiotr Jasiukajtis
405*25c28e83SPiotr Jasiukajtis	fmuld	%f4,%f4,%f36
406*25c28e83SPiotr Jasiukajtis	faddd	%f8,%f30,%f8
407*25c28e83SPiotr Jasiukajtis
408*25c28e83SPiotr Jasiukajtis	  fsubd	%f22,%f26,%f34
409*25c28e83SPiotr Jasiukajtis	  fmuld	%f26,%f24,%f26
410*25c28e83SPiotr Jasiukajtis
411*25c28e83SPiotr Jasiukajtis	  fmuld	%f20,%f24,%f28
412*25c28e83SPiotr Jasiukajtis	 fxor	%f38,%f10,%f38
413*25c28e83SPiotr Jasiukajtis
414*25c28e83SPiotr Jasiukajtis	fmuld	%f4,p3,%f6
415*25c28e83SPiotr Jasiukajtis	 fnegd	pio2_lo,%f18
416*25c28e83SPiotr Jasiukajtis
417*25c28e83SPiotr Jasiukajtis	fmuld	%f36,p2,%f2
418*25c28e83SPiotr Jasiukajtis	 fmovdg	%fcc1,signbit,%f18
419*25c28e83SPiotr Jasiukajtis
420*25c28e83SPiotr Jasiukajtis	fmuld	%f36,%f4,%f36
421*25c28e83SPiotr Jasiukajtis	 fxor	%f38,pio2,%f10
422*25c28e83SPiotr Jasiukajtis
423*25c28e83SPiotr Jasiukajtis	  fmuld	%f34,%f24,%f34
424*25c28e83SPiotr Jasiukajtis	  fsubd	%f20,%f26,%f24
425*25c28e83SPiotr Jasiukajtis
426*25c28e83SPiotr Jasiukajtis	  faddd	%f22,%f28,%f28
427*25c28e83SPiotr Jasiukajtis
428*25c28e83SPiotr Jasiukajtis	faddd	%f2,p1,%f2
429*25c28e83SPiotr Jasiukajtis
430*25c28e83SPiotr Jasiukajtis	fmuld	%f36,p4,%f30
431*25c28e83SPiotr Jasiukajtis	 fxor	%f38,pio2_lo,%f32
432*25c28e83SPiotr Jasiukajtis
433*25c28e83SPiotr Jasiukajtis	  fsubd	%f24,%f34,%f24
434*25c28e83SPiotr Jasiukajtis
435*25c28e83SPiotr Jasiukajtis	 fxor	%f44,%f38,%f44
436*25c28e83SPiotr Jasiukajtis
437*25c28e83SPiotr Jasiukajtis	fmuld	%f36,%f2,%f2
438*25c28e83SPiotr Jasiukajtis	 faddd	%f18,%f32,%f18
439*25c28e83SPiotr Jasiukajtis	 ldd	[%l1+0x8],%f32
440*25c28e83SPiotr Jasiukajtis
441*25c28e83SPiotr Jasiukajtis	fmuld	%f36,%f36,%f36
442*25c28e83SPiotr Jasiukajtis	faddd	%f6,%f30,%f30
443*25c28e83SPiotr Jasiukajtis
444*25c28e83SPiotr Jasiukajtis	  fdivd	%f24,%f28,%f24
445*25c28e83SPiotr Jasiukajtis	  fzero	%f20
446*25c28e83SPiotr Jasiukajtis
447*25c28e83SPiotr Jasiukajtis	  fmovdg %fcc2,signbit,%f20
448*25c28e83SPiotr Jasiukajtis
449*25c28e83SPiotr Jasiukajtis	faddd	%f2,%f8,%f2
450*25c28e83SPiotr Jasiukajtis
451*25c28e83SPiotr Jasiukajtis	 fmuld	%f14,%f14,%f38
452*25c28e83SPiotr Jasiukajtis	 faddd	%f18,%f32,%f18
453*25c28e83SPiotr Jasiukajtis
454*25c28e83SPiotr Jasiukajtis	fmuld	%f36,%f30,%f36
455*25c28e83SPiotr Jasiukajtis	  fxor	%f40,%f20,%f40
456*25c28e83SPiotr Jasiukajtis
457*25c28e83SPiotr Jasiukajtis	fnegd	pio2,%f6		! ah
458*25c28e83SPiotr Jasiukajtis	 fmuld	%f14,p3,%f16
459*25c28e83SPiotr Jasiukajtis
460*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc0,signbit,%f6
461*25c28e83SPiotr Jasiukajtis
462*25c28e83SPiotr Jasiukajtis	 fmuld	%f38,p2,%f12
463*25c28e83SPiotr Jasiukajtis	  fnegd	pio2_lo,%f28
464*25c28e83SPiotr Jasiukajtis
465*25c28e83SPiotr Jasiukajtis	faddd	%f2,%f36,%f2
466*25c28e83SPiotr Jasiukajtis	 fmuld	%f38,%f14,%f38
467*25c28e83SPiotr Jasiukajtis
468*25c28e83SPiotr Jasiukajtis	faddd	%f6,%f0,%f6
469*25c28e83SPiotr Jasiukajtis	ldd	[%l0],%f0
470*25c28e83SPiotr Jasiukajtis
471*25c28e83SPiotr Jasiukajtis	  fmovdg %fcc2,signbit,%f28
472*25c28e83SPiotr Jasiukajtis
473*25c28e83SPiotr Jasiukajtis	 faddd	%f12,p1,%f12
474*25c28e83SPiotr Jasiukajtis
475*25c28e83SPiotr Jasiukajtis	 fmuld	%f38,p4,%f32
476*25c28e83SPiotr Jasiukajtis	  fxor	%f40,pio2_lo,%f34
477*25c28e83SPiotr Jasiukajtis
478*25c28e83SPiotr Jasiukajtis	  fxor	%f40,pio2,%f20
479*25c28e83SPiotr Jasiukajtis
480*25c28e83SPiotr Jasiukajtis	faddd	%f2,%f4,%f2
481*25c28e83SPiotr Jasiukajtis
482*25c28e83SPiotr Jasiukajtis	 fmuld	%f38,%f12,%f12
483*25c28e83SPiotr Jasiukajtis	  fxor	%f46,%f40,%f46
484*25c28e83SPiotr Jasiukajtis
485*25c28e83SPiotr Jasiukajtis	 fmuld	%f38,%f38,%f38
486*25c28e83SPiotr Jasiukajtis	 faddd	%f16,%f32,%f32
487*25c28e83SPiotr Jasiukajtis
488*25c28e83SPiotr Jasiukajtis	  faddd	%f28,%f34,%f28
489*25c28e83SPiotr Jasiukajtis	  ldd	[%l2+0x8],%f34
490*25c28e83SPiotr Jasiukajtis
491*25c28e83SPiotr Jasiukajtis	faddd	%f6,%f0,%f6
492*25c28e83SPiotr Jasiukajtis	lda	[%i1]%asi,%f0		! preload next argument
493*25c28e83SPiotr Jasiukajtis
494*25c28e83SPiotr Jasiukajtis	 faddd	%f12,%f18,%f12
495*25c28e83SPiotr Jasiukajtis	lda	[%i1+4]%asi,%f1
496*25c28e83SPiotr Jasiukajtis
497*25c28e83SPiotr Jasiukajtis	  fmuld	%f24,%f24,%f40
498*25c28e83SPiotr Jasiukajtis	lda	[%i3]%asi,%f8
499*25c28e83SPiotr Jasiukajtis
500*25c28e83SPiotr Jasiukajtis	 fmuld	%f38,%f32,%f38
501*25c28e83SPiotr Jasiukajtis	  faddd	%f28,%f34,%f28
502*25c28e83SPiotr Jasiukajtis	lda	[%i3+4]%asi,%f9
503*25c28e83SPiotr Jasiukajtis
504*25c28e83SPiotr Jasiukajtis	 fnegd	pio2,%f16
505*25c28e83SPiotr Jasiukajtis	  fmuld	%f24,p3,%f26
506*25c28e83SPiotr Jasiukajtis	lda	[%i1]%asi,%o0
507*25c28e83SPiotr Jasiukajtis
508*25c28e83SPiotr Jasiukajtis	 fmovdg	%fcc1,signbit,%f16
509*25c28e83SPiotr Jasiukajtis	lda	[%i3]%asi,%l3
510*25c28e83SPiotr Jasiukajtis
511*25c28e83SPiotr Jasiukajtis	  fmuld	%f40,p2,%f22
512*25c28e83SPiotr Jasiukajtis
513*25c28e83SPiotr Jasiukajtis	 faddd	%f12,%f38,%f12
514*25c28e83SPiotr Jasiukajtis	  fmuld	%f40,%f24,%f40
515*25c28e83SPiotr Jasiukajtis
516*25c28e83SPiotr Jasiukajtis	faddd	%f2,%f6,%f6
517*25c28e83SPiotr Jasiukajtis
518*25c28e83SPiotr Jasiukajtis	 faddd	%f16,%f10,%f16
519*25c28e83SPiotr Jasiukajtis	 ldd	[%l1],%f10
520*25c28e83SPiotr Jasiukajtis
521*25c28e83SPiotr Jasiukajtis	  faddd	%f22,p1,%f22
522*25c28e83SPiotr Jasiukajtis
523*25c28e83SPiotr Jasiukajtis	 faddd	%f12,%f14,%f12
524*25c28e83SPiotr Jasiukajtis	  fmuld	%f40,p4,%f34
525*25c28e83SPiotr Jasiukajtis
526*25c28e83SPiotr Jasiukajtis	fxor	%f6,%f42,%f6
527*25c28e83SPiotr Jasiukajtis	st	%f6,[%l4]
528*25c28e83SPiotr Jasiukajtis
529*25c28e83SPiotr Jasiukajtis	 faddd	%f16,%f10,%f16
530*25c28e83SPiotr Jasiukajtis	st	%f7,[%l4+4]
531*25c28e83SPiotr Jasiukajtis
532*25c28e83SPiotr Jasiukajtis	  fmuld	%f40,%f22,%f22
533*25c28e83SPiotr Jasiukajtis
534*25c28e83SPiotr Jasiukajtis	  fmuld	%f40,%f40,%f40
535*25c28e83SPiotr Jasiukajtis	  faddd	%f26,%f34,%f34
536*25c28e83SPiotr Jasiukajtis
537*25c28e83SPiotr Jasiukajtis	  fnegd	pio2,%f26
538*25c28e83SPiotr Jasiukajtis
539*25c28e83SPiotr Jasiukajtis	 faddd	%f12,%f16,%f16
540*25c28e83SPiotr Jasiukajtis
541*25c28e83SPiotr Jasiukajtis	  faddd	%f22,%f28,%f22
542*25c28e83SPiotr Jasiukajtis
543*25c28e83SPiotr Jasiukajtis	  fmuld	%f40,%f34,%f40
544*25c28e83SPiotr Jasiukajtis	  fmovdg %fcc2,signbit,%f26
545*25c28e83SPiotr Jasiukajtis
546*25c28e83SPiotr Jasiukajtis! -
547*25c28e83SPiotr Jasiukajtis
548*25c28e83SPiotr Jasiukajtis	 fxor	%f16,%f44,%f16
549*25c28e83SPiotr Jasiukajtis	 st	%f16,[%l5]
550*25c28e83SPiotr Jasiukajtis
551*25c28e83SPiotr Jasiukajtis	  faddd	%f26,%f20,%f26
552*25c28e83SPiotr Jasiukajtis	 st	%f17,[%l5+4]
553*25c28e83SPiotr Jasiukajtis	addcc	%i0,-1,%i0
554*25c28e83SPiotr Jasiukajtis
555*25c28e83SPiotr Jasiukajtis	  faddd	%f22,%f40,%f22
556*25c28e83SPiotr Jasiukajtis	bg,pt	%icc,.loop
557*25c28e83SPiotr Jasiukajtis! delay slot
558*25c28e83SPiotr Jasiukajtis	  ldd	[%l2],%f20
559*25c28e83SPiotr Jasiukajtis
560*25c28e83SPiotr Jasiukajtis
561*25c28e83SPiotr Jasiukajtis	  faddd	%f26,%f20,%f26
562*25c28e83SPiotr Jasiukajtis	  faddd	%f22,%f24,%f22
563*25c28e83SPiotr Jasiukajtis	  faddd	%f22,%f26,%f26
564*25c28e83SPiotr Jasiukajtis.done_from_special0:
565*25c28e83SPiotr Jasiukajtis	  fxor	%f26,%f46,%f26
566*25c28e83SPiotr Jasiukajtis	  st	%f26,[%l6]
567*25c28e83SPiotr Jasiukajtis	  st	%f27,[%l6+4]
568*25c28e83SPiotr Jasiukajtis	  ret
569*25c28e83SPiotr Jasiukajtis	  restore
570*25c28e83SPiotr Jasiukajtis
571*25c28e83SPiotr Jasiukajtis
572*25c28e83SPiotr Jasiukajtis
573*25c28e83SPiotr Jasiukajtis	.align	16
574*25c28e83SPiotr Jasiukajtis.last1:
575*25c28e83SPiotr Jasiukajtis	fmovd	pio2,%f10		! set up dummy arguments
576*25c28e83SPiotr Jasiukajtis	fmovd	pio2,%f18
577*25c28e83SPiotr Jasiukajtis	fabsd	%f10,%f14
578*25c28e83SPiotr Jasiukajtis	fabsd	%f18,%f12
579*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x3ff921fb),%o0
580*25c28e83SPiotr Jasiukajtis	or	%o0,%lo(0x3ff921fb),%o0
581*25c28e83SPiotr Jasiukajtis	mov	%o0,%l3
582*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont1
583*25c28e83SPiotr Jasiukajtis! delay slot
584*25c28e83SPiotr Jasiukajtis	add	%fp,junk,%i5
585*25c28e83SPiotr Jasiukajtis
586*25c28e83SPiotr Jasiukajtis
587*25c28e83SPiotr Jasiukajtis
588*25c28e83SPiotr Jasiukajtis	.align	16
589*25c28e83SPiotr Jasiukajtis.last2:
590*25c28e83SPiotr Jasiukajtis	fmovd	pio2,%f20
591*25c28e83SPiotr Jasiukajtis	fmovd	pio2,%f28
592*25c28e83SPiotr Jasiukajtis	fabsd	%f20,%f24
593*25c28e83SPiotr Jasiukajtis	fabsd	%f28,%f22
594*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x3ff921fb),%o0
595*25c28e83SPiotr Jasiukajtis	or	%o0,%lo(0x3ff921fb),%o0
596*25c28e83SPiotr Jasiukajtis	mov	%o0,%l3
597*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont2
598*25c28e83SPiotr Jasiukajtis! delay slot
599*25c28e83SPiotr Jasiukajtis	add	%fp,junk,%l6
600*25c28e83SPiotr Jasiukajtis
601*25c28e83SPiotr Jasiukajtis
602*25c28e83SPiotr Jasiukajtis
603*25c28e83SPiotr Jasiukajtis	.align	16
604*25c28e83SPiotr Jasiukajtis.nan0:
605*25c28e83SPiotr Jasiukajtis	  faddd	%f22,%f26,%f26
606*25c28e83SPiotr Jasiukajtis.nan0_from_special0:
607*25c28e83SPiotr Jasiukajtis	 fabsd	%f10,%f14
608*25c28e83SPiotr Jasiukajtis	 lda	[%i3+4]%asi,%f19
609*25c28e83SPiotr Jasiukajtis	 fabsd	%f18,%f12
610*25c28e83SPiotr Jasiukajtis	 lda	[%i1]%asi,%o0
611*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%l3
612*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.special0
613*25c28e83SPiotr Jasiukajtis! delay slot
614*25c28e83SPiotr Jasiukajtis	fmuld	%f0,%f2,%f6
615*25c28e83SPiotr Jasiukajtis
616*25c28e83SPiotr Jasiukajtis
617*25c28e83SPiotr Jasiukajtis	.align	16
618*25c28e83SPiotr Jasiukajtis.big0:
619*25c28e83SPiotr Jasiukajtis	 fabsd	%f18,%f12
620*25c28e83SPiotr Jasiukajtis	 lda	[%i1]%asi,%o0
621*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%l3
622*25c28e83SPiotr Jasiukajtis	cmp	%g5,%o5
623*25c28e83SPiotr Jasiukajtis	bge,pn	%icc,.return_ah0	! if hx >= 0x7ff00000
624*25c28e83SPiotr Jasiukajtis! delay slot
625*25c28e83SPiotr Jasiukajtis	nop
626*25c28e83SPiotr Jasiukajtis	cmp	%l0,%o4
627*25c28e83SPiotr Jasiukajtis	bge,pn	%icc,1f			! if hx - hy >= 0x03600000
628*25c28e83SPiotr Jasiukajtis! delay slot
629*25c28e83SPiotr Jasiukajtis	nop
630*25c28e83SPiotr Jasiukajtis	ldd	[%fp+twom3],%f6
631*25c28e83SPiotr Jasiukajtis	fmuld	%f0,%f6,%f0
632*25c28e83SPiotr Jasiukajtis	fmuld	%f2,%f6,%f2
633*25c28e83SPiotr Jasiukajtis	add	%l0,%o1,%l0
634*25c28e83SPiotr Jasiukajtis	addcc	%i0,-1,%i0
635*25c28e83SPiotr Jasiukajtis	ble,pn	%icc,.last1
636*25c28e83SPiotr Jasiukajtis! delay slot
637*25c28e83SPiotr Jasiukajtis	nop
638*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont1
639*25c28e83SPiotr Jasiukajtis! delay slot
640*25c28e83SPiotr Jasiukajtis	nop
641*25c28e83SPiotr Jasiukajtis1:
642*25c28e83SPiotr Jasiukajtis	fbg,pn	%fcc0,.return_ah0
643*25c28e83SPiotr Jasiukajtis! delay slot
644*25c28e83SPiotr Jasiukajtis	nop
645*25c28e83SPiotr Jasiukajtis	fcmpd	%fcc3,%f8,signbit
646*25c28e83SPiotr Jasiukajtis	fbl,pn	%fcc3,.return_ah0
647*25c28e83SPiotr Jasiukajtis! delay slot
648*25c28e83SPiotr Jasiukajtis	nop
649*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.special0
650*25c28e83SPiotr Jasiukajtis! delay slot
651*25c28e83SPiotr Jasiukajtis	fdivd	%f0,%f2,%f6
652*25c28e83SPiotr Jasiukajtis
653*25c28e83SPiotr Jasiukajtis
654*25c28e83SPiotr Jasiukajtis	.align	16
655*25c28e83SPiotr Jasiukajtis.small0:
656*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%l3
657*25c28e83SPiotr Jasiukajtis	fcmpd	%fcc3,%f0,signbit
658*25c28e83SPiotr Jasiukajtis	fbe,pt	%fcc3,.return_ah0
659*25c28e83SPiotr Jasiukajtis! delay slot
660*25c28e83SPiotr Jasiukajtis	nop
661*25c28e83SPiotr Jasiukajtis	ldd	[%fp+two110],%f6
662*25c28e83SPiotr Jasiukajtis	fmuld	%f0,%f6,%f0
663*25c28e83SPiotr Jasiukajtis	fmuld	%f2,%f6,%f2
664*25c28e83SPiotr Jasiukajtis	st	%f0,[%fp+yscl]
665*25c28e83SPiotr Jasiukajtis	ld	[%fp+yscl],%o7
666*25c28e83SPiotr Jasiukajtis	st	%f2,[%fp+xscl]
667*25c28e83SPiotr Jasiukajtis	ld	[%fp+xscl],%l0
668*25c28e83SPiotr Jasiukajtis	sub	%l0,%o7,%l0
669*25c28e83SPiotr Jasiukajtis	add	%l0,%o1,%l0
670*25c28e83SPiotr Jasiukajtis	addcc	%i0,-1,%i0
671*25c28e83SPiotr Jasiukajtis	ble,pn	%icc,.last1
672*25c28e83SPiotr Jasiukajtis! delay slot
673*25c28e83SPiotr Jasiukajtis	nop
674*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont1
675*25c28e83SPiotr Jasiukajtis! delay slot
676*25c28e83SPiotr Jasiukajtis	nop
677*25c28e83SPiotr Jasiukajtis
678*25c28e83SPiotr Jasiukajtis
679*25c28e83SPiotr Jasiukajtis	.align	16
680*25c28e83SPiotr Jasiukajtis.return_ah0:
681*25c28e83SPiotr Jasiukajtis	fzero	%f0
682*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc0,signbit,%f0
683*25c28e83SPiotr Jasiukajtis	fxor	%f36,%f0,%f36
684*25c28e83SPiotr Jasiukajtis	fxor	%f36,pio2,%f0
685*25c28e83SPiotr Jasiukajtis	fxor	%f42,%f36,%f42
686*25c28e83SPiotr Jasiukajtis	fnegd	pio2,%f6
687*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc0,signbit,%f6
688*25c28e83SPiotr Jasiukajtis	faddd	%f6,%f0,%f6
689*25c28e83SPiotr Jasiukajtis	sub	%g5,%l0,%o7
690*25c28e83SPiotr Jasiukajtis	cmp	%o7,%o5
691*25c28e83SPiotr Jasiukajtis	bl,pt	%icc,1f			! if hy < 0x7ff00000
692*25c28e83SPiotr Jasiukajtis! delay slot
693*25c28e83SPiotr Jasiukajtis	nop
694*25c28e83SPiotr Jasiukajtis	ldd	[%fp+pio4],%f0
695*25c28e83SPiotr Jasiukajtis	faddd	%f6,%f0,%f6
696*25c28e83SPiotr Jasiukajtis1:
697*25c28e83SPiotr Jasiukajtis	fdtoi	%f6,%f4
698*25c28e83SPiotr Jasiukajtis.special0:
699*25c28e83SPiotr Jasiukajtis	fxor	%f6,%f42,%f6
700*25c28e83SPiotr Jasiukajtis	st	%f6,[%l4]
701*25c28e83SPiotr Jasiukajtis	st	%f7,[%l4+4]
702*25c28e83SPiotr Jasiukajtis	addcc	%i0,-1,%i0
703*25c28e83SPiotr Jasiukajtis	ble,pn	%icc,.done_from_special0
704*25c28e83SPiotr Jasiukajtis! delay slot
705*25c28e83SPiotr Jasiukajtis	nop
706*25c28e83SPiotr Jasiukajtis	fmovd	%f10,%f0
707*25c28e83SPiotr Jasiukajtis	fmovd	%f18,%f8
708*25c28e83SPiotr Jasiukajtis	fmovd	%f14,%f4
709*25c28e83SPiotr Jasiukajtis	fmovd	%f12,%f2
710*25c28e83SPiotr Jasiukajtis	mov	%i5,%l4
711*25c28e83SPiotr Jasiukajtis	add	%i1,%i2,%i1
712*25c28e83SPiotr Jasiukajtis	add	%i3,%i4,%i3
713*25c28e83SPiotr Jasiukajtis	add	%i5,%l7,%i5
714*25c28e83SPiotr Jasiukajtis	fand	%f0,signbit,%f42
715*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x80000000),%g5
716*25c28e83SPiotr Jasiukajtis	fand	%f8,signbit,%f36
717*25c28e83SPiotr Jasiukajtis	andn	%o0,%g5,%o0
718*25c28e83SPiotr Jasiukajtis	andn	%l3,%g5,%l3
719*25c28e83SPiotr Jasiukajtis	fcmpd	%fcc0,%f4,%f2
720*25c28e83SPiotr Jasiukajtis	fmovd	%f4,%f0
721*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc0,%f2,%f0
722*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc0,%f4,%f2
723*25c28e83SPiotr Jasiukajtis	mov	%o0,%o7
724*25c28e83SPiotr Jasiukajtis	movg	%fcc0,%l3,%o0
725*25c28e83SPiotr Jasiukajtis	movg	%fcc0,%o7,%l3
726*25c28e83SPiotr Jasiukajtis	 lda	[%i1]%asi,%f10
727*25c28e83SPiotr Jasiukajtis	 lda	[%i1+4]%asi,%f11
728*25c28e83SPiotr Jasiukajtis	fbu,pn	%fcc0,.nan0_from_special0
729*25c28e83SPiotr Jasiukajtis! delay slot
730*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%f18
731*25c28e83SPiotr Jasiukajtis	 fabsd	%f10,%f14
732*25c28e83SPiotr Jasiukajtis	 lda	[%i3+4]%asi,%f19
733*25c28e83SPiotr Jasiukajtis	sub	%l3,%o0,%l0
734*25c28e83SPiotr Jasiukajtis	sub	%l3,%o3,%g5
735*25c28e83SPiotr Jasiukajtis	sub	%l0,%o4,%o7
736*25c28e83SPiotr Jasiukajtis	andcc	%g5,%o7,%g0
737*25c28e83SPiotr Jasiukajtis	bge,pn	%icc,.big0
738*25c28e83SPiotr Jasiukajtis! delay slot
739*25c28e83SPiotr Jasiukajtis	nop
740*25c28e83SPiotr Jasiukajtis	 fabsd	%f18,%f12
741*25c28e83SPiotr Jasiukajtis	cmp	%o0,%o5
742*25c28e83SPiotr Jasiukajtis	bl,pn	%icc,.small0
743*25c28e83SPiotr Jasiukajtis! delay slot
744*25c28e83SPiotr Jasiukajtis	 lda	[%i1]%asi,%o0
745*25c28e83SPiotr Jasiukajtis	add	%l0,%o1,%l0
746*25c28e83SPiotr Jasiukajtis	addcc	%i0,-1,%i0
747*25c28e83SPiotr Jasiukajtis	ble,pn	%icc,.last1
748*25c28e83SPiotr Jasiukajtis! delay slot
749*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%l3
750*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont1
751*25c28e83SPiotr Jasiukajtis! delay slot
752*25c28e83SPiotr Jasiukajtis	nop
753*25c28e83SPiotr Jasiukajtis
754*25c28e83SPiotr Jasiukajtis
755*25c28e83SPiotr Jasiukajtis
756*25c28e83SPiotr Jasiukajtis	.align	16
757*25c28e83SPiotr Jasiukajtis.nan1:
758*25c28e83SPiotr Jasiukajtis	fmuld	%f30,%f4,%f30
759*25c28e83SPiotr Jasiukajtis	fsubd	%f0,%f6,%f4
760*25c28e83SPiotr Jasiukajtis	faddd	%f2,%f8,%f8
761*25c28e83SPiotr Jasiukajtis	fsubd	%f4,%f30,%f4
762*25c28e83SPiotr Jasiukajtis.nan1_from_special1:
763*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%f28
764*25c28e83SPiotr Jasiukajtis	 lda	[%i3+4]%asi,%f29
765*25c28e83SPiotr Jasiukajtis	 fabsd	%f20,%f24
766*25c28e83SPiotr Jasiukajtis	 lda	[%i1]%asi,%o0
767*25c28e83SPiotr Jasiukajtis	 fabsd	%f28,%f22
768*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%l3
769*25c28e83SPiotr Jasiukajtis	 mov	%i5,%l6
770*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.special1
771*25c28e83SPiotr Jasiukajtis! delay slot
772*25c28e83SPiotr Jasiukajtis	fmuld	%f10,%f12,%f16
773*25c28e83SPiotr Jasiukajtis
774*25c28e83SPiotr Jasiukajtis
775*25c28e83SPiotr Jasiukajtis	.align	16
776*25c28e83SPiotr Jasiukajtis.big1:
777*25c28e83SPiotr Jasiukajtis	faddd	%f2,%f8,%f8
778*25c28e83SPiotr Jasiukajtis	fsubd	%f4,%f30,%f4
779*25c28e83SPiotr Jasiukajtis.big1_from_special1:
780*25c28e83SPiotr Jasiukajtis	 lda	[%i1]%asi,%o0
781*25c28e83SPiotr Jasiukajtis	 fabsd	%f28,%f22
782*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%l3
783*25c28e83SPiotr Jasiukajtis	 mov	%i5,%l6
784*25c28e83SPiotr Jasiukajtis	cmp	%g5,%o5
785*25c28e83SPiotr Jasiukajtis	bge,pn	%icc,.return_ah1
786*25c28e83SPiotr Jasiukajtis! delay slot
787*25c28e83SPiotr Jasiukajtis	nop
788*25c28e83SPiotr Jasiukajtis	cmp	%l1,%o4
789*25c28e83SPiotr Jasiukajtis	bge,pn	%icc,1f
790*25c28e83SPiotr Jasiukajtis! delay slot
791*25c28e83SPiotr Jasiukajtis	nop
792*25c28e83SPiotr Jasiukajtis	ldd	[%fp+twom3],%f16
793*25c28e83SPiotr Jasiukajtis	fmuld	%f10,%f16,%f10
794*25c28e83SPiotr Jasiukajtis	fmuld	%f12,%f16,%f12
795*25c28e83SPiotr Jasiukajtis	add	%l1,%o1,%l1
796*25c28e83SPiotr Jasiukajtis	srl	%l1,10,%l1
797*25c28e83SPiotr Jasiukajtis	addcc	%i0,-1,%i0
798*25c28e83SPiotr Jasiukajtis	ble,pn	%icc,.last2
799*25c28e83SPiotr Jasiukajtis! delay slot
800*25c28e83SPiotr Jasiukajtis	nop
801*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont2
802*25c28e83SPiotr Jasiukajtis! delay slot
803*25c28e83SPiotr Jasiukajtis	nop
804*25c28e83SPiotr Jasiukajtis1:
805*25c28e83SPiotr Jasiukajtis	fbg,pn	%fcc1,.return_ah1
806*25c28e83SPiotr Jasiukajtis! delay slot
807*25c28e83SPiotr Jasiukajtis	nop
808*25c28e83SPiotr Jasiukajtis	fcmpd	%fcc3,%f18,signbit
809*25c28e83SPiotr Jasiukajtis	fbl,pn	%fcc3,.return_ah1
810*25c28e83SPiotr Jasiukajtis! delay slot
811*25c28e83SPiotr Jasiukajtis	nop
812*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.special1
813*25c28e83SPiotr Jasiukajtis! delay slot
814*25c28e83SPiotr Jasiukajtis	fdivd	%f10,%f12,%f16
815*25c28e83SPiotr Jasiukajtis
816*25c28e83SPiotr Jasiukajtis
817*25c28e83SPiotr Jasiukajtis	.align	16
818*25c28e83SPiotr Jasiukajtis.small1:
819*25c28e83SPiotr Jasiukajtis	fsubd	%f4,%f30,%f4
820*25c28e83SPiotr Jasiukajtis.small1_from_special1:
821*25c28e83SPiotr Jasiukajtis	 fabsd	%f28,%f22
822*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%l3
823*25c28e83SPiotr Jasiukajtis	 mov	%i5,%l6
824*25c28e83SPiotr Jasiukajtis	fcmpd	%fcc3,%f10,signbit
825*25c28e83SPiotr Jasiukajtis	fbe,pt	%fcc3,.return_ah1
826*25c28e83SPiotr Jasiukajtis! delay slot
827*25c28e83SPiotr Jasiukajtis	nop
828*25c28e83SPiotr Jasiukajtis	ldd	[%fp+two110],%f16
829*25c28e83SPiotr Jasiukajtis	fmuld	%f10,%f16,%f10
830*25c28e83SPiotr Jasiukajtis	fmuld	%f12,%f16,%f12
831*25c28e83SPiotr Jasiukajtis	st	%f10,[%fp+yscl]
832*25c28e83SPiotr Jasiukajtis	ld	[%fp+yscl],%o7
833*25c28e83SPiotr Jasiukajtis	st	%f12,[%fp+xscl]
834*25c28e83SPiotr Jasiukajtis	ld	[%fp+xscl],%l1
835*25c28e83SPiotr Jasiukajtis	sub	%l1,%o7,%l1
836*25c28e83SPiotr Jasiukajtis	add	%l1,%o1,%l1
837*25c28e83SPiotr Jasiukajtis	srl	%l1,10,%l1
838*25c28e83SPiotr Jasiukajtis	addcc	%i0,-1,%i0
839*25c28e83SPiotr Jasiukajtis	ble,pn	%icc,.last2
840*25c28e83SPiotr Jasiukajtis! delay slot
841*25c28e83SPiotr Jasiukajtis	nop
842*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont2
843*25c28e83SPiotr Jasiukajtis! delay slot
844*25c28e83SPiotr Jasiukajtis	nop
845*25c28e83SPiotr Jasiukajtis
846*25c28e83SPiotr Jasiukajtis
847*25c28e83SPiotr Jasiukajtis	.align	16
848*25c28e83SPiotr Jasiukajtis.return_ah1:
849*25c28e83SPiotr Jasiukajtis	fzero	%f10
850*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc1,signbit,%f10
851*25c28e83SPiotr Jasiukajtis	fxor	%f38,%f10,%f38
852*25c28e83SPiotr Jasiukajtis	fxor	%f38,pio2,%f10
853*25c28e83SPiotr Jasiukajtis	fxor	%f44,%f38,%f44
854*25c28e83SPiotr Jasiukajtis	fnegd	pio2,%f16
855*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc1,signbit,%f16
856*25c28e83SPiotr Jasiukajtis	faddd	%f16,%f10,%f16
857*25c28e83SPiotr Jasiukajtis	sub	%g5,%l1,%o7
858*25c28e83SPiotr Jasiukajtis	cmp	%o7,%o5
859*25c28e83SPiotr Jasiukajtis	bl,pt	%icc,1f
860*25c28e83SPiotr Jasiukajtis! delay slot
861*25c28e83SPiotr Jasiukajtis	nop
862*25c28e83SPiotr Jasiukajtis	ldd	[%fp+pio4],%f10
863*25c28e83SPiotr Jasiukajtis	faddd	%f16,%f10,%f16
864*25c28e83SPiotr Jasiukajtis1:
865*25c28e83SPiotr Jasiukajtis	fdtoi	%f16,%f14
866*25c28e83SPiotr Jasiukajtis.special1:
867*25c28e83SPiotr Jasiukajtis	fxor	%f16,%f44,%f16
868*25c28e83SPiotr Jasiukajtis	st	%f16,[%l5]
869*25c28e83SPiotr Jasiukajtis	st	%f17,[%l5+4]
870*25c28e83SPiotr Jasiukajtis	addcc	%i0,-1,%i0
871*25c28e83SPiotr Jasiukajtis	bg,pn	%icc,1f
872*25c28e83SPiotr Jasiukajtis! delay slot
873*25c28e83SPiotr Jasiukajtis	nop
874*25c28e83SPiotr Jasiukajtis	fmovd	pio2,%f20		! set up dummy argument
875*25c28e83SPiotr Jasiukajtis	fmovd	pio2,%f28
876*25c28e83SPiotr Jasiukajtis	fabsd	%f20,%f24
877*25c28e83SPiotr Jasiukajtis	fabsd	%f28,%f22
878*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x3ff921fb),%o0
879*25c28e83SPiotr Jasiukajtis	or	%o0,%lo(0x3ff921fb),%o0
880*25c28e83SPiotr Jasiukajtis	mov	%o0,%l3
881*25c28e83SPiotr Jasiukajtis	add	%fp,junk,%i5
882*25c28e83SPiotr Jasiukajtis1:
883*25c28e83SPiotr Jasiukajtis	fmovd	%f20,%f10
884*25c28e83SPiotr Jasiukajtis	fmovd	%f28,%f18
885*25c28e83SPiotr Jasiukajtis	fmovd	%f24,%f14
886*25c28e83SPiotr Jasiukajtis	fmovd	%f22,%f12
887*25c28e83SPiotr Jasiukajtis	mov	%i5,%l5
888*25c28e83SPiotr Jasiukajtis	add	%i1,%i2,%i1
889*25c28e83SPiotr Jasiukajtis	add	%i3,%i4,%i3
890*25c28e83SPiotr Jasiukajtis	add	%i5,%l7,%i5
891*25c28e83SPiotr Jasiukajtis	fand	%f10,signbit,%f44
892*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x80000000),%g5
893*25c28e83SPiotr Jasiukajtis	fand	%f18,signbit,%f38
894*25c28e83SPiotr Jasiukajtis	andn	%o0,%g5,%o0
895*25c28e83SPiotr Jasiukajtis	andn	%l3,%g5,%l3
896*25c28e83SPiotr Jasiukajtis	fcmpd	%fcc1,%f14,%f12
897*25c28e83SPiotr Jasiukajtis	fmovd	%f14,%f10
898*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc1,%f12,%f10
899*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc1,%f14,%f12
900*25c28e83SPiotr Jasiukajtis	mov	%o0,%o7
901*25c28e83SPiotr Jasiukajtis	movg	%fcc1,%l3,%o0
902*25c28e83SPiotr Jasiukajtis	movg	%fcc1,%o7,%l3
903*25c28e83SPiotr Jasiukajtis	 lda	[%i1]%asi,%f20
904*25c28e83SPiotr Jasiukajtis	 lda	[%i1+4]%asi,%f21
905*25c28e83SPiotr Jasiukajtis	fbu,pn	%fcc1,.nan1_from_special1
906*25c28e83SPiotr Jasiukajtis! delay slot
907*25c28e83SPiotr Jasiukajtis	nop
908*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%f28
909*25c28e83SPiotr Jasiukajtis	 lda	[%i3+4]%asi,%f29
910*25c28e83SPiotr Jasiukajtis	 fabsd	%f20,%f24
911*25c28e83SPiotr Jasiukajtis	sub	%l3,%o0,%l1
912*25c28e83SPiotr Jasiukajtis	sub	%l3,%o3,%g5
913*25c28e83SPiotr Jasiukajtis	sub	%l1,%o4,%o7
914*25c28e83SPiotr Jasiukajtis	andcc	%g5,%o7,%g0
915*25c28e83SPiotr Jasiukajtis	bge,pn	%icc,.big1_from_special1
916*25c28e83SPiotr Jasiukajtis! delay slot
917*25c28e83SPiotr Jasiukajtis	nop
918*25c28e83SPiotr Jasiukajtis	cmp	%o0,%o5
919*25c28e83SPiotr Jasiukajtis	bl,pn	%icc,.small1_from_special1
920*25c28e83SPiotr Jasiukajtis! delay slot
921*25c28e83SPiotr Jasiukajtis	 lda	[%i1]%asi,%o0
922*25c28e83SPiotr Jasiukajtis	 fabsd	%f28,%f22
923*25c28e83SPiotr Jasiukajtis	 lda	[%i3]%asi,%l3
924*25c28e83SPiotr Jasiukajtis	add	%l1,%o1,%l1
925*25c28e83SPiotr Jasiukajtis	srl	%l1,10,%l1
926*25c28e83SPiotr Jasiukajtis	addcc	%i0,-1,%i0
927*25c28e83SPiotr Jasiukajtis	ble,pn	%icc,.last2
928*25c28e83SPiotr Jasiukajtis! delay slot
929*25c28e83SPiotr Jasiukajtis	 mov	%i5,%l6
930*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont2
931*25c28e83SPiotr Jasiukajtis! delay slot
932*25c28e83SPiotr Jasiukajtis	nop
933*25c28e83SPiotr Jasiukajtis
934*25c28e83SPiotr Jasiukajtis
935*25c28e83SPiotr Jasiukajtis
936*25c28e83SPiotr Jasiukajtis	.align	16
937*25c28e83SPiotr Jasiukajtis.nan2:
938*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc0,signbit,%f0
939*25c28e83SPiotr Jasiukajtis	 fmuld	%f32,%f14,%f32
940*25c28e83SPiotr Jasiukajtis	 fsubd	%f10,%f16,%f14
941*25c28e83SPiotr Jasiukajtis	 faddd	%f12,%f18,%f18
942*25c28e83SPiotr Jasiukajtis	fxor	%f36,%f0,%f36
943*25c28e83SPiotr Jasiukajtis.nan2_from_special2:
944*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.special2
945*25c28e83SPiotr Jasiukajtis! delay slot
946*25c28e83SPiotr Jasiukajtis	fmuld	%f20,%f22,%f26
947*25c28e83SPiotr Jasiukajtis
948*25c28e83SPiotr Jasiukajtis
949*25c28e83SPiotr Jasiukajtis	.align	16
950*25c28e83SPiotr Jasiukajtis.big2:
951*25c28e83SPiotr Jasiukajtis	fxor	%f36,%f0,%f36
952*25c28e83SPiotr Jasiukajtis.big2_from_special2:
953*25c28e83SPiotr Jasiukajtis	cmp	%g5,%o5
954*25c28e83SPiotr Jasiukajtis	bge,pn	%icc,.return_ah2
955*25c28e83SPiotr Jasiukajtis! delay slot
956*25c28e83SPiotr Jasiukajtis	nop
957*25c28e83SPiotr Jasiukajtis	cmp	%l2,%o4
958*25c28e83SPiotr Jasiukajtis	bge,pn	%icc,1f
959*25c28e83SPiotr Jasiukajtis! delay slot
960*25c28e83SPiotr Jasiukajtis	nop
961*25c28e83SPiotr Jasiukajtis	ldd	[%fp+twom3],%f26
962*25c28e83SPiotr Jasiukajtis	fmuld	%f20,%f26,%f20
963*25c28e83SPiotr Jasiukajtis	fmuld	%f22,%f26,%f22
964*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont3
965*25c28e83SPiotr Jasiukajtis! delay slot
966*25c28e83SPiotr Jasiukajtis	nop
967*25c28e83SPiotr Jasiukajtis1:
968*25c28e83SPiotr Jasiukajtis	fbg,pn	%fcc2,.return_ah2
969*25c28e83SPiotr Jasiukajtis! delay slot
970*25c28e83SPiotr Jasiukajtis	nop
971*25c28e83SPiotr Jasiukajtis	fcmpd	%fcc3,%f28,signbit
972*25c28e83SPiotr Jasiukajtis	fbl,pn	%fcc3,.return_ah2
973*25c28e83SPiotr Jasiukajtis! delay slot
974*25c28e83SPiotr Jasiukajtis	nop
975*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.special2
976*25c28e83SPiotr Jasiukajtis! delay slot
977*25c28e83SPiotr Jasiukajtis	fdivd	%f20,%f22,%f26
978*25c28e83SPiotr Jasiukajtis
979*25c28e83SPiotr Jasiukajtis
980*25c28e83SPiotr Jasiukajtis	.align	16
981*25c28e83SPiotr Jasiukajtis.small2:
982*25c28e83SPiotr Jasiukajtis	fcmpd	%fcc3,%f20,signbit
983*25c28e83SPiotr Jasiukajtis	fbe,pt	%fcc3,.return_ah2
984*25c28e83SPiotr Jasiukajtis! delay slot
985*25c28e83SPiotr Jasiukajtis	nop
986*25c28e83SPiotr Jasiukajtis	ldd	[%fp+two110],%f26
987*25c28e83SPiotr Jasiukajtis	fmuld	%f20,%f26,%f20
988*25c28e83SPiotr Jasiukajtis	fmuld	%f22,%f26,%f22
989*25c28e83SPiotr Jasiukajtis	st	%f20,[%fp+yscl]
990*25c28e83SPiotr Jasiukajtis	ld	[%fp+yscl],%o7
991*25c28e83SPiotr Jasiukajtis	st	%f22,[%fp+xscl]
992*25c28e83SPiotr Jasiukajtis	ld	[%fp+xscl],%l2
993*25c28e83SPiotr Jasiukajtis	sub	%l2,%o7,%l2
994*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont3
995*25c28e83SPiotr Jasiukajtis! delay slot
996*25c28e83SPiotr Jasiukajtis	nop
997*25c28e83SPiotr Jasiukajtis
998*25c28e83SPiotr Jasiukajtis
999*25c28e83SPiotr Jasiukajtis	.align	16
1000*25c28e83SPiotr Jasiukajtis.return_ah2:
1001*25c28e83SPiotr Jasiukajtis	fzero	%f20
1002*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc2,signbit,%f20
1003*25c28e83SPiotr Jasiukajtis	fxor	%f40,%f20,%f40
1004*25c28e83SPiotr Jasiukajtis	fxor	%f40,pio2,%f20
1005*25c28e83SPiotr Jasiukajtis	fxor	%f46,%f40,%f46
1006*25c28e83SPiotr Jasiukajtis	fnegd	pio2,%f26
1007*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc2,signbit,%f26
1008*25c28e83SPiotr Jasiukajtis	faddd	%f26,%f20,%f26
1009*25c28e83SPiotr Jasiukajtis	sub	%g5,%l2,%o7
1010*25c28e83SPiotr Jasiukajtis	cmp	%o7,%o5
1011*25c28e83SPiotr Jasiukajtis	bl,pt	%icc,1f
1012*25c28e83SPiotr Jasiukajtis! delay slot
1013*25c28e83SPiotr Jasiukajtis	nop
1014*25c28e83SPiotr Jasiukajtis	ldd	[%fp+pio4],%f20
1015*25c28e83SPiotr Jasiukajtis	faddd	%f26,%f20,%f26
1016*25c28e83SPiotr Jasiukajtis1:
1017*25c28e83SPiotr Jasiukajtis	fdtoi	%f26,%f24
1018*25c28e83SPiotr Jasiukajtis.special2:
1019*25c28e83SPiotr Jasiukajtis	fxor	%f26,%f46,%f26
1020*25c28e83SPiotr Jasiukajtis	st	%f26,[%l6]
1021*25c28e83SPiotr Jasiukajtis	st	%f27,[%l6+4]
1022*25c28e83SPiotr Jasiukajtis	addcc	%i0,-1,%i0
1023*25c28e83SPiotr Jasiukajtis	bg,pn	%icc,1f
1024*25c28e83SPiotr Jasiukajtis! delay slot
1025*25c28e83SPiotr Jasiukajtis	nop
1026*25c28e83SPiotr Jasiukajtis	fmovd	pio2,%f20		! set up dummy argument
1027*25c28e83SPiotr Jasiukajtis	fmovd	pio2,%f22
1028*25c28e83SPiotr Jasiukajtis	fzero	%f40
1029*25c28e83SPiotr Jasiukajtis	fzero	%f46
1030*25c28e83SPiotr Jasiukajtis	mov	0,%l2
1031*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont3
1032*25c28e83SPiotr Jasiukajtis! delay slot
1033*25c28e83SPiotr Jasiukajtis	add	%fp,junk,%l6
1034*25c28e83SPiotr Jasiukajtis1:
1035*25c28e83SPiotr Jasiukajtis	lda	[%i1]%asi,%f20
1036*25c28e83SPiotr Jasiukajtis	lda	[%i1+4]%asi,%f21
1037*25c28e83SPiotr Jasiukajtis	lda	[%i3]%asi,%f28
1038*25c28e83SPiotr Jasiukajtis	lda	[%i3+4]%asi,%f29
1039*25c28e83SPiotr Jasiukajtis	fabsd	%f20,%f24
1040*25c28e83SPiotr Jasiukajtis	lda	[%i1]%asi,%o0
1041*25c28e83SPiotr Jasiukajtis	fabsd	%f28,%f22
1042*25c28e83SPiotr Jasiukajtis	lda	[%i3]%asi,%l3
1043*25c28e83SPiotr Jasiukajtis	mov	%i5,%l6
1044*25c28e83SPiotr Jasiukajtis	fand	%f20,signbit,%f46
1045*25c28e83SPiotr Jasiukajtis	add	%i1,%i2,%i1
1046*25c28e83SPiotr Jasiukajtis	fand	%f28,signbit,%f40
1047*25c28e83SPiotr Jasiukajtis	fcmpd	%fcc2,%f24,%f22
1048*25c28e83SPiotr Jasiukajtis	add	%i3,%i4,%i3
1049*25c28e83SPiotr Jasiukajtis	add	%i5,%l7,%i5
1050*25c28e83SPiotr Jasiukajtis	fmovd	%f24,%f20
1051*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x80000000),%g5
1052*25c28e83SPiotr Jasiukajtis	andn	%o0,%g5,%o0
1053*25c28e83SPiotr Jasiukajtis	andn	%l3,%g5,%l3
1054*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc2,%f22,%f20
1055*25c28e83SPiotr Jasiukajtis	fmovdg	%fcc2,%f24,%f22
1056*25c28e83SPiotr Jasiukajtis	mov	%o0,%o7
1057*25c28e83SPiotr Jasiukajtis	movg	%fcc2,%l3,%o0
1058*25c28e83SPiotr Jasiukajtis	movg	%fcc2,%o7,%l3
1059*25c28e83SPiotr Jasiukajtis	fbu,pn	%fcc2,.nan2_from_special2
1060*25c28e83SPiotr Jasiukajtis! delay slot
1061*25c28e83SPiotr Jasiukajtis	nop
1062*25c28e83SPiotr Jasiukajtis	sub	%l3,%o0,%l2
1063*25c28e83SPiotr Jasiukajtis	sub	%l3,%o3,%g5
1064*25c28e83SPiotr Jasiukajtis	sub	%l2,%o4,%o7
1065*25c28e83SPiotr Jasiukajtis	andcc	%g5,%o7,%g0
1066*25c28e83SPiotr Jasiukajtis	bge,pn	%icc,.big2_from_special2
1067*25c28e83SPiotr Jasiukajtis! delay slot
1068*25c28e83SPiotr Jasiukajtis	nop
1069*25c28e83SPiotr Jasiukajtis	cmp	%o0,%o5
1070*25c28e83SPiotr Jasiukajtis	bl,pn	%icc,.small2
1071*25c28e83SPiotr Jasiukajtis! delay slot
1072*25c28e83SPiotr Jasiukajtis	nop
1073*25c28e83SPiotr Jasiukajtis	ba,pt	%icc,.cont3
1074*25c28e83SPiotr Jasiukajtis! delay slot
1075*25c28e83SPiotr Jasiukajtis	nop
1076*25c28e83SPiotr Jasiukajtis
1077*25c28e83SPiotr Jasiukajtis	SET_SIZE(__vatan2)
1078*25c28e83SPiotr Jasiukajtis
1079