diff options
author | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-27 18:56:10 +0000 |
---|---|---|
committer | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-27 18:56:10 +0000 |
commit | 8fd2730b9dbe6864edfc7a3ea197c02a76c153eb (patch) | |
tree | c9d56ccf47b4f1ac9b76b795492e4508065b5dae /gcc/longlong.h | |
parent | 653c1b49a762d971eb3827435ae6173591ce7929 (diff) | |
download | gcc-8fd2730b9dbe6864edfc7a3ea197c02a76c153eb.tar.gz |
* config/stormy16/stormy16-lib2.c: Arrange for separate
compilation of each function.
(__ffshi2): New function.
(__stormy16_count_leading_zeros): New function.
* config/stormy16/t-stormy16 (LIB2FUNCS_EXTRA): Use stub files to
compile each function into its own object file.
(stormy16-lib2-ashlsi3.c): New stub file.
(stormy16-lib2-ashrsi3.c): New stub file.
(stormy16-lib2-clzhi2.c): New stub file.
(stormy16-lib2-count-leading-zeros.c): New stub file.
(stormy16-lib2-ctzhi2.c): New stub file.
(stormy16-lib2-divsi3.c): New stub file.
(stormy16-lib2-ffshi2.c): New stub file.
(stormy16-lib2-lshrsi3.c): New stub file.
(stormy16-lib2-modsi3.c): New stub file.
(stormy16-lib2-parityhi2.c): New stub file.
(stormy16-lib2-popcounthi2.c): New stub file.
(stormy16-lib2-udivmodsi4.c): New stub file.
(stormy16-lib2-udivsi3.c): New stub file.
(stormy16-lib2-umodsi3.c): New stub file.
* longlong.h (count_leading_zeros): Define macro for stormy16
target.
(COUNT_LEADING_ZEROS_0): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154713 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/longlong.h')
-rw-r--r-- | gcc/longlong.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/longlong.h b/gcc/longlong.h index 11e70139957..e1f8b359881 100644 --- a/gcc/longlong.h +++ b/gcc/longlong.h @@ -1324,6 +1324,28 @@ UDItype __umulsidi3 (USItype, USItype); #define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctz (X)) #endif /* __xtensa__ */ +#if defined xstormy16 +extern UHItype __stormy16_count_leading_zeros (UHItype); +#define count_leading_zeros(count, x) \ + do \ + { \ + UHItype size; \ + \ + /* We assume that W_TYPE_SIZE is a multiple of 16... */ \ + for ((count) = 0, size = W_TYPE_SIZE; size; size -= 16) \ + { \ + UHItype c; \ + \ + c = __stormy16_count_leading_zeros ((x) >> (size - 16)); \ + (count) += c; \ + if (c != 16) \ + break; \ + } \ + } \ + while (0) +#define COUNT_LEADING_ZEROS_0 W_TYPE_SIZE +#endif + #if defined (__z8000__) && W_TYPE_SIZE == 16 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ __asm__ ("add %H1,%H5\n\tadc %H0,%H3" \ |