1 1.1 mrg /* Soft-FP definitions for TI C6X. 2 1.1.1.11 mrg Copyright (C) 2010-2024 Free Software Foundation, Inc. 3 1.1 mrg 4 1.1 mrg This files is free software; you can redistribute it and/or 5 1.1 mrg modify it under the terms of the GNU Lesser General Public 6 1.1 mrg License as published by the Free Software Foundation; either 7 1.1 mrg version 2.1 of the License, or (at your option) any later version. 8 1.1 mrg 9 1.1 mrg In addition to the permissions in the GNU Lesser General Public 10 1.1 mrg License, the Free Software Foundation gives you unlimited 11 1.1 mrg permission to link the compiled version of this file into 12 1.1 mrg combinations with other programs, and to distribute those 13 1.1 mrg combinations without any restriction coming from the use of this 14 1.1 mrg file. (The Lesser General Public License restrictions do apply in 15 1.1 mrg other respects; for example, they cover modification of the file, 16 1.1 mrg and distribution when not linked into a combine executable.) 17 1.1 mrg 18 1.1 mrg This file is distributed in the hope that it will be useful, 19 1.1 mrg but WITHOUT ANY WARRANTY; without even the implied warranty of 20 1.1 mrg MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 1.1 mrg Lesser General Public License for more details. 22 1.1 mrg 23 1.1 mrg You should have received a copy of the GNU Lesser General Public 24 1.1 mrg License along with GCC; see the file COPYING.LIB. If not see 25 1.1 mrg <http://www.gnu.org/licenses/>. */ 26 1.1 mrg 27 1.1 mrg #define _FP_W_TYPE_SIZE 32 28 1.1 mrg #define _FP_W_TYPE unsigned long 29 1.1 mrg #define _FP_WS_TYPE signed long 30 1.1 mrg #define _FP_I_TYPE long 31 1.1 mrg 32 1.1 mrg #define _FP_MUL_MEAT_S(R,X,Y) \ 33 1.1 mrg _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm) 34 1.1 mrg #define _FP_MUL_MEAT_D(R,X,Y) \ 35 1.1 mrg _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm) 36 1.1 mrg #define _FP_MUL_MEAT_Q(R,X,Y) \ 37 1.1 mrg _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm) 38 1.1 mrg 39 1.1 mrg #define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y) 40 1.1 mrg #define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y) 41 1.1 mrg #define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y) 42 1.1 mrg 43 1.1 mrg #define _FP_NANFRAC_H ((_FP_QNANBIT_H << 1) - 1) 44 1.1 mrg #define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1) 45 1.1 mrg #define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1 46 1.1 mrg #define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1 47 1.1 mrg #define _FP_NANSIGN_H 0 48 1.1 mrg #define _FP_NANSIGN_S 0 49 1.1 mrg #define _FP_NANSIGN_D 0 50 1.1 mrg #define _FP_NANSIGN_Q 0 51 1.1 mrg 52 1.1 mrg #define _FP_KEEPNANFRACP 1 53 1.1.1.2 mrg #define _FP_QNANNEGATEDP 0 54 1.1 mrg 55 1.1 mrg /* Someone please check this. */ 56 1.1 mrg #define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \ 57 1.1 mrg do { \ 58 1.1 mrg if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \ 59 1.1 mrg && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \ 60 1.1 mrg { \ 61 1.1 mrg R##_s = Y##_s; \ 62 1.1 mrg _FP_FRAC_COPY_##wc(R,Y); \ 63 1.1 mrg } \ 64 1.1 mrg else \ 65 1.1 mrg { \ 66 1.1 mrg R##_s = X##_s; \ 67 1.1 mrg _FP_FRAC_COPY_##wc(R,X); \ 68 1.1 mrg } \ 69 1.1 mrg R##_c = FP_CLS_NAN; \ 70 1.1 mrg } while (0) 71 1.1 mrg 72 1.1 mrg #define __LITTLE_ENDIAN 1234 73 1.1 mrg #define __BIG_ENDIAN 4321 74 1.1 mrg 75 1.1 mrg #if defined _BIG_ENDIAN 76 1.1 mrg # define __BYTE_ORDER __BIG_ENDIAN 77 1.1 mrg #else 78 1.1 mrg # define __BYTE_ORDER __LITTLE_ENDIAN 79 1.1 mrg #endif 80 1.1 mrg 81 1.1.1.2 mrg /* Not checked. */ 82 1.1.1.2 mrg #define _FP_TININESS_AFTER_ROUNDING 0 83 1.1.1.2 mrg 84 1.1 mrg 85 1.1 mrg /* Define ALIASNAME as a strong alias for NAME. */ 86 1.1 mrg # define strong_alias(name, aliasname) _strong_alias(name, aliasname) 87 1.1 mrg # define _strong_alias(name, aliasname) \ 88 1.1 mrg extern __typeof (name) aliasname __attribute__ ((alias (#name))); 89 1.1 mrg 90 1.1 mrg /* Rename helper functions to the names specified in the C6000 ELF ABI. */ 91 1.1 mrg #define __fixdfsi __c6xabi_fixdi 92 1.1 mrg #define __fixsfsi __c6xabi_fixfi 93 1.1 mrg #define __floatsidf __c6xabi_fltid 94 1.1 mrg #define __floatunsidf __c6xabi_fltud 95 1.1 mrg #define __floatsisf __c6xabi_fltif 96 1.1 mrg #define __floatunsisf __c6xabi_fltuf 97 1.1 mrg #define __truncdfsf2 __c6xabi_cvtdf 98 1.1 mrg #define __extendsfdf2 __c6xabi_cvtfd 99 1.1 mrg #define __adddf3 __c6xabi_addd 100 1.1 mrg #define __subdf3 __c6xabi_subd 101 1.1 mrg #define __muldf3 __c6xabi_mpyd 102 1.1 mrg #define __divdf3 __c6xabi_divd 103 1.1 mrg #define __negdf2 __c6xabi_negd 104 1.1 mrg #define __absdf2 __c6xabi_absd 105 1.1 mrg #define __addsf3 __c6xabi_addf 106 1.1 mrg #define __subsf3 __c6xabi_subf 107 1.1 mrg #define __mulsf3 __c6xabi_mpyf 108 1.1 mrg #define __divsf3 __c6xabi_divf 109 1.1 mrg #define __negsf2 __c6xabi_negf 110 1.1 mrg #define __abssf2 __c6xabi_absf 111 1.1 mrg #define __lesf2 __c6xabi_cmpf 112 1.1 mrg #define __ledf2 __c6xabi_cmpd 113 1.1 mrg #define __ltsf2 __gnu_ltsf2 114 1.1 mrg #define __ltdf2 __gnu_ltdf2 115 1.1 mrg #define __gesf2 __gnu_gesf2 116 1.1 mrg #define __gedf2 __gnu_gedf2 117 1.1 mrg #define __gtsf2 __gnu_gtsf2 118 1.1 mrg #define __gtdf2 __gnu_gtdf2 119 1.1 mrg #define __eqsf2 __gnu_eqsf2 120 1.1 mrg #define __eqdf2 __gnu_eqdf2 121 1.1 mrg #define __nesf2 __c6xabi_neqf 122 1.1 mrg #define __nedf2 __c6xabi_neqd 123 1.1 mrg #define __unordsf2 __c6xabi_unordf 124 1.1 mrg #define __unorddf2 __c6xabi_unordd 125