8354 sync regcomp(3C) with upstream (fix make catalog)
[unleashed/tickless.git] / usr / src / lib / libc / sparc / fp / __quad.s
blob7954bcd4ca88c3e40a1748b681fd3bc43693ccf4
1 /*
2 * CDDL HEADER START
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.
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.
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]
20 * CDDL HEADER END
24 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
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__).
34 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <sys/asm_linkage.h>
38 ENTRY_NP(__quad_getfsrp)
39 retl
40 st %fsr,[%o0]
41 SET_SIZE(__quad_getfsrp)
43 ENTRY_NP(__quad_setfsrp)
44 retl
45 ld [%o0],%fsr
46 SET_SIZE(__quad_setfsrp)
48 ENTRY_NP(__quad_dp_sqrt)
49 ldd [%o0],%f0
50 fsqrtd %f0,%f0
51 retl
52 nop
53 SET_SIZE(__quad_dp_sqrt)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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