xref: /onnv-gate/usr/src/lib/libc/sparc/fp/__quad.s (revision 1016:a2290e972fca)
1*1016Sraf/*
2*1016Sraf * CDDL HEADER START
3*1016Sraf *
4*1016Sraf * The contents of this file are subject to the terms of the
5*1016Sraf * Common Development and Distribution License, Version 1.0 only
6*1016Sraf * (the "License").  You may not use this file except in compliance
7*1016Sraf * with the License.
8*1016Sraf *
9*1016Sraf * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*1016Sraf * or http://www.opensolaris.org/os/licensing.
11*1016Sraf * See the License for the specific language governing permissions
12*1016Sraf * and limitations under the License.
13*1016Sraf *
14*1016Sraf * When distributing Covered Code, include this CDDL HEADER in each
15*1016Sraf * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*1016Sraf * If applicable, add the following below this CDDL HEADER, with the
17*1016Sraf * fields enclosed by brackets "[]" replaced with your own identifying
18*1016Sraf * information: Portions Copyright [yyyy] [name of copyright owner]
19*1016Sraf *
20*1016Sraf * CDDL HEADER END
21*1016Sraf */
22*1016Sraf
23*1016Sraf/*
24*1016Sraf * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
25*1016Sraf * Use is subject to license terms.
26*1016Sraf */
27*1016Sraf
28*1016Sraf/*
29*1016Sraf * These are functions corresponding to the inlines in __quad.il
30*1016Sraf * They are compiled as functions only when building sparc libc with gcc.
31*1016Sraf * Someone may want to make them into gcc inlines (__inline__ + __asm__).
32*1016Sraf */
33*1016Sraf
34*1016Sraf#pragma ident	"%Z%%M%	%I%	%E% SMI"
35*1016Sraf
36*1016Sraf#include <sys/asm_linkage.h>
37*1016Sraf
38*1016Sraf	ENTRY_NP(__quad_getfsrp)
39*1016Sraf	retl
40*1016Sraf	st	%fsr,[%o0]
41*1016Sraf	SET_SIZE(__quad_getfsrp)
42*1016Sraf
43*1016Sraf	ENTRY_NP(__quad_setfsrp)
44*1016Sraf	retl
45*1016Sraf	ld	[%o0],%fsr
46*1016Sraf	SET_SIZE(__quad_setfsrp)
47*1016Sraf
48*1016Sraf	ENTRY_NP(__quad_dp_sqrt)
49*1016Sraf	ldd	[%o0],%f0
50*1016Sraf	fsqrtd	%f0,%f0
51*1016Sraf	retl
52*1016Sraf	nop
53*1016Sraf	SET_SIZE(__quad_dp_sqrt)
54*1016Sraf
55*1016Sraf	ENTRY_NP(__quad_faddq)
56*1016Sraf	ldd	[%o0],%f0
57*1016Sraf	ldd	[%o0+8],%f2
58*1016Sraf	ldd	[%o1],%f4
59*1016Sraf	ldd	[%o1+8],%f6
60*1016Sraf	faddq	%f0,%f4,%f8
61*1016Sraf	std	%f8,[%o2]
62*1016Sraf	retl
63*1016Sraf	std	%f10,[%o2+8]
64*1016Sraf	SET_SIZE(__quad_faddq)
65*1016Sraf
66*1016Sraf	ENTRY_NP(__quad_fsubq)
67*1016Sraf	ldd	[%o0],%f0
68*1016Sraf	ldd	[%o0+8],%f2
69*1016Sraf	ldd	[%o1],%f4
70*1016Sraf	ldd	[%o1+8],%f6
71*1016Sraf	fsubq	%f0,%f4,%f8
72*1016Sraf	std	%f8,[%o2]
73*1016Sraf	retl
74*1016Sraf	std	%f10,[%o2+8]
75*1016Sraf	SET_SIZE(__quad_fsubq)
76*1016Sraf
77*1016Sraf	ENTRY_NP(__quad_fmulq)
78*1016Sraf	ldd	[%o0],%f0
79*1016Sraf	ldd	[%o0+8],%f2
80*1016Sraf	ldd	[%o1],%f4
81*1016Sraf	ldd	[%o1+8],%f6
82*1016Sraf	fmulq	%f0,%f4,%f8
83*1016Sraf	std	%f8,[%o2]
84*1016Sraf	retl
85*1016Sraf	std	%f10,[%o2+8]
86*1016Sraf	SET_SIZE(__quad_fmulq)
87*1016Sraf
88*1016Sraf	ENTRY_NP(__quad_fdivq)
89*1016Sraf	ldd	[%o0],%f0
90*1016Sraf	ldd	[%o0+8],%f2
91*1016Sraf	ldd	[%o1],%f4
92*1016Sraf	ldd	[%o1+8],%f6
93*1016Sraf	fdivq	%f0,%f4,%f8
94*1016Sraf	std	%f8,[%o2]
95*1016Sraf	retl
96*1016Sraf	std	%f10,[%o2+8]
97*1016Sraf	SET_SIZE(__quad_fdivq)
98*1016Sraf
99*1016Sraf	ENTRY_NP(__quad_fsqrtq)
100*1016Sraf	ldd	[%o0],%f0
101*1016Sraf	ldd	[%o0+8],%f2
102*1016Sraf	fsqrtq	%f0,%f4
103*1016Sraf	std	%f4,[%o1]
104*1016Sraf	retl
105*1016Sraf	std	%f6,[%o1+8]
106*1016Sraf	SET_SIZE(__quad_fsqrtq)
107*1016Sraf
108*1016Sraf	ENTRY_NP(__quad_fcmpq)
109*1016Sraf	ldd	[%o0],%f0
110*1016Sraf	ldd	[%o0+8],%f2
111*1016Sraf	ldd	[%o1],%f4
112*1016Sraf	ldd	[%o1+8],%f6
113*1016Sraf	fcmpq	%f0,%f4
114*1016Sraf	retl
115*1016Sraf	st	%fsr,[%o2]
116*1016Sraf	SET_SIZE(__quad_fcmpq)
117*1016Sraf
118*1016Sraf	ENTRY_NP(__quad_fcmpeq)
119*1016Sraf	ldd	[%o0],%f0
120*1016Sraf	ldd	[%o0+8],%f2
121*1016Sraf	ldd	[%o1],%f4
122*1016Sraf	ldd	[%o1+8],%f6
123*1016Sraf	fcmpeq	%f0,%f4
124*1016Sraf	retl
125*1016Sraf	st	%fsr,[%o2]
126*1016Sraf	SET_SIZE(__quad_fcmpeq)
127*1016Sraf
128*1016Sraf	ENTRY_NP(__quad_fstoq)
129*1016Sraf	ld	[%o0],%f0
130*1016Sraf	fstoq	%f0,%f4
131*1016Sraf	std	%f4,[%o1]
132*1016Sraf	retl
133*1016Sraf	std	%f6,[%o1+8]
134*1016Sraf	SET_SIZE(__quad_fstoq)
135*1016Sraf
136*1016Sraf	ENTRY_NP(__quad_fdtoq)
137*1016Sraf	ldd	[%o0],%f0
138*1016Sraf	fdtoq	%f0,%f4
139*1016Sraf	std	%f4,[%o1]
140*1016Sraf	retl
141*1016Sraf	std	%f6,[%o1+8]
142*1016Sraf	SET_SIZE(__quad_fdtoq)
143*1016Sraf
144*1016Sraf	ENTRY_NP(__quad_fqtoi)
145*1016Sraf	ldd	[%o0],%f0
146*1016Sraf	ldd	[%o0+8],%f2
147*1016Sraf	fqtoi	%f0,%f4
148*1016Sraf	retl
149*1016Sraf	st	%f4,[%o1]
150*1016Sraf	SET_SIZE(__quad_fqtoi)
151*1016Sraf
152*1016Sraf	ENTRY_NP(__quad_fqtos)
153*1016Sraf	ldd	[%o0],%f0
154*1016Sraf	ldd	[%o0+8],%f2
155*1016Sraf	fqtos	%f0,%f4
156*1016Sraf	retl
157*1016Sraf	st	%f4,[%o1]
158*1016Sraf	SET_SIZE(__quad_fqtos)
159*1016Sraf
160*1016Sraf	ENTRY_NP(__quad_fqtod)
161*1016Sraf	ldd	[%o0],%f0
162*1016Sraf	ldd	[%o0+8],%f2
163*1016Sraf	fqtod	%f0,%f4
164*1016Sraf	retl
165*1016Sraf	std	%f4,[%o1]
166*1016Sraf	SET_SIZE(__quad_fqtod)
167*1016Sraf
168*1016Sraf#if defined(__sparcv9)
169*1016Sraf	ENTRY_NP(__quad_fqtox)
170*1016Sraf	ldd	[%o0],%f0
171*1016Sraf	ldd	[%o0+8],%f2
172*1016Sraf	fqtox	%f0,%f4
173*1016Sraf	retl
174*1016Sraf	std	%f4,[%o1]
175*1016Sraf	SET_SIZE(__quad_fqtox)
176*1016Sraf#endif
177