Displaying 1 result from an estimated 1 matches for "__builtin_labs".
Did you mean:
__builtin_abs
2004 Jun 23
4
CRIS port of klibc
...long a, long b) __attribute__ ((__const__));
+
+long
+__Div (long a, long b)
+{
+ long sign;
+ long result;
+
+ /* Do *not* call do_31div since abs (-2147483648) == 2147483648
+ <=> abs (-0x80000000) == 0x80000000
+ which is still 32 bits. */
+
+ sign = a ^ b;
+ result = __Udiv (__builtin_labs (a), __builtin_labs (b));
+
+ return (sign < 0) ? -result : result;
+}
+
+
+/* Note that unsigned and signed modulus both build when L_modsi3, but
+ then the unsigned variant is inlined, as with do_31div above. */
+unsigned long
+__Umod (unsigned long a, unsigned long b)
+ __attribute__...