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