1 /* 2 * arch/i386/libgcc/__moddi3.c 3 */ 4 5 #include "libgcc.h" 6 7 __libgcc int64_t __moddi3(int64_t num, int64_t den) 8 { 9 int minus = 0; 10 int64_t v; 11 12 if ( num < 0 ) { 13 num = -num; 14 minus = 1; 15 } 16 if ( den < 0 ) { 17 den = -den; 18 minus ^= 1; 19 } 20 21 (void) __udivmoddi4(num, den, (uint64_t *)&v); 22 if ( minus ) 23 v = -v; 24 25 return v; 26 } 27