Add femode_t functions.
[glibc.git] / sysdeps / powerpc / powerpc32 / e500 / nofpu / fenv_const.c
blobeab47c8c0f00aac21fb8654081d743dddbd68fb4
1 /* Constant floating-point environments for e500.
2 Copyright (C) 2004-2016 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 /* The use of "unsigned long long" as the type to define the
20 bit-pattern explicitly, rather than the type "double" used in
21 <bits/fenv.h>, means that we cannot include <fenv_libc.h> here to
22 get the enum constants for the SPEFSCR bits to enable
23 exceptions. */
25 #include <sys/prctl.h>
27 /* If the default argument is used we use this value. */
28 const unsigned long long __fe_dfl_env __attribute__ ((aligned (8))) =
29 0x3cULL;
31 /* The same representation is used for femode_t. */
32 extern const unsigned long long __fe_dfl_mode
33 __attribute__ ((aligned (8), alias ("__fe_dfl_env")));
35 /* Floating-point environment where none of the exceptions are masked. */
36 const unsigned long long __fe_enabled_env __attribute__ ((aligned (8))) =
37 (((unsigned long long) (PR_FP_EXC_DIV
38 | PR_FP_EXC_OVF
39 | PR_FP_EXC_UND
40 | PR_FP_EXC_RES
41 | PR_FP_EXC_INV)) << 32) | 0x7cULL;
43 /* Non-IEEE mode. */
44 const unsigned long long __fe_nonieee_env __attribute__ ((aligned (8))) =
45 0x0ULL;