decExcept.c revision 1.6
1268899Sbapt/* Temporary library support for decimal floating point.
2234949Sbapt   Copyright (C) 2005-2018 Free Software Foundation, Inc.
3234949Sbapt
4234949Sbapt   This file is part of GCC.
5234949Sbapt
6234949Sbapt   GCC is free software; you can redistribute it and/or modify it
7234949Sbapt   under the terms of the GNU General Public License as published by
8234949Sbapt   the Free Software Foundation; either version 3, or (at your option)
9234949Sbapt   any later version.
10234949Sbapt
11234949Sbapt   GCC is distributed in the hope that it will be useful, but WITHOUT
12234949Sbapt   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13234949Sbapt   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
14234949Sbapt   License for more details.
15234949Sbapt
16234949SbaptUnder Section 7 of GPL version 3, you are granted additional
17234949Sbaptpermissions described in the GCC Runtime Library Exception, version
18234949Sbapt3.1, as published by the Free Software Foundation.
19234949Sbapt
20234949SbaptYou should have received a copy of the GNU General Public License and
21234949Sbapta copy of the GCC Runtime Library Exception along with this program;
22234949Sbaptsee the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23234949Sbapt<http://www.gnu.org/licenses/>.  */
24234949Sbapt
25234949Sbapt#include <fenv.h>
26234949Sbapt#include "dconfig.h"
27234949Sbapt#include "decContext.h"
28234949Sbapt#include "decExcept.h"
29234949Sbapt
30234949Sbapt/* Internal, non-documented functions for testing libgcc functions.
31234949Sbapt   This support is not sufficient for real use.  */
32234949Sbapt
33234949Sbaptstatic int __dfp_except_flags = 0;
34234949Sbapt
35234949Sbapt/* Clear the dummy exception flags.  */
36234949Sbaptvoid
37234949Sbapt__dfp_clear_except (void)
38234949Sbapt{
39234949Sbapt  __dfp_except_flags = 0;
40234949Sbapt}
41234949Sbapt
42234949Sbapt/* Return the dummy exception flags corresponding to the mask.  */
43234949Sbaptint
44234949Sbapt__dfp_test_except (int mask)
45268899Sbapt{
46234949Sbapt  return __dfp_except_flags & mask;
47268899Sbapt}
48234949Sbapt
49234949Sbapt/* Set dummy exception flags.  */
50234949Sbaptvoid
51234949Sbapt__dfp_raise_except (int flags)
52234949Sbapt{
53234949Sbapt  __dfp_except_flags |= flags;
54234949Sbapt}
55234949Sbapt