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