aboutsummaryrefslogtreecommitdiff
path: root/gcc/longlong.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-11-27 18:56:10 +0000
committerNick Clifton <nickc@gcc.gnu.org>2009-11-27 18:56:10 +0000
commitba96438334721b0d48bf9a1413a6c0963ddbd30f (patch)
treec9d56ccf47b4f1ac9b76b795492e4508065b5dae /gcc/longlong.h
parentc7f06e130978925eec2f188d7d2f3ec9b378e8ac (diff)
downloadgcc-ba96438334721b0d48bf9a1413a6c0963ddbd30f.zip
gcc-ba96438334721b0d48bf9a1413a6c0963ddbd30f.tar.gz
gcc-ba96438334721b0d48bf9a1413a6c0963ddbd30f.tar.bz2
stormy16-lib2.c: Arrange for separate compilation of each function.
* 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. From-SVN: r154713
Diffstat (limited to 'gcc/longlong.h')
-rw-r--r--gcc/longlong.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/longlong.h b/gcc/longlong.h
index 11e7013..e1f8b35 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" \