xref: /titanic_41/usr/src/lib/libc/sparc/fp/__quad.s (revision ba2e4443695ee6a6f420a35cd4fc3d3346d22932)
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 the inlines in __quad.il
30 * They are compiled as functions only when building sparc libc with gcc.
31 * Someone may want to make them into gcc inlines (__inline__ + __asm__).
32 */
33
34#pragma ident	"%Z%%M%	%I%	%E% SMI"
35
36#include <sys/asm_linkage.h>
37
38	ENTRY_NP(__quad_getfsrp)
39	retl
40	st	%fsr,[%o0]
41	SET_SIZE(__quad_getfsrp)
42
43	ENTRY_NP(__quad_setfsrp)
44	retl
45	ld	[%o0],%fsr
46	SET_SIZE(__quad_setfsrp)
47
48	ENTRY_NP(__quad_dp_sqrt)
49	ldd	[%o0],%f0
50	fsqrtd	%f0,%f0
51	retl
52	nop
53	SET_SIZE(__quad_dp_sqrt)
54
55	ENTRY_NP(__quad_faddq)
56	ldd	[%o0],%f0
57	ldd	[%o0+8],%f2
58	ldd	[%o1],%f4
59	ldd	[%o1+8],%f6
60	faddq	%f0,%f4,%f8
61	std	%f8,[%o2]
62	retl
63	std	%f10,[%o2+8]
64	SET_SIZE(__quad_faddq)
65
66	ENTRY_NP(__quad_fsubq)
67	ldd	[%o0],%f0
68	ldd	[%o0+8],%f2
69	ldd	[%o1],%f4
70	ldd	[%o1+8],%f6
71	fsubq	%f0,%f4,%f8
72	std	%f8,[%o2]
73	retl
74	std	%f10,[%o2+8]
75	SET_SIZE(__quad_fsubq)
76
77	ENTRY_NP(__quad_fmulq)
78	ldd	[%o0],%f0
79	ldd	[%o0+8],%f2
80	ldd	[%o1],%f4
81	ldd	[%o1+8],%f6
82	fmulq	%f0,%f4,%f8
83	std	%f8,[%o2]
84	retl
85	std	%f10,[%o2+8]
86	SET_SIZE(__quad_fmulq)
87
88	ENTRY_NP(__quad_fdivq)
89	ldd	[%o0],%f0
90	ldd	[%o0+8],%f2
91	ldd	[%o1],%f4
92	ldd	[%o1+8],%f6
93	fdivq	%f0,%f4,%f8
94	std	%f8,[%o2]
95	retl
96	std	%f10,[%o2+8]
97	SET_SIZE(__quad_fdivq)
98
99	ENTRY_NP(__quad_fsqrtq)
100	ldd	[%o0],%f0
101	ldd	[%o0+8],%f2
102	fsqrtq	%f0,%f4
103	std	%f4,[%o1]
104	retl
105	std	%f6,[%o1+8]
106	SET_SIZE(__quad_fsqrtq)
107
108	ENTRY_NP(__quad_fcmpq)
109	ldd	[%o0],%f0
110	ldd	[%o0+8],%f2
111	ldd	[%o1],%f4
112	ldd	[%o1+8],%f6
113	fcmpq	%f0,%f4
114	retl
115	st	%fsr,[%o2]
116	SET_SIZE(__quad_fcmpq)
117
118	ENTRY_NP(__quad_fcmpeq)
119	ldd	[%o0],%f0
120	ldd	[%o0+8],%f2
121	ldd	[%o1],%f4
122	ldd	[%o1+8],%f6
123	fcmpeq	%f0,%f4
124	retl
125	st	%fsr,[%o2]
126	SET_SIZE(__quad_fcmpeq)
127
128	ENTRY_NP(__quad_fstoq)
129	ld	[%o0],%f0
130	fstoq	%f0,%f4
131	std	%f4,[%o1]
132	retl
133	std	%f6,[%o1+8]
134	SET_SIZE(__quad_fstoq)
135
136	ENTRY_NP(__quad_fdtoq)
137	ldd	[%o0],%f0
138	fdtoq	%f0,%f4
139	std	%f4,[%o1]
140	retl
141	std	%f6,[%o1+8]
142	SET_SIZE(__quad_fdtoq)
143
144	ENTRY_NP(__quad_fqtoi)
145	ldd	[%o0],%f0
146	ldd	[%o0+8],%f2
147	fqtoi	%f0,%f4
148	retl
149	st	%f4,[%o1]
150	SET_SIZE(__quad_fqtoi)
151
152	ENTRY_NP(__quad_fqtos)
153	ldd	[%o0],%f0
154	ldd	[%o0+8],%f2
155	fqtos	%f0,%f4
156	retl
157	st	%f4,[%o1]
158	SET_SIZE(__quad_fqtos)
159
160	ENTRY_NP(__quad_fqtod)
161	ldd	[%o0],%f0
162	ldd	[%o0+8],%f2
163	fqtod	%f0,%f4
164	retl
165	std	%f4,[%o1]
166	SET_SIZE(__quad_fqtod)
167
168#if defined(__sparcv9)
169	ENTRY_NP(__quad_fqtox)
170	ldd	[%o0],%f0
171	ldd	[%o0+8],%f2
172	fqtox	%f0,%f4
173	retl
174	std	%f4,[%o1]
175	SET_SIZE(__quad_fqtox)
176#endif
177