diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2013-10-16 01:43:14 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2013-10-16 01:43:14 +0000 |
commit | 0e499e759cbc393de610e7023c483d0ca0a8a7b0 (patch) | |
tree | c5d3a341da560ba98e56324e917e4ecf6c089531 /libgcc/longlong.h | |
parent | b82d0df95b6592adfb3f8c4872fdad41c513e7c5 (diff) | |
download | gcc-0e499e759cbc393de610e7023c483d0ca0a8a7b0.zip gcc-0e499e759cbc393de610e7023c483d0ca0a8a7b0.tar.gz gcc-0e499e759cbc393de610e7023c483d0ca0a8a7b0.tar.bz2 |
For CRIS ports, switch to soft-fp. Improve arit.c and longlong.h.
* config.host (cpu_type) <Setting default>: Add entry for
crisv32-*-*.
(tmake_file) <crisv32-*-elf, cris-*-elf, cris-*-linux*>
<crisv32-*-linux*>: Adjust.
* longlong.h: Wrap the whole CRIS section in a single
defined(__CRIS__) conditional. Add comment about add_ssaaaa
and sub_ddmmss.
(COUNT_LEADING_ZEROS_0): Define when count_leading_zeros is
defined.
[__CRIS__] (__umulsidi3): Define.
[__CRIS__] (umul_ppmm): Define in terms of __umulsidi3.
* config/cris/sfp-machine.h: New file.
* config/cris/umulsidi3.S: New file.
* config/cris/t-elfmulti (LIB2ADD_ST): Add umulsidi3.S.
* config/cris/arit.c (SIGNMULT): New macro.
(__Div, __Mod): Use SIGNMULT instead of naked multiplication.
* config/cris/mulsi3.S: Tweak to avoid redundant register-copying;
saving 3 out of originally 33 cycles from the fastest
path, 3 out of 54 from the medium path and one from the longest
path. Improve comments.
From-SVN: r203640
Diffstat (limited to 'libgcc/longlong.h')
-rw-r--r-- | libgcc/longlong.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/libgcc/longlong.h b/libgcc/longlong.h index 4fbfbae..5f00e54 100644 --- a/libgcc/longlong.h +++ b/libgcc/longlong.h @@ -289,12 +289,39 @@ extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDItype, UDItype); #endif /* defined (__AVR__) */ -#if defined (__CRIS__) && __CRIS_arch_version >= 3 +#if defined (__CRIS__) + +#if __CRIS_arch_version >= 3 #define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clz (X)) +#define COUNT_LEADING_ZEROS_0 32 +#endif /* __CRIS_arch_version >= 3 */ + #if __CRIS_arch_version >= 8 #define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctz (X)) -#endif -#endif /* __CRIS__ */ +#endif /* __CRIS_arch_version >= 8 */ + +#if __CRIS_arch_version >= 10 +#define __umulsidi3(u,v) ((UDItype)(USItype) (u) * (UDItype)(USItype) (v)) +#else +#define __umulsidi3 __umulsidi3 +extern UDItype __umulsidi3 (USItype, USItype); +#endif /* __CRIS_arch_version >= 10 */ + +#define umul_ppmm(w1, w0, u, v) \ + do { \ + UDItype __x = __umulsidi3 (u, v); \ + (w0) = (USItype) (__x); \ + (w1) = (USItype) (__x >> 32); \ + } while (0) + +/* FIXME: defining add_ssaaaa and sub_ddmmss should be advantageous for + DFmode ("double" intrinsics, avoiding two of the three insns handling + carry), but defining them as open-code C composing and doing the + operation in DImode (UDImode) shows that the DImode needs work: + register pressure from requiring neighboring registers and the + traffic to and from them come to dominate, in the 4.7 series. */ + +#endif /* defined (__CRIS__) */ #if defined (__hppa) && W_TYPE_SIZE == 32 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ |