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