iPXE
__divmoddi4.c
Go to the documentation of this file.
00001 #include "libgcc.h"
00002 
00003 __libgcc int64_t __divmoddi4(int64_t num, int64_t den, int64 *rem_p)
00004 {
00005   int minus = 0;
00006   int64_t v;
00007 
00008   if ( num < 0 ) {
00009     num = -num;
00010     minus = 1;
00011   }
00012   if ( den < 0 ) {
00013     den = -den;
00014     minus ^= 1;
00015   }
00016 
00017   v = __udivmoddi4(num, den, (uint64_t *)rem_p);
00018   if ( minus ) {
00019     v = -v;
00020     if ( rem_p )
00021       *rem_p = -(*rem_p);
00022   }
00023 
00024   return v;
00025 }