]>
Commit | Line | Data |
---|---|---|
1c51d688 | 1 | /* Dummy floating-point routines for hard-float code. |
a5544970 | 2 | Copyright (C) 2014-2019 Free Software Foundation, Inc. |
1c51d688 RS |
3 | |
4 | This file is part of GCC. | |
5 | ||
6 | GCC is free software; you can redistribute it and/or modify it under | |
7 | the terms of the GNU General Public License as published by the Free | |
8 | Software Foundation; either version 3, or (at your option) any later | |
9 | version. | |
10 | ||
11 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | for more details. | |
15 | ||
16 | Under Section 7 of GPL version 3, you are granted additional | |
17 | permissions described in the GCC Runtime Library Exception, version | |
18 | 3.1, as published by the Free Software Foundation. | |
19 | ||
20 | You should have received a copy of the GNU General Public License and | |
21 | a copy of the GCC Runtime Library Exception along with this program; | |
22 | see 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) | |
29 | TYPE FUNC (TYPE x, TYPE y) { return x + y; } | |
30 | #elif defined (OP_sub3) | |
31 | TYPE FUNC (TYPE x, TYPE y) { return x - y; } | |
32 | #elif defined (OP_neg2) | |
33 | TYPE FUNC (TYPE x) { return -x; } | |
34 | #elif defined (OP_mul3) | |
35 | TYPE FUNC (TYPE x, TYPE y) { return x * y; } | |
36 | #elif defined (OP_div3) | |
37 | TYPE FUNC (TYPE x, TYPE y) { return x / y; } | |
38 | #elif defined (OP_eq2) || defined (OP_ne2) | |
39 | int FUNC (TYPE x, TYPE y) { return x == y ? 0 : 1; } | |
40 | #elif defined (OP_ge2) | |
41 | int FUNC (TYPE x, TYPE y) { return x >= y ? 0 : -1; } | |
42 | #elif defined (OP_gt2) | |
43 | int FUNC (TYPE x, TYPE y) { return x > y ? 1 : 0; } | |
44 | #elif defined (OP_le2) | |
45 | int FUNC (TYPE x, TYPE y) { return x <= y ? 0 : 1; } | |
46 | #elif defined (OP_lt2) | |
47 | int FUNC (TYPE x, TYPE y) { return x < y ? -1 : 0; } | |
48 | #elif defined (OP_unord2) | |
49 | int FUNC (TYPE x, TYPE y) { return __builtin_isunordered (x, y); } | |
50 | #elif defined (OP_fixsi) | |
51 | int FUNC (TYPE x) { return (int) x; } | |
52 | #elif defined (OP_floatsi) | |
53 | TYPE FUNC (int x) { return (TYPE) x; } | |
54 | #elif defined (OP_floatunsi) | |
55 | TYPE FUNC (unsigned int x) { return (TYPE) x; } | |
56 | #elif defined (OP_extendsf2) | |
57 | TYPE FUNC (float x) { return (TYPE) x; } | |
58 | #elif defined (OP_truncdf2) | |
59 | TYPE FUNC (double x) { return (TYPE) x; } | |
60 | #else | |
61 | #error Unknown operation | |
62 | #endif |