lib2funcs.c (__clrsbhi2): New function.

* config/stormy16/lib2funcs.c (__clrsbhi2): New function.
	Implements __clrsb for an HImode argument.
	* config/stormy16/clrsbhi2.c: New file:
	* config/stormy16/t-stormy16 (LIB2ADD): Add clrsbhi2.c.

From-SVN: r189997
This commit is contained in:
Nick Clifton 2012-07-31 09:09:29 +00:00 committed by Nick Clifton
parent d555a90ebe
commit 0d13c974d9
4 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2012-07-31 Nick Clifton <nickc@redhat.com>
* config/stormy16/lib2funcs.c (__clrsbhi2): New function.
Implements __clrsb for an HImode argument.
* config/stormy16/clrsbhi2.c: New file:
* config/stormy16/t-stormy16 (LIB2ADD): Add clrsbhi2.c.
2012-07-22 Steven Bosscher <steven@gcc.gnu.org>
* libgcov.c (__gcov_ior_profiler): Benign comment fix.

View File

@ -0,0 +1,2 @@
#define XSTORMY16_CLRSBHI2
#include "lib2funcs.c"

View File

@ -311,6 +311,22 @@ __ffshi2 (UHWtype u)
}
#endif
#ifdef XSTORMY16_CLRSBHI2
/* Returns the number of leading redundant sign bits in X.
I.e. the number of bits following the most significant bit which are
identical to it. There are no special cases for 0 or other values. */
int
__clrsbhi2 (HWtype x)
{
if (x < 0)
x = ~x;
if (x == 0)
return 15;
return __builtin_clz (x) - 1;
}
#endif
#ifdef XSTORMY16_UCMPSI2
/* Performs an unsigned comparison of two 32-bit values: A and B.
If A is less than B, then 0 is returned. If A is greater than B,

View File

@ -33,6 +33,7 @@ LIB2ADD = \
$(srcdir)/config/stormy16/clzhi2.c \
$(srcdir)/config/stormy16/ctzhi2.c \
$(srcdir)/config/stormy16/ffshi2.c \
$(srcdir)/config/stormy16/clrsbhi2.c \
$(srcdir)/config/stormy16/cmpsi2.c \
$(srcdir)/config/stormy16/ucmpsi2.c