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

Subversion Repositories or1k

[/] [or1k/] [branches/] [newlib/] [newlib/] [newlib/] [libc/] [stdlib/] [mprec.c] - Diff between revs 39 and 56

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 39 Rev 56
Line 143... Line 143...
        _Bigint * b _AND
        _Bigint * b _AND
        int m _AND
        int m _AND
        int a)
        int a)
{
{
  int i, wds;
  int i, wds;
  unsigned long *x, y;
  __ULong *x, y;
#ifdef Pack_32
#ifdef Pack_32
  unsigned long xi, z;
  __ULong xi, z;
#endif
#endif
  _Bigint *b1;
  _Bigint *b1;
 
 
  wds = b->_wds;
  wds = b->_wds;
  x = b->_x;
  x = b->_x;
Line 188... Line 188...
_DEFUN (s2b, (ptr, s, nd0, nd, y9),
_DEFUN (s2b, (ptr, s, nd0, nd, y9),
        struct _reent * ptr _AND
        struct _reent * ptr _AND
        _CONST char *s _AND
        _CONST char *s _AND
        int nd0 _AND
        int nd0 _AND
        int nd _AND
        int nd _AND
        unsigned long y9)
        __ULong y9)
{
{
  _Bigint *b;
  _Bigint *b;
  int i, k;
  int i, k;
  long x, y;
  __Long x, y;
 
 
  x = (nd + 8) / 9;
  x = (nd + 8) / 9;
  for (k = 0, y = 1; x > y; y <<= 1, k++);
  for (k = 0, y = 1; x > y; y <<= 1, k++);
#ifdef Pack_32
#ifdef Pack_32
  b = Balloc (ptr, k);
  b = Balloc (ptr, k);
Line 224... Line 224...
  return b;
  return b;
}
}
 
 
int
int
_DEFUN (hi0bits,
_DEFUN (hi0bits,
        (x), register unsigned long x)
        (x), register __ULong x)
{
{
  register int k = 0;
  register int k = 0;
 
 
  if (!(x & 0xffff0000))
  if (!(x & 0xffff0000))
    {
    {
Line 258... Line 258...
    }
    }
  return k;
  return k;
}
}
 
 
int
int
_DEFUN (lo0bits, (y), unsigned long *y)
_DEFUN (lo0bits, (y), __ULong *y)
{
{
  register int k;
  register int k;
  register unsigned long x = *y;
  register __ULong x = *y;
 
 
  if (x & 7)
  if (x & 7)
    {
    {
      if (x & 1)
      if (x & 1)
        return 0;
        return 0;
Line 323... Line 323...
_Bigint *
_Bigint *
_DEFUN (mult, (ptr, a, b), struct _reent * ptr _AND _Bigint * a _AND _Bigint * b)
_DEFUN (mult, (ptr, a, b), struct _reent * ptr _AND _Bigint * a _AND _Bigint * b)
{
{
  _Bigint *c;
  _Bigint *c;
  int k, wa, wb, wc;
  int k, wa, wb, wc;
  unsigned long carry, y, z;
  __ULong carry, y, z;
  unsigned long *x, *xa, *xae, *xb, *xbe, *xc, *xc0;
  __ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0;
#ifdef Pack_32
#ifdef Pack_32
  unsigned long z2;
  __ULong z2;
#endif
#endif
 
 
  if (a->_wds < b->_wds)
  if (a->_wds < b->_wds)
    {
    {
      c = a;
      c = a;
Line 454... Line 454...
_Bigint *
_Bigint *
_DEFUN (lshift, (ptr, b, k), struct _reent * ptr _AND _Bigint * b _AND int k)
_DEFUN (lshift, (ptr, b, k), struct _reent * ptr _AND _Bigint * b _AND int k)
{
{
  int i, k1, n, n1;
  int i, k1, n, n1;
  _Bigint *b1;
  _Bigint *b1;
  unsigned long *x, *x1, *xe, z;
  __ULong *x, *x1, *xe, z;
 
 
#ifdef Pack_32
#ifdef Pack_32
  n = k >> 5;
  n = k >> 5;
#else
#else
  n = k >> 4;
  n = k >> 4;
Line 512... Line 512...
}
}
 
 
int
int
_DEFUN (cmp, (a, b), _Bigint * a _AND _Bigint * b)
_DEFUN (cmp, (a, b), _Bigint * a _AND _Bigint * b)
{
{
  unsigned long *xa, *xa0, *xb, *xb0;
  __ULong *xa, *xa0, *xb, *xb0;
  int i, j;
  int i, j;
 
 
  i = a->_wds;
  i = a->_wds;
  j = b->_wds;
  j = b->_wds;
#ifdef DEBUG
#ifdef DEBUG
Line 545... Line 545...
_DEFUN (diff, (ptr, a, b), struct _reent * ptr _AND
_DEFUN (diff, (ptr, a, b), struct _reent * ptr _AND
        _Bigint * a _AND _Bigint * b)
        _Bigint * a _AND _Bigint * b)
{
{
  _Bigint *c;
  _Bigint *c;
  int i, wa, wb;
  int i, wa, wb;
  long borrow, y;               /* We need signed shifts here. */
  __Long borrow, y;             /* We need signed shifts here. */
  unsigned long *xa, *xae, *xb, *xbe, *xc;
  __ULong *xa, *xae, *xb, *xbe, *xc;
#ifdef Pack_32
#ifdef Pack_32
  long z;
  __Long z;
#endif
#endif
 
 
  i = cmp (a, b);
  i = cmp (a, b);
  if (!i)
  if (!i)
    {
    {
Line 627... Line 627...
 
 
double
double
_DEFUN (ulp, (_x), double _x)
_DEFUN (ulp, (_x), double _x)
{
{
  union double_union x, a;
  union double_union x, a;
  register long L;
  register __Long L;
 
 
  x.d = _x;
  x.d = _x;
 
 
  L = (word0 (x) & Exp_mask) - (P - 1) * Exp_msk1;
  L = (word0 (x) & Exp_mask) - (P - 1) * Exp_msk1;
#ifndef Sudden_Underflow
#ifndef Sudden_Underflow
Line 673... Line 673...
 
 
double
double
_DEFUN (b2d, (a, e),
_DEFUN (b2d, (a, e),
        _Bigint * a _AND int *e)
        _Bigint * a _AND int *e)
{
{
  unsigned long *xa, *xa0, w, y, z;
  __ULong *xa, *xa0, w, y, z;
  int k;
  int k;
  union double_union d;
  union double_union d;
#ifdef VAX
#ifdef VAX
  unsigned long d0, d1;
  __ULong d0, d1;
#else
#else
#define d0 word0(d)
#define d0 word0(d)
#define d1 word1(d)
#define d1 word1(d)
#endif
#endif
 
 
Line 758... Line 758...
 
 
{
{
  union double_union d;
  union double_union d;
  _Bigint *b;
  _Bigint *b;
  int de, i, k;
  int de, i, k;
  unsigned long *x, y, z;
  __ULong *x, y, z;
#ifdef VAX
#ifdef VAX
  unsigned long d0, d1;
  __ULong d0, d1;
 
#endif
  d.d = _d;
  d.d = _d;
 
#ifdef VAX
  d0 = word0 (d) >> 16 | word0 (d) << 16;
  d0 = word0 (d) >> 16 | word0 (d) << 16;
  d1 = word1 (d) >> 16 | word1 (d) << 16;
  d1 = word1 (d) >> 16 | word1 (d) << 16;
#else
#else
#define d0 word0(d)
#define d0 word0(d)
#define d1 word1(d)
#define d1 word1(d)
 
  d.d = _d;
#endif
#endif
 
 
#ifdef Pack_32
#ifdef Pack_32
  b = Balloc (ptr, 1);
  b = Balloc (ptr, 1);
#else
#else

powered by: WebSVN 2.1.0

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