Debian Codegraph @

libgcc/config/sh/sfp-machine.h

raw
1 /* Software floating-point machine description for SuperH.
2
3 Copyright (C) 2024-2025 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
20
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
25
26 #define _FP_W_TYPE_SIZE 32
27 #define _FP_W_TYPE unsigned long
28 #define _FP_WS_TYPE signed long
29 #define _FP_I_TYPE long
30
31 #define _FP_MUL_MEAT_S(R,X,Y) \
32 _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
33 #define _FP_MUL_MEAT_D(R,X,Y) \
34 _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
35 #define _FP_MUL_MEAT_Q(R,X,Y) \
36 _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
37
38 #define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(S,R,X,Y)
39 #define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
40 #define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
41
42 #define _FP_NANFRAC_B _FP_QNANBIT_B
43 #define _FP_NANFRAC_H _FP_QNANBIT_H
44 #define _FP_NANFRAC_S _FP_QNANBIT_S
45 #define _FP_NANFRAC_D _FP_QNANBIT_D, 0
46 #define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0, 0, 0
47
48 /* The type of the result of a floating point comparison. This must
49 match __libgcc_cmp_return__ in GCC for the target. */
50 typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
51 #define CMPtype __gcc_CMPtype
52
53 #define _FP_NANSIGN_B 0
54 #define _FP_NANSIGN_H 0
55 #define _FP_NANSIGN_S 0
56 #define _FP_NANSIGN_D 0
57 #define _FP_NANSIGN_Q 0
58
59 #define _FP_KEEPNANFRACP 0
60 #define _FP_QNANNEGATEDP 0
61
62 #define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
63 do { \
64 R##_s = _FP_NANSIGN_##fs; \
65 _FP_FRAC_SET_##wc(R,_FP_NANFRAC_##fs); \
66 R##_c = FP_CLS_NAN; \
67 } while (0)
68
69 #define _FP_TININESS_AFTER_ROUNDING 1
70
71 #define __LITTLE_ENDIAN 1234
72 #define __BIG_ENDIAN 4321
73
74 #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
75 #define __BYTE_ORDER __BIG_ENDIAN
76 #else
77 #define __BYTE_ORDER __LITTLE_ENDIAN
78 #endif
79
80 /* Define ALIASNAME as a strong alias for NAME. */
81 # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
82 # define _strong_alias(name, aliasname) \
83 extern __typeof (name) aliasname __attribute__ ((alias (#name)));