4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _BASE_INLINES_H
28 #define _BASE_INLINES_H
30 #include <sys/ccompile.h>
31 #include <sys/types.h>
33 #if !defined(__lint) && defined(__GNUC__)
36 * This file is intended to contain gcc-style inline assembly that corresponds
37 * to base.il for all architectures. At the moment these inlines exist only
38 * for sparc and sparcv9 and these functions are implemented in C for x86.
39 * They should be inlined here for gcc if a new x86 base.il is created.
43 extern __GNU_INLINE
double
44 __mul_set(double x
, double y
, int *pe
)
48 uint32_t *__addr
= &__fsr
;
51 "fmuld %4, %5, %0\n\t"
56 : "=&e" (__result
), "=m" (*pe
), "=r" (__fsr
), "=m" (*__addr
)
63 extern __GNU_INLINE
double
64 __div_set(double x
, double y
, int *pe
)
68 uint32_t *__addr
= &__fsr
;
71 "fdivd %4, %5, %0\n\t"
76 : "=&e" (__result
), "=m" (*pe
), "=r" (__fsr
), "=m" (*__addr
)
83 extern __GNU_INLINE
double
89 #if defined(__sparcv9)
101 extern __GNU_INLINE
void
102 __get_ieee_flags(__ieee_flags_type
*b
)
107 * It's preferable to let the assembler insert the nops as
108 * needed; however, it warns as it does so. Add them here for now.
110 __asm__
__volatile__(
115 : "=m" (*b
), "=m" (__fsr
));
120 extern __GNU_INLINE
void
121 __set_ieee_flags(__ieee_flags_type
*b
)
124 * It's preferable to let the assembler insert the nops as
125 * needed; however, it warns as it does so. Add them here for now.
127 __asm__
__volatile__(
135 #endif /* !__lint && __GNUC__ */
137 #endif /* _BASE_INLINES_H */