Make fenv.h FE_* macros usable in #if (bug 3439).

This commit is contained in:
Joseph Myers 2012-11-03 17:07:56 +00:00
parent 0244426b93
commit fbeafedeea
23 changed files with 535 additions and 247 deletions

View File

@ -1,3 +1,61 @@
2012-11-03 Joseph Myers <joseph@codesourcery.com>
[BZ #3439]
* sysdeps/powerpc/bits/fenv.h (FE_INEXACT): Define macro to
integer constant usable in #if and use that to give value to enum
constant.
(FE_DIVBYZERO): Likewise.
(FE_UNDERFLOW): Likewise.
(FE_OVERFLOW): Likewise.
(FE_INVALID): Likewise.
(FE_INVALID_SNAN): Likewise.
(FE_INVALID_ISI): Likewise.
(FE_INVALID_IDI): Likewise.
(FE_INVALID_ZDZ): Likewise.
(FE_INVALID_IMZ): Likewise.
(FE_INVALID_COMPARE): Likewise.
(FE_INVALID_SOFTWARE): Likewise.
(FE_INVALID_SQRT): Likewise.
(FE_INVALID_INTEGER_CONVERSION): Likewise.
(FE_TONEAREST): Likewise.
(FE_TOWARDZERO): Likewise.
(FE_UPWARD): Likewise.
(FE_DOWNWARD): Likewise.
* sysdeps/s390/fpu/bits/fenv.h (FE_INVALID): Likewise.
(FE_DIVBYZERO): Likewise.
(FE_OVERFLOW): Likewise.
(FE_UNDERFLOW): Likewise.
(FE_INEXACT): Likewise.
(FE_TONEAREST): Likewise.
(FE_DOWNWARD): Likewise.
(FE_UPWARD): Likewise.
(FE_TOWARDZERO): Likewise.
* sysdeps/sh/sh4/fpu/bits/fenv.h (FE_INEXACT): Likewise.
(FE_UNDERFLOW): Likewise.
(FE_OVERFLOW): Likewise.
(FE_DIVBYZERO): Likewise.
(FE_INVALID): Likewise.
(FE_TONEAREST): Likewise.
(FE_TOWARDZERO): Likewise.
* sysdeps/sparc/fpu/bits/fenv.h (FE_INVALID): Likewise.
(FE_OVERFLOW): Likewise.
(FE_UNDERFLOW): Likewise.
(FE_DIVBYZERO): Likewise.
(FE_INEXACT): Likewise.
(FE_TONEAREST): Likewise.
(FE_TOWARDZERO): Likewise.
(FE_UPWARD): Likewise.
(FE_DOWNWARD): Likewise.
* sysdeps/x86/fpu/bits/fenv.h (FE_INVALID): Likewise.
(FE_DIVBYZERO): Likewise.
(FE_OVERFLOW): Likewise.
(FE_UNDERFLOW): Likewise.
(FE_INEXACT): Likewise.
(FE_TONEAREST): Likewise.
(FE_DOWNWARD): Likewise.
(FE_UPWARD): Likewise.
(FE_TOWARDZERO): Likewise.
2012-11-02 Chris Metcalf <cmetcalf@tilera.com> 2012-11-02 Chris Metcalf <cmetcalf@tilera.com>
* elf/elf.h (R_TILEGX_IMM16_X[01]_HW[012]_(|LAST_)PLT_PCREL): Add. * elf/elf.h (R_TILEGX_IMM16_X[01]_HW[012]_(|LAST_)PLT_PCREL): Add.

19
NEWS
View File

@ -9,15 +9,16 @@ Version 2.17
* The following bugs are resolved with this release: * The following bugs are resolved with this release:
1349, 3479, 5044, 5298, 5400, 6530, 6778, 6808, 9685, 9914, 10014, 10038, 1349, 3439, 3479, 5044, 5298, 5400, 6530, 6778, 6808, 9685, 9914, 10014,
10631, 11438, 11607, 12140, 13412, 13542, 13601, 13629, 13679, 13696, 10038, 10631, 11438, 11607, 12140, 13412, 13542, 13601, 13629, 13679,
13717, 13741, 13939, 13966, 14042, 14047, 14090, 14150, 14151, 14152, 13696, 13717, 13741, 13939, 13966, 14042, 14047, 14090, 14150, 14151,
14154, 14157, 14166, 14173, 14195, 14237, 14251, 14252, 14283, 14298, 14152, 14154, 14157, 14166, 14173, 14195, 14237, 14251, 14252, 14283,
14303, 14307, 14328, 14331, 14336, 14337, 14347, 14349, 14376, 14417, 14298, 14303, 14307, 14328, 14331, 14336, 14337, 14347, 14349, 14376,
14459, 14476, 14477, 14505, 14510, 14516, 14518, 14519, 14530, 14532, 14417, 14459, 14476, 14477, 14505, 14510, 14516, 14518, 14519, 14530,
14538, 14543, 14544, 14545, 14557, 14562, 14568, 14576, 14579, 14583, 14532, 14538, 14543, 14544, 14545, 14557, 14562, 14568, 14576, 14579,
14587, 14595, 14602, 14610, 14621, 14638, 14645, 14648, 14652, 14660, 14583, 14587, 14595, 14602, 14610, 14621, 14638, 14645, 14648, 14652,
14661, 14669, 14683, 14694, 14716, 14743, 14767, 14783, 14784, 14785. 14660, 14661, 14669, 14683, 14694, 14716, 14743, 14767, 14783, 14784,
14785.
* Support for STT_GNU_IFUNC symbols added for s390 and s390x. * Support for STT_GNU_IFUNC symbols added for s390 and s390x.
Optimized versions of memcpy, memset, and memcmp added for System z10 and Optimized versions of memcpy, memset, and memcmp added for System z10 and

View File

@ -1,3 +1,20 @@
2012-11-03 Joseph Myers <joseph@codesourcery.com>
[BZ #3439]
* sysdeps/alpha/fpu/bits/fenv.h (FE_DENORMAL): Define macro to
integer constant usable in #if and use that to give value to enum
constant.
(FE_INEXACT): Likewise.
(FE_UNDERFLOW): Likewise.
(FE_OVERFLOW): Likewise.
(FE_DIVBYZERO): Likewise.
(FE_INVALID): Likewise.
(FE_ALL_EXCEPT): Likewise.
(FE_TOWARDZERO): Likewise.
(FE_DOWNWARD): Likewise.
(FE_TONEAREST): Likewise.
(FE_UPWARD): Likewise.
2012-11-01 Andreas Jaeger <aj@suse.de> 2012-11-01 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Remove all * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Remove all

View File

@ -1,3 +1,15 @@
2012-11-03 Joseph Myers <joseph@codesourcery.com>
[BZ #3439]
* sysdeps/am33/fpu/bits/fenv.h (FE_INEXACT): Define macro to
integer constant usable in #if and use that to give value to enum
constant.
(FE_UNDERFLOW): Likewise.
(FE_OVERFLOW): Likewise.
(FE_DIVBYZERO): Likewise.
(FE_INVALID): Likewise.
(FE_TONEAREST): Likewise.
2012-10-30 Joseph Myers <joseph@codesourcery.com> 2012-10-30 Joseph Myers <joseph@codesourcery.com>
[BZ #14047] [BZ #14047]

View File

@ -1,3 +1,18 @@
2012-11-03 Joseph Myers <joseph@codesourcery.com>
[BZ #3439]
* sysdeps/arm/bits/fenv.h (FE_INVALID): Define macro to integer
constant usable in #if and use that to give value to enum
constant.
(FE_DIVBYZERO): Likewise.
(FE_OVERFLOW): Likewise.
(FE_UNDERFLOW): Likewise.
(FE_INEXACT): Likewise.
(FE_TONEAREST): Likewise.
(FE_UPWARD): Likewise.
(FE_DOWNWARD): Likewise.
(FE_TOWARDZERO): Likewise.
2012-10-22 Roland McGrath <roland@hack.frob.com> 2012-10-22 Roland McGrath <roland@hack.frob.com>
* sysdeps/unix/sysv/linux/arm/nptl/libc.abilist * sysdeps/unix/sysv/linux/arm/nptl/libc.abilist

View File

@ -1,3 +1,18 @@
2012-11-03 Joseph Myers <joseph@codesourcery.com>
[BZ #3439]
* sysdeps/hppa/fpu/bits/fenv.h (FE_INVALID): Define macro to
integer constant usable in #if and use that to give value to enum
constant.
(FE_DIVBYZERO): Likewise.
(FE_OVERFLOW): Likewise.
(FE_UNDERFLOW): Likewise.
(FE_INEXACT): Likewise.
(FE_TONEAREST): Likewise.
(FE_TOWARDZERO): Likewise.
(FE_UPWARD): Likewise.
(FE_DOWNWARD): Likewise.
2012-10-30 Joseph Myers <joseph@codesourcery.com> 2012-10-30 Joseph Myers <joseph@codesourcery.com>
[BZ #14047] [BZ #14047]

View File

@ -1,3 +1,20 @@
2012-11-03 Joseph Myers <joseph@codesourcery.com>
[BZ #3439]
* sysdeps/ia64/bits/fenv.h (FE_INEXACT): Define macro to integer
constant usable in #if and use that to give value to enum
constant.
(FE_UNDERFLOW): Likewise.
(FE_OVERFLOW): Likewise.
(FE_DIVBYZERO): Likewise.
(FE_UNNORMAL): Likewise.
(FE_INVALID): Likewise.
(FE_ALL_EXCEPT): Likewise.
(FE_TOWARDZERO): Likewise.
(FE_UPWARD): Likewise.
(FE_DOWNWARD): Likewise.
(FE_TONEAREST): Likewise.
2012-10-30 Joseph Myers <joseph@codesourcery.com> 2012-10-30 Joseph Myers <joseph@codesourcery.com>
[BZ #14047] [BZ #14047]

View File

@ -1,3 +1,18 @@
2012-11-03 Joseph Myers <joseph@codesourcery.com>
[BZ #3439]
* sysdeps/m68k/fpu/bits/fenv.h (FE_INEXACT): Define macro to
integer constant usable in #if and use that to give value to enum
constant.
(FE_DIVBYZERO): Likewise.
(FE_UNDERFLOW): Likewise.
(FE_OVERFLOW): Likewise.
(FE_INVALID): Likewise.
(FE_TONEAREST): Likewise.
(FE_TOWARDZERO): Likewise.
(FE_DOWNWARD): Likewise.
(FE_UPWARD): Likewise.
2012-10-25 Andreas Jaeger <aj@suse.de> 2012-10-25 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Remove all * sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Remove all

View File

@ -1,3 +1,18 @@
2012-11-03 Joseph Myers <joseph@codesourcery.com>
[BZ #3439]
* sysdeps/mips/bits/fenv.h (FE_INEXACT): Define macro to integer
constant usable in #if and use that to give value to enum
constant.
(FE_UNDERFLOW): Likewise.
(FE_OVERFLOW): Likewise.
(FE_DIVBYZERO): Likewise.
(FE_INVALID): Likewise.
(FE_TONEAREST): Likewise.
(FE_TOWARDZERO): Likewise.
(FE_UPWARD): Likewise.
(FE_DOWNWARD): Likewise.
2012-11-01 Thomas Schwinge <thomas@codesourcery.com> 2012-11-01 Thomas Schwinge <thomas@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/configure: Regenerate. * sysdeps/unix/sysv/linux/mips/configure: Regenerate.

View File

@ -1,3 +1,10 @@
2012-11-03 Joseph Myers <joseph@codesourcery.com>
[BZ #3439]
* sysdeps/tile/bits/fenv.h (FE_TONEAREST): Define macro to integer
constant usable in #if and use that to give value to enum
constant.
2012-11-03 Chris Metcalf <cmetcalf@tilera.com> 2012-11-03 Chris Metcalf <cmetcalf@tilera.com>
* sysdeps/tile/libm-test-ulps: Account for new tests. * sysdeps/tile/libm-test-ulps: Account for new tests.

View File

@ -36,27 +36,34 @@
enum enum
{ {
#ifdef __USE_GNU #ifdef __USE_GNU
FE_DENORMAL = 1UL << 22, FE_DENORMAL =
#define FE_DENORMAL FE_DENORMAL #define FE_DENORMAL (1 << 22)
FE_DENORMAL,
#endif #endif
FE_INEXACT = 1UL << 21, FE_INEXACT =
#define FE_INEXACT FE_INEXACT #define FE_INEXACT (1 << 21)
FE_INEXACT,
FE_UNDERFLOW = 1UL << 20, FE_UNDERFLOW =
#define FE_UNDERFLOW FE_UNDERFLOW #define FE_UNDERFLOW (1 << 20)
FE_UNDERFLOW,
FE_OVERFLOW = 1UL << 19, FE_OVERFLOW =
#define FE_OVERFLOW FE_OVERFLOW #define FE_OVERFLOW (1 << 19)
FE_OVERFLOW,
FE_DIVBYZERO = 1UL << 18, FE_DIVBYZERO =
#define FE_DIVBYZERO FE_DIVBYZERO #define FE_DIVBYZERO (1 << 18)
FE_DIVBYZERO,
FE_INVALID = 1UL << 17, FE_INVALID =
#define FE_INVALID FE_INVALID #define FE_INVALID (1 << 17)
FE_INVALID,
FE_ALL_EXCEPT = 0x3f << 17 FE_ALL_EXCEPT =
#define FE_ALL_EXCEPT FE_ALL_EXCEPT #define FE_ALL_EXCEPT (0x3f << 17)
FE_ALL_EXCEPT
}; };
/* Alpha chips support all four defined rouding modes. /* Alpha chips support all four defined rouding modes.
@ -70,17 +77,21 @@ enum
enum enum
{ {
FE_TOWARDZERO = 0, FE_TOWARDZERO =
#define FE_TOWARDZERO FE_TOWARDZERO #define FE_TOWARDZERO 0
FE_TOWARDZERO,
FE_DOWNWARD = 1, FE_DOWNWARD =
#define FE_DOWNWARD FE_DOWNWARD #define FE_DOWNWARD 1
FE_DOWNWARD,
FE_TONEAREST = 2, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST 2
FE_TONEAREST,
FE_UPWARD = 3, FE_UPWARD =
#define FE_UPWARD FE_UPWARD #define FE_UPWARD 3
FE_UPWARD,
}; };
#ifdef __USE_GNU #ifdef __USE_GNU

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc. /* Copyright (C) 1998-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Alexandre Oliva <aoliva@redhat.com> Contributed by Alexandre Oliva <aoliva@redhat.com>
based on the corresponding file in the mips port. based on the corresponding file in the mips port.
@ -26,16 +26,21 @@
positions of the appropriate bits in the FPCR register. */ positions of the appropriate bits in the FPCR register. */
enum enum
{ {
FE_INEXACT = 0x01, FE_INEXACT =
#define FE_INEXACT FE_INEXACT #define FE_INEXACT 0x01
FE_UNDERFLOW = 0x02, FE_INEXACT,
#define FE_UNDERFLOW FE_UNDERFLOW FE_UNDERFLOW =
FE_OVERFLOW = 0x04, #define FE_UNDERFLOW 0x02
#define FE_OVERFLOW FE_OVERFLOW FE_UNDERFLOW,
FE_DIVBYZERO = 0x08, FE_OVERFLOW =
#define FE_DIVBYZERO FE_DIVBYZERO #define FE_OVERFLOW 0x04
FE_INVALID = 0x10, FE_OVERFLOW,
#define FE_INVALID FE_INVALID FE_DIVBYZERO =
#define FE_DIVBYZERO 0x08
FE_DIVBYZERO,
FE_INVALID =
#define FE_INVALID 0x10
FE_INVALID,
}; };
#define FE_ALL_EXCEPT \ #define FE_ALL_EXCEPT \
@ -45,8 +50,9 @@ enum
reserved to represent other rounding modes. */ reserved to represent other rounding modes. */
enum enum
{ {
FE_TONEAREST = 0x00000, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST 0x00000
FE_TONEAREST,
}; };

View File

@ -22,16 +22,21 @@
/* Define bits representing exceptions in the FPU status word. */ /* Define bits representing exceptions in the FPU status word. */
enum enum
{ {
FE_INVALID = 1, FE_INVALID =
#define FE_INVALID FE_INVALID #define FE_INVALID 1
FE_DIVBYZERO = 2, FE_INVALID,
#define FE_DIVBYZERO FE_DIVBYZERO FE_DIVBYZERO =
FE_OVERFLOW = 4, #define FE_DIVBYZERO 2
#define FE_OVERFLOW FE_OVERFLOW FE_DIVBYZERO,
FE_UNDERFLOW = 8, FE_OVERFLOW =
#define FE_UNDERFLOW FE_UNDERFLOW #define FE_OVERFLOW 4
FE_INEXACT = 16, FE_OVERFLOW,
#define FE_INEXACT FE_INEXACT FE_UNDERFLOW =
#define FE_UNDERFLOW 8
FE_UNDERFLOW,
FE_INEXACT =
#define FE_INEXACT 16
FE_INEXACT,
}; };
/* Amount to shift by to convert an exception to a mask bit. */ /* Amount to shift by to convert an exception to a mask bit. */
@ -44,14 +49,18 @@ enum
/* VFP supports all of the four defined rounding modes. */ /* VFP supports all of the four defined rounding modes. */
enum enum
{ {
FE_TONEAREST = 0, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST 0
FE_UPWARD = 0x400000, FE_TONEAREST,
#define FE_UPWARD FE_UPWARD FE_UPWARD =
FE_DOWNWARD = 0x800000, #define FE_UPWARD 0x400000
#define FE_DOWNWARD FE_DOWNWARD FE_UPWARD,
FE_TOWARDZERO = 0xc00000 FE_DOWNWARD =
#define FE_TOWARDZERO FE_TOWARDZERO #define FE_DOWNWARD 0x800000
FE_DOWNWARD,
FE_TOWARDZERO =
#define FE_TOWARDZERO 0xc00000
FE_TOWARDZERO
}; };
/* Type representing exception flags. */ /* Type representing exception flags. */

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 Free Software Foundation, Inc. /* Copyright (C) 2000-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by David Huggins-Daines <dhd@debian.org> Contributed by David Huggins-Daines <dhd@debian.org>
@ -26,16 +26,21 @@
27 bits). */ 27 bits). */
enum enum
{ {
FE_INVALID = 1<<4, /* V */ FE_INVALID =
#define FE_INVALID FE_INVALID #define FE_INVALID (1<<4) /* V */
FE_DIVBYZERO = 1<<3, /* Z */ FE_INVALID,
#define FE_DIVBYZERO FE_DIVBYZERO FE_DIVBYZERO =
FE_OVERFLOW = 1<<2, /* O */ #define FE_DIVBYZERO (1<<3) /* Z */
#define FE_OVERFLOW FE_OVERFLOW FE_DIVBYZERO,
FE_UNDERFLOW = 1<<1, /* U */ FE_OVERFLOW =
#define FE_UNDERFLOW FE_UNDERFLOW #define FE_OVERFLOW (1<<2) /* O */
FE_INEXACT = 1<<0, /* I */ FE_OVERFLOW,
#define FE_INEXACT FE_INEXACT FE_UNDERFLOW =
#define FE_UNDERFLOW (1<<1) /* U */
FE_UNDERFLOW,
FE_INEXACT =
#define FE_INEXACT (1<<0) /* I */
FE_INEXACT,
}; };
#define FE_ALL_EXCEPT \ #define FE_ALL_EXCEPT \
@ -46,14 +51,18 @@ enum
register for the appropriate macros. */ register for the appropriate macros. */
enum enum
{ {
FE_TONEAREST = 0 << 9, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST (0 << 9)
FE_TOWARDZERO = 1 << 9, FE_TONEAREST,
#define FE_TOWARDZERO FE_TOWARDZERO FE_TOWARDZERO =
FE_UPWARD = 2 << 9, #define FE_TOWARDZERO (1 << 9)
#define FE_UPWARD FE_UPWARD FE_TOWARDZERO,
FE_DOWNWARD = 3 << 9, FE_UPWARD =
#define FE_DOWNWARD FE_DOWNWARD #define FE_UPWARD (2 << 9)
FE_UPWARD,
FE_DOWNWARD =
#define FE_DOWNWARD (3 << 9)
FE_DOWNWARD,
}; };
/* Type representing exception flags. */ /* Type representing exception flags. */

View File

@ -25,43 +25,53 @@
enum enum
{ {
FE_INEXACT = 1UL << 5, FE_INEXACT =
#define FE_INEXACT FE_INEXACT #define FE_INEXACT (1 << 5)
FE_INEXACT,
FE_UNDERFLOW = 1UL << 4, FE_UNDERFLOW =
#define FE_UNDERFLOW FE_UNDERFLOW #define FE_UNDERFLOW (1 << 4)
FE_UNDERFLOW,
FE_OVERFLOW = 1UL << 3, FE_OVERFLOW =
#define FE_OVERFLOW FE_OVERFLOW #define FE_OVERFLOW (1 << 3)
FE_OVERFLOW,
FE_DIVBYZERO = 1UL << 2, FE_DIVBYZERO =
#define FE_DIVBYZERO FE_DIVBYZERO #define FE_DIVBYZERO (1 << 2)
FE_DIVBYZERO,
FE_UNNORMAL = 1UL << 1, FE_UNNORMAL =
#define FE_UNNORMAL FE_UNNORMAL #define FE_UNNORMAL (1 << 1)
FE_UNNORMAL,
FE_INVALID = 1UL << 0, FE_INVALID =
#define FE_INVALID FE_INVALID #define FE_INVALID (1 << 0)
FE_INVALID,
FE_ALL_EXCEPT = FE_ALL_EXCEPT =
(FE_INEXACT | FE_UNDERFLOW | FE_OVERFLOW | FE_DIVBYZERO | FE_UNNORMAL | FE_INVALID) #define FE_ALL_EXCEPT (FE_INEXACT | FE_UNDERFLOW | FE_OVERFLOW | FE_DIVBYZERO | FE_UNNORMAL | FE_INVALID)
#define FE_ALL_EXCEPT FE_ALL_EXCEPT FE_ALL_EXCEPT
}; };
enum enum
{ {
FE_TOWARDZERO = 3, FE_TOWARDZERO =
#define FE_TOWARDZERO FE_TOWARDZERO #define FE_TOWARDZERO 3
FE_TOWARDZERO,
FE_UPWARD = 2, FE_UPWARD =
#define FE_UPWARD FE_UPWARD #define FE_UPWARD 2
FE_UPWARD,
FE_DOWNWARD = 1, FE_DOWNWARD =
#define FE_DOWNWARD FE_DOWNWARD #define FE_DOWNWARD 1
FE_DOWNWARD,
FE_TONEAREST = 0, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST 0
FE_TONEAREST,
}; };

View File

@ -24,16 +24,21 @@
the appropriate bits in the FPSR Accrued Exception Byte. */ the appropriate bits in the FPSR Accrued Exception Byte. */
enum enum
{ {
FE_INEXACT = 1 << 3, FE_INEXACT =
#define FE_INEXACT FE_INEXACT #define FE_INEXACT (1 << 3)
FE_DIVBYZERO = 1 << 4, FE_INEXACT,
#define FE_DIVBYZERO FE_DIVBYZERO FE_DIVBYZERO =
FE_UNDERFLOW = 1 << 5, #define FE_DIVBYZERO (1 << 4)
#define FE_UNDERFLOW FE_UNDERFLOW FE_DIVBYZERO,
FE_OVERFLOW = 1 << 6, FE_UNDERFLOW =
#define FE_OVERFLOW FE_OVERFLOW #define FE_UNDERFLOW (1 << 5)
FE_INVALID = 1 << 7 FE_UNDERFLOW,
#define FE_INVALID FE_INVALID FE_OVERFLOW =
#define FE_OVERFLOW (1 << 6)
FE_OVERFLOW,
FE_INVALID =
#define FE_INVALID (1 << 7)
FE_INVALID
}; };
#define FE_ALL_EXCEPT \ #define FE_ALL_EXCEPT \
@ -44,14 +49,18 @@ enum
appropriate macros. */ appropriate macros. */
enum enum
{ {
FE_TONEAREST = 0, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST 0
FE_TOWARDZERO = 1 << 4, FE_TONEAREST,
#define FE_TOWARDZERO FE_TOWARDZERO FE_TOWARDZERO =
FE_DOWNWARD = 2 << 4, #define FE_TOWARDZERO (1 << 4)
#define FE_DOWNWARD FE_DOWNWARD FE_TOWARDZERO,
FE_UPWARD = 3 << 4 FE_DOWNWARD =
#define FE_UPWARD FE_UPWARD #define FE_DOWNWARD (2 << 4)
FE_DOWNWARD,
FE_UPWARD =
#define FE_UPWARD (3 << 4)
FE_UPWARD
}; };

View File

@ -24,16 +24,21 @@
of the appropriate bits in the FPU control word. */ of the appropriate bits in the FPU control word. */
enum enum
{ {
FE_INEXACT = 0x04, FE_INEXACT =
#define FE_INEXACT FE_INEXACT #define FE_INEXACT 0x04
FE_UNDERFLOW = 0x08, FE_INEXACT,
#define FE_UNDERFLOW FE_UNDERFLOW FE_UNDERFLOW =
FE_OVERFLOW = 0x10, #define FE_UNDERFLOW 0x08
#define FE_OVERFLOW FE_OVERFLOW FE_UNDERFLOW,
FE_DIVBYZERO = 0x20, FE_OVERFLOW =
#define FE_DIVBYZERO FE_DIVBYZERO #define FE_OVERFLOW 0x10
FE_INVALID = 0x40, FE_OVERFLOW,
#define FE_INVALID FE_INVALID FE_DIVBYZERO =
#define FE_DIVBYZERO 0x20
FE_DIVBYZERO,
FE_INVALID =
#define FE_INVALID 0x40
FE_INVALID,
}; };
#define FE_ALL_EXCEPT \ #define FE_ALL_EXCEPT \
@ -44,14 +49,18 @@ enum
for the appropriate macros. */ for the appropriate macros. */
enum enum
{ {
FE_TONEAREST = 0x0, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST 0x0
FE_TOWARDZERO = 0x1, FE_TONEAREST,
#define FE_TOWARDZERO FE_TOWARDZERO FE_TOWARDZERO =
FE_UPWARD = 0x2, #define FE_TOWARDZERO 0x1
#define FE_UPWARD FE_UPWARD FE_TOWARDZERO,
FE_DOWNWARD = 0x3 FE_UPWARD =
#define FE_DOWNWARD FE_DOWNWARD #define FE_UPWARD 0x2
FE_UPWARD,
FE_DOWNWARD =
#define FE_DOWNWARD 0x3
FE_DOWNWARD
}; };

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2011 Free Software Foundation, Inc. /* Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011. Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
@ -30,8 +30,9 @@ enum
{ {
__FE_UNDEFINED = 0, __FE_UNDEFINED = 0,
FE_TONEAREST = 1, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST 1
FE_TONEAREST,
}; };
/* Type representing exception flags (if there were any). */ /* Type representing exception flags (if there were any). */

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1997, 1998, 1999, 2008 Free Software Foundation, Inc. /* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -24,14 +24,18 @@
the appropriate bits in the FPSCR... */ the appropriate bits in the FPSCR... */
enum enum
{ {
FE_INEXACT = 1 << (31 - 6), FE_INEXACT =
#define FE_INEXACT FE_INEXACT #define FE_INEXACT (1 << (31 - 6))
FE_DIVBYZERO = 1 << (31 - 5), FE_INEXACT,
#define FE_DIVBYZERO FE_DIVBYZERO FE_DIVBYZERO =
FE_UNDERFLOW = 1 << (31 - 4), #define FE_DIVBYZERO (1 << (31 - 5))
#define FE_UNDERFLOW FE_UNDERFLOW FE_DIVBYZERO,
FE_OVERFLOW = 1 << (31 - 3), FE_UNDERFLOW =
#define FE_OVERFLOW FE_OVERFLOW #define FE_UNDERFLOW (1 << (31 - 4))
FE_UNDERFLOW,
FE_OVERFLOW =
#define FE_OVERFLOW (1 << (31 - 3))
FE_OVERFLOW,
/* ... except for FE_INVALID, for which we use bit 31. FE_INVALID /* ... except for FE_INVALID, for which we use bit 31. FE_INVALID
actually corresponds to bits 7 through 12 and 21 through 23 actually corresponds to bits 7 through 12 and 21 through 23
@ -39,8 +43,9 @@ enum
says that it must be a power of 2. Instead we use bit 2 which says that it must be a power of 2. Instead we use bit 2 which
is the summary bit for all the FE_INVALID exceptions, which is the summary bit for all the FE_INVALID exceptions, which
kind of makes sense. */ kind of makes sense. */
FE_INVALID = 1 << (31 - 2), FE_INVALID =
#define FE_INVALID FE_INVALID #define FE_INVALID (1 << (31 - 2))
FE_INVALID,
#ifdef __USE_GNU #ifdef __USE_GNU
/* Breakdown of the FE_INVALID bits. Setting FE_INVALID on an /* Breakdown of the FE_INVALID bits. Setting FE_INVALID on an
@ -50,43 +55,52 @@ enum
enable these exceptions individually. */ enable these exceptions individually. */
/* Operation with SNaN. */ /* Operation with SNaN. */
FE_INVALID_SNAN = 1 << (31 - 7), FE_INVALID_SNAN =
# define FE_INVALID_SNAN FE_INVALID_SNAN # define FE_INVALID_SNAN (1 << (31 - 7))
FE_INVALID_SNAN,
/* Inf - Inf */ /* Inf - Inf */
FE_INVALID_ISI = 1 << (31 - 8), FE_INVALID_ISI =
# define FE_INVALID_ISI FE_INVALID_ISI # define FE_INVALID_ISI (1 << (31 - 8))
FE_INVALID_ISI,
/* Inf / Inf */ /* Inf / Inf */
FE_INVALID_IDI = 1 << (31 - 9), FE_INVALID_IDI =
# define FE_INVALID_IDI FE_INVALID_IDI # define FE_INVALID_IDI (1 << (31 - 9))
FE_INVALID_IDI,
/* 0 / 0 */ /* 0 / 0 */
FE_INVALID_ZDZ = 1 << (31 - 10), FE_INVALID_ZDZ =
# define FE_INVALID_ZDZ FE_INVALID_ZDZ # define FE_INVALID_ZDZ (1 << (31 - 10))
FE_INVALID_ZDZ,
/* Inf * 0 */ /* Inf * 0 */
FE_INVALID_IMZ = 1 << (31 - 11), FE_INVALID_IMZ =
# define FE_INVALID_IMZ FE_INVALID_IMZ # define FE_INVALID_IMZ (1 << (31 - 11))
FE_INVALID_IMZ,
/* Comparison with NaN or SNaN. */ /* Comparison with NaN or SNaN. */
FE_INVALID_COMPARE = 1 << (31 - 12), FE_INVALID_COMPARE =
# define FE_INVALID_COMPARE FE_INVALID_COMPARE # define FE_INVALID_COMPARE (1 << (31 - 12))
FE_INVALID_COMPARE,
/* Invalid operation flag for software (not set by hardware). */ /* Invalid operation flag for software (not set by hardware). */
/* Note that some chips don't have this implemented, presumably /* Note that some chips don't have this implemented, presumably
because no-one expected anyone to write software for them %-). */ because no-one expected anyone to write software for them %-). */
FE_INVALID_SOFTWARE = 1 << (31 - 21), FE_INVALID_SOFTWARE =
# define FE_INVALID_SOFTWARE FE_INVALID_SOFTWARE # define FE_INVALID_SOFTWARE (1 << (31 - 21))
FE_INVALID_SOFTWARE,
/* Square root of negative number (including -Inf). */ /* Square root of negative number (including -Inf). */
/* Note that some chips don't have this implemented. */ /* Note that some chips don't have this implemented. */
FE_INVALID_SQRT = 1 << (31 - 22), FE_INVALID_SQRT =
# define FE_INVALID_SQRT FE_INVALID_SQRT # define FE_INVALID_SQRT (1 << (31 - 22))
FE_INVALID_SQRT,
/* Conversion-to-integer of a NaN or a number too large or too small. */ /* Conversion-to-integer of a NaN or a number too large or too small. */
FE_INVALID_INTEGER_CONVERSION = 1 << (31 - 23) FE_INVALID_INTEGER_CONVERSION =
# define FE_INVALID_INTEGER_CONVERSION FE_INVALID_INTEGER_CONVERSION # define FE_INVALID_INTEGER_CONVERSION (1 << (31 - 23))
FE_INVALID_INTEGER_CONVERSION
# define FE_ALL_INVALID \ # define FE_ALL_INVALID \
(FE_INVALID_SNAN | FE_INVALID_ISI | FE_INVALID_IDI | FE_INVALID_ZDZ \ (FE_INVALID_SNAN | FE_INVALID_ISI | FE_INVALID_IDI | FE_INVALID_ZDZ \
@ -103,14 +117,18 @@ enum
appropriate macros. */ appropriate macros. */
enum enum
{ {
FE_TONEAREST = 0, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST 0
FE_TOWARDZERO = 1, FE_TONEAREST,
#define FE_TOWARDZERO FE_TOWARDZERO FE_TOWARDZERO =
FE_UPWARD = 2, #define FE_TOWARDZERO 1
#define FE_UPWARD FE_UPWARD FE_TOWARDZERO,
FE_DOWNWARD = 3 FE_UPWARD =
#define FE_DOWNWARD FE_DOWNWARD #define FE_UPWARD 2
FE_UPWARD,
FE_DOWNWARD =
#define FE_DOWNWARD 3
FE_DOWNWARD
}; };
/* Type representing exception flags. */ /* Type representing exception flags. */

View File

@ -24,16 +24,21 @@
of the appropriate bits in the FPU control word. */ of the appropriate bits in the FPU control word. */
enum enum
{ {
FE_INVALID = 0x80, FE_INVALID =
#define FE_INVALID FE_INVALID #define FE_INVALID 0x80
FE_DIVBYZERO = 0x40, FE_INVALID,
#define FE_DIVBYZERO FE_DIVBYZERO FE_DIVBYZERO =
FE_OVERFLOW = 0x20, #define FE_DIVBYZERO 0x40
#define FE_OVERFLOW FE_OVERFLOW FE_DIVBYZERO,
FE_UNDERFLOW = 0x10, FE_OVERFLOW =
#define FE_UNDERFLOW FE_UNDERFLOW #define FE_OVERFLOW 0x20
FE_INEXACT = 0x08 FE_OVERFLOW,
#define FE_INEXACT FE_INEXACT FE_UNDERFLOW =
#define FE_UNDERFLOW 0x10
FE_UNDERFLOW,
FE_INEXACT =
#define FE_INEXACT 0x08
FE_INEXACT
}; };
/* We dont use the y bit of the DXC in the floating point control register /* We dont use the y bit of the DXC in the floating point control register
as glibc has no FE encoding for fe inexact incremented as glibc has no FE encoding for fe inexact incremented
@ -48,14 +53,18 @@ enum
enum enum
{ {
FE_TONEAREST = 0, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST 0
FE_DOWNWARD = 0x3, FE_TONEAREST,
#define FE_DOWNWARD FE_DOWNWARD FE_DOWNWARD =
FE_UPWARD = 0x2, #define FE_DOWNWARD 0x3
#define FE_UPWARD FE_UPWARD FE_DOWNWARD,
FE_TOWARDZERO = 0x1 FE_UPWARD =
#define FE_TOWARDZERO FE_TOWARDZERO #define FE_UPWARD 0x2
FE_UPWARD,
FE_TOWARDZERO =
#define FE_TOWARDZERO 0x1
FE_TOWARDZERO
}; };

View File

@ -24,16 +24,21 @@
of the appropriate bits in the FPU control word. */ of the appropriate bits in the FPU control word. */
enum enum
{ {
FE_INEXACT = 0x04, FE_INEXACT =
#define FE_INEXACT FE_INEXACT #define FE_INEXACT 0x04
FE_UNDERFLOW = 0x08, FE_INEXACT,
#define FE_UNDERFLOW FE_UNDERFLOW FE_UNDERFLOW =
FE_OVERFLOW = 0x10, #define FE_UNDERFLOW 0x08
#define FE_OVERFLOW FE_OVERFLOW FE_UNDERFLOW,
FE_DIVBYZERO = 0x20, FE_OVERFLOW =
#define FE_DIVBYZERO FE_DIVBYZERO #define FE_OVERFLOW 0x10
FE_INVALID = 0x40, FE_OVERFLOW,
#define FE_INVALID FE_INVALID FE_DIVBYZERO =
#define FE_DIVBYZERO 0x20
FE_DIVBYZERO,
FE_INVALID =
#define FE_INVALID 0x40
FE_INVALID,
}; };
#define FE_ALL_EXCEPT \ #define FE_ALL_EXCEPT \
@ -46,10 +51,12 @@ enum
{ {
__FE_UNDEFINED = -1, __FE_UNDEFINED = -1,
FE_TONEAREST = 0x0, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST 0x0
FE_TOWARDZERO = 0x1, FE_TONEAREST,
#define FE_TOWARDZERO FE_TOWARDZERO FE_TOWARDZERO =
#define FE_TOWARDZERO 0x1
FE_TOWARDZERO,
}; };

View File

@ -26,16 +26,21 @@
of the appropriate accrued exception bits from the FSR. */ of the appropriate accrued exception bits from the FSR. */
enum enum
{ {
FE_INVALID = (1 << 9), FE_INVALID =
#define FE_INVALID FE_INVALID #define FE_INVALID (1 << 9)
FE_OVERFLOW = (1 << 8), FE_INVALID,
#define FE_OVERFLOW FE_OVERFLOW FE_OVERFLOW =
FE_UNDERFLOW = (1 << 7), #define FE_OVERFLOW (1 << 8)
#define FE_UNDERFLOW FE_UNDERFLOW FE_OVERFLOW,
FE_DIVBYZERO = (1 << 6), FE_UNDERFLOW =
#define FE_DIVBYZERO FE_DIVBYZERO #define FE_UNDERFLOW (1 << 7)
FE_INEXACT = (1 << 5) FE_UNDERFLOW,
#define FE_INEXACT FE_INEXACT FE_DIVBYZERO =
#define FE_DIVBYZERO (1 << 6)
FE_DIVBYZERO,
FE_INEXACT =
#define FE_INEXACT (1 << 5)
FE_INEXACT
}; };
#define FE_ALL_EXCEPT \ #define FE_ALL_EXCEPT \
@ -46,14 +51,18 @@ enum
for the appropriate macros. */ for the appropriate macros. */
enum enum
{ {
FE_TONEAREST = (0U << 30), FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST (0 << 30)
FE_TOWARDZERO = (1U << 30), FE_TONEAREST,
#define FE_TOWARDZERO FE_TOWARDZERO FE_TOWARDZERO =
FE_UPWARD = (2U << 30), #define FE_TOWARDZERO (1 << 30)
#define FE_UPWARD FE_UPWARD FE_TOWARDZERO,
FE_DOWNWARD = (3U << 30) FE_UPWARD =
#define FE_DOWNWARD FE_DOWNWARD #define FE_UPWARD (-0x7fffffff - 1) /* (2 << 30) */
FE_UPWARD,
FE_DOWNWARD =
#define FE_DOWNWARD (-0x40000000) /* (3 << 30) */
FE_DOWNWARD
}; };
#define __FE_ROUND_MASK (3U << 30) #define __FE_ROUND_MASK (3U << 30)

View File

@ -23,17 +23,22 @@
of the appropriate bits in the FPU control word. */ of the appropriate bits in the FPU control word. */
enum enum
{ {
FE_INVALID = 0x01, FE_INVALID =
#define FE_INVALID FE_INVALID #define FE_INVALID 0x01
FE_INVALID,
__FE_DENORM = 0x02, __FE_DENORM = 0x02,
FE_DIVBYZERO = 0x04, FE_DIVBYZERO =
#define FE_DIVBYZERO FE_DIVBYZERO #define FE_DIVBYZERO 0x04
FE_OVERFLOW = 0x08, FE_DIVBYZERO,
#define FE_OVERFLOW FE_OVERFLOW FE_OVERFLOW =
FE_UNDERFLOW = 0x10, #define FE_OVERFLOW 0x08
#define FE_UNDERFLOW FE_UNDERFLOW FE_OVERFLOW,
FE_INEXACT = 0x20 FE_UNDERFLOW =
#define FE_INEXACT FE_INEXACT #define FE_UNDERFLOW 0x10
FE_UNDERFLOW,
FE_INEXACT =
#define FE_INEXACT 0x20
FE_INEXACT
}; };
#define FE_ALL_EXCEPT \ #define FE_ALL_EXCEPT \
@ -44,14 +49,18 @@ enum
for the appropriate macros. */ for the appropriate macros. */
enum enum
{ {
FE_TONEAREST = 0, FE_TONEAREST =
#define FE_TONEAREST FE_TONEAREST #define FE_TONEAREST 0
FE_DOWNWARD = 0x400, FE_TONEAREST,
#define FE_DOWNWARD FE_DOWNWARD FE_DOWNWARD =
FE_UPWARD = 0x800, #define FE_DOWNWARD 0x400
#define FE_UPWARD FE_UPWARD FE_DOWNWARD,
FE_TOWARDZERO = 0xc00 FE_UPWARD =
#define FE_TOWARDZERO FE_TOWARDZERO #define FE_UPWARD 0x800
FE_UPWARD,
FE_TOWARDZERO =
#define FE_TOWARDZERO 0xc00
FE_TOWARDZERO
}; };