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]
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
29 #ifndef _LIBM_MACROS_H
30 #define _LIBM_MACROS_H
32 #include <sys/isa_defs.h>
38 #define HIXWORD 0 /* index of int containing exponent */
39 #define XSGNMSK 0x80000000 /* exponent bit mask within the int */
40 #define XBIASED_EXP(x) ((((int *)&x)[HIXWORD] & ~0x80000000) >> 16)
41 #define ISZEROL(x) (((((int *)&x)[0] & ~XSGNMSK) | ((int *)&x)[1] | \
42 ((int *)&x)[2] | ((int *)&x)[3]) == 0)
49 #define XSGNMSK 0x8000
50 #define XBIASED_EXP(x) (((int *)&x)[HIXWORD] & 0x7fff)
51 #define ISZEROL(x) (x == 0.0L)
53 #define HANDLE_UNSUPPORTED
56 * "convert" the high-order 32 bits of a SPARC quad precision
57 * value ("I") to the sign, exponent, and high-order bits of an
58 * x86 extended double precision value ("E"); the low-order bits
59 * in the 12-byte quantity are left intact
62 E[2] = 0xffff & ((I) >> 16); \
63 E[1] = (((I) & 0x7fff0000) == 0)? \
64 (E[1] & 0x7fff) | (0x7fff8000 & ((I) << 15)) :\
65 0x80000000 | (E[1] & 0x7fff) | (0x7fff8000 & ((I) << 15))
68 * "convert" the sign, exponent, and high-order bits of an x86
69 * extended double precision value ("E") to the high-order 32 bits
70 * of a SPARC quad precision value ("I")
73 I = ((E[2]<<16) | (0xffff & (E[1]>>15)))
76 #error Unknown architecture
79 #endif /* _LIBM_MACROS_H */