iPXE
Functions
__divmoddi4.c File Reference
#include "libgcc.h"

Go to the source code of this file.

Functions

__libgcc int64_t __divmoddi4 (int64_t num, int64_t den, int64_t *rem_p)
 

Function Documentation

◆ __divmoddi4()

__libgcc int64_t __divmoddi4 ( int64_t  num,
int64_t  den,
int64_t rem_p 
)

Definition at line 3 of file __divmoddi4.c.

4 {
5  int minus = 0;
6  int64_t v;
7 
8  if ( num < 0 ) {
9  num = -num;
10  minus = 1;
11  }
12  if ( den < 0 ) {
13  den = -den;
14  minus ^= 1;
15  }
16 
17  v = __udivmoddi4(num, den, (uint64_t *)rem_p);
18  if ( minus ) {
19  v = -v;
20  if ( rem_p )
21  *rem_p = -(*rem_p);
22  }
23 
24  return v;
25 }
unsigned long long uint64_t
Definition: stdint.h:13
uint32_t num
Definition: multiboot.h:12
signed long long int64_t
Definition: stdint.h:18
__libgcc uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem_p)
Definition: __udivmoddi4.c:3

References __udivmoddi4(), and num.

Referenced by __divdi3(), and __moddi3().