]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgcc/config/hardfp.c
Update copyright years.
[thirdparty/gcc.git] / libgcc / config / hardfp.c
CommitLineData
1c51d688 1/* Dummy floating-point routines for hard-float code.
99dee823 2 Copyright (C) 2014-2021 Free Software Foundation, Inc.
1c51d688
RS
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16Under Section 7 of GPL version 3, you are granted additional
17permissions described in the GCC Runtime Library Exception, version
183.1, as published by the Free Software Foundation.
19
20You should have received a copy of the GNU General Public License and
21a copy of the GCC Runtime Library Exception along with this program;
22see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23<http://www.gnu.org/licenses/>. */
24
25#define sf float
26#define df double
27
28#if defined (OP_add3)
29TYPE FUNC (TYPE x, TYPE y) { return x + y; }
30#elif defined (OP_sub3)
31TYPE FUNC (TYPE x, TYPE y) { return x - y; }
32#elif defined (OP_neg2)
33TYPE FUNC (TYPE x) { return -x; }
34#elif defined (OP_mul3)
35TYPE FUNC (TYPE x, TYPE y) { return x * y; }
36#elif defined (OP_div3)
37TYPE FUNC (TYPE x, TYPE y) { return x / y; }
38#elif defined (OP_eq2) || defined (OP_ne2)
39int FUNC (TYPE x, TYPE y) { return x == y ? 0 : 1; }
40#elif defined (OP_ge2)
41int FUNC (TYPE x, TYPE y) { return x >= y ? 0 : -1; }
42#elif defined (OP_gt2)
43int FUNC (TYPE x, TYPE y) { return x > y ? 1 : 0; }
44#elif defined (OP_le2)
45int FUNC (TYPE x, TYPE y) { return x <= y ? 0 : 1; }
46#elif defined (OP_lt2)
47int FUNC (TYPE x, TYPE y) { return x < y ? -1 : 0; }
48#elif defined (OP_unord2)
49int FUNC (TYPE x, TYPE y) { return __builtin_isunordered (x, y); }
50#elif defined (OP_fixsi)
51int FUNC (TYPE x) { return (int) x; }
52#elif defined (OP_floatsi)
53TYPE FUNC (int x) { return (TYPE) x; }
54#elif defined (OP_floatunsi)
55TYPE FUNC (unsigned int x) { return (TYPE) x; }
56#elif defined (OP_extendsf2)
57TYPE FUNC (float x) { return (TYPE) x; }
58#elif defined (OP_truncdf2)
59TYPE FUNC (double x) { return (TYPE) x; }
60#else
61#error Unknown operation
62#endif