+2012-08-01 Nick Clifton <nickc@redhat.com>
+
+ * config/m32c/lib2funcs.c (__clrsbhi2): New function.
+ Implements __clrsb for an HImode argument.
+
2012-07-31 Nick Clifton <nickc@redhat.com>
* config/stormy16/lib2funcs.c (__clrsbhi2): New function.
/* libgcc routines for R8C/M16C/M32C
- Copyright (C) 2005, 2009
+ Copyright (C) 2005, 2009, 2012
Free Software Foundation, Inc.
Contributed by Red Hat.
{
return udivmodsi4 (a, b, 1);
}
+
+/* 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 (word_type x)
+{
+ if (x < 0)
+ x = ~x;
+ if (x == 0)
+ return 15;
+ return __builtin_clz (x) - 1;
+}