8d9254fc8a
From-SVN: r279813
126 lines
4.4 KiB
C
126 lines
4.4 KiB
C
/* Soft-FP definitions for TI PRU.
|
|
Copyright (C) 2010-2020 Free Software Foundation, Inc.
|
|
Based on C6X soft-fp header.
|
|
|
|
This files is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
In addition to the permissions in the GNU Lesser General Public
|
|
License, the Free Software Foundation gives you unlimited
|
|
permission to link the compiled version of this file into
|
|
combinations with other programs, and to distribute those
|
|
combinations without any restriction coming from the use of this
|
|
file. (The Lesser General Public License restrictions do apply in
|
|
other respects; for example, they cover modification of the file,
|
|
and distribution when not linked into a combine executable.)
|
|
|
|
This file is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with GCC; see the file COPYING.LIB. If not see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
#define _FP_W_TYPE_SIZE 32
|
|
#define _FP_W_TYPE unsigned long
|
|
#define _FP_WS_TYPE signed long
|
|
#define _FP_I_TYPE long
|
|
|
|
#define _FP_MUL_MEAT_S(R,X,Y) \
|
|
_FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
|
|
#define _FP_MUL_MEAT_D(R,X,Y) \
|
|
_FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
|
|
#define _FP_MUL_MEAT_Q(R,X,Y) \
|
|
_FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
|
|
|
|
#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y)
|
|
#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
|
|
#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
|
|
|
|
#define _FP_NANFRAC_H ((_FP_QNANBIT_H << 1) - 1)
|
|
#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
|
|
#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
|
|
#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
|
|
#define _FP_NANSIGN_H 0
|
|
#define _FP_NANSIGN_S 0
|
|
#define _FP_NANSIGN_D 0
|
|
#define _FP_NANSIGN_Q 0
|
|
|
|
#define _FP_KEEPNANFRACP 1
|
|
#define _FP_QNANNEGATEDP 0
|
|
|
|
/* Someone please check this. */
|
|
#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
|
|
do { \
|
|
if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
|
|
&& !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
|
|
{ \
|
|
R##_s = Y##_s; \
|
|
_FP_FRAC_COPY_##wc(R,Y); \
|
|
} \
|
|
else \
|
|
{ \
|
|
R##_s = X##_s; \
|
|
_FP_FRAC_COPY_##wc(R,X); \
|
|
} \
|
|
R##_c = FP_CLS_NAN; \
|
|
} while (0)
|
|
|
|
#define __LITTLE_ENDIAN 1234
|
|
#define __BIG_ENDIAN 4321
|
|
|
|
#if defined _BIG_ENDIAN
|
|
# define __BYTE_ORDER __BIG_ENDIAN
|
|
#else
|
|
# define __BYTE_ORDER __LITTLE_ENDIAN
|
|
#endif
|
|
|
|
/* Not checked. */
|
|
#define _FP_TININESS_AFTER_ROUNDING 0
|
|
|
|
|
|
/* Define ALIASNAME as a strong alias for NAME. */
|
|
# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
|
|
# define _strong_alias(name, aliasname) \
|
|
extern __typeof (name) aliasname __attribute__ ((alias (#name)));
|
|
|
|
/* Rename helper functions to the names specified in the PRU ELF ABI. */
|
|
#define __fixdfsi __pruabi_fixdi
|
|
#define __fixsfsi __pruabi_fixfi
|
|
#define __floatsidf __pruabi_fltid
|
|
#define __floatunsidf __pruabi_fltud
|
|
#define __floatsisf __pruabi_fltif
|
|
#define __floatunsisf __pruabi_fltuf
|
|
#define __truncdfsf2 __pruabi_cvtdf
|
|
#define __extendsfdf2 __pruabi_cvtfd
|
|
#define __adddf3 __pruabi_addd
|
|
#define __subdf3 __pruabi_subd
|
|
#define __muldf3 __pruabi_mpyd
|
|
#define __divdf3 __pruabi_divd
|
|
#define __negdf2 __pruabi_negd
|
|
#define __absdf2 __pruabi_absd
|
|
#define __addsf3 __pruabi_addf
|
|
#define __subsf3 __pruabi_subf
|
|
#define __mulsf3 __pruabi_mpyf
|
|
#define __divsf3 __pruabi_divf
|
|
#define __negsf2 __pruabi_negf
|
|
#define __abssf2 __pruabi_absf
|
|
#define __lesf2 __pruabi_cmpf
|
|
#define __ledf2 __pruabi_cmpd
|
|
#define __ltsf2 __gnu_ltsf2
|
|
#define __ltdf2 __gnu_ltdf2
|
|
#define __gesf2 __gnu_gesf2
|
|
#define __gedf2 __gnu_gedf2
|
|
#define __gtsf2 __gnu_gtsf2
|
|
#define __gtdf2 __gnu_gtdf2
|
|
#define __eqsf2 __gnu_eqsf2
|
|
#define __eqdf2 __gnu_eqdf2
|
|
#define __nesf2 __pruabi_neqf
|
|
#define __nedf2 __pruabi_neqd
|
|
#define __unordsf2 __pruabi_unordf
|
|
#define __unorddf2 __pruabi_unordd
|