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