OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [config/] [divmod.c] - Blame information for rev 247

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
long udivmodsi4 ();
2
 
3
long
4
__divsi3 (long a, long b)
5
{
6
  int neg = 0;
7
  long res;
8
 
9
  if (a < 0)
10
    {
11
      a = -a;
12
      neg = !neg;
13
    }
14
 
15
  if (b < 0)
16
    {
17
      b = -b;
18
      neg = !neg;
19
    }
20
 
21
  res = udivmodsi4 (a, b, 0);
22
 
23
  if (neg)
24
    res = -res;
25
 
26
  return res;
27
}
28
 
29
long
30
__modsi3 (long a, long b)
31
{
32
  int neg = 0;
33
  long res;
34
 
35
  if (a < 0)
36
    {
37
      a = -a;
38
      neg = 1;
39
    }
40
 
41
  if (b < 0)
42
    b = -b;
43
 
44
  res = udivmodsi4 (a, b, 1);
45
 
46
  if (neg)
47
    res = -res;
48
 
49
  return res;
50
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.