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>
34 * This file is intended to contain gcc-style inline assembly for all
35 * architectures. At the moment these inlines exist only for sparc and
36 * sparcv9 and these functions are implemented in C for x86.
40 extern __GNU_INLINE
double
41 __mul_set(double x
, double y
, int *pe
)
45 uint32_t *__addr
= &__fsr
;
48 "fmuld %4, %5, %0\n\t"
53 : "=&e" (__result
), "=m" (*pe
), "=r" (__fsr
), "=m" (*__addr
)
60 extern __GNU_INLINE
double
61 __div_set(double x
, double y
, int *pe
)
65 uint32_t *__addr
= &__fsr
;
68 "fdivd %4, %5, %0\n\t"
73 : "=&e" (__result
), "=m" (*pe
), "=r" (__fsr
), "=m" (*__addr
)
80 extern __GNU_INLINE
double
86 #if defined(__sparcv9)
98 extern __GNU_INLINE
void
99 __get_ieee_flags(__ieee_flags_type
*b
)
104 * It's preferable to let the assembler insert the nops as
105 * needed; however, it warns as it does so. Add them here for now.
107 __asm__
__volatile__(
112 : "=m" (*b
), "=m" (__fsr
));
117 extern __GNU_INLINE
void
118 __set_ieee_flags(__ieee_flags_type
*b
)
121 * It's preferable to let the assembler insert the nops as
122 * needed; however, it warns as it does so. Add them here for now.
124 __asm__
__volatile__(
132 #endif /* _BASE_INLINES_H */