This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DI support in libgcc2


Hi,

patch for 3.1 included. The patch also works for
the head revision.

Hartmut

----- Original Message -----
From: "Richard Henderson" <rth@redhat.com>
To: "Hartmut Schirmer" <hartmut.schirmer@arcor.de>
Cc: <gcc@gcc.gnu.org>
Sent: Friday, July 19, 2002 7:00 PM
Subject: Re: DI support in libgcc2


> On Fri, Jul 19, 2002 at 02:33:55PM +0200, Hartmut Schirmer wrote:
> > Several functions in libgcc2.c call __negdi2 even if
> > the target supports negating a DI.
> [...]
> > Is this the right way to go ?
>
> No.  Should use the - operator everywhere except
> in __negdi2 itself, which will cause the compiler
> to call the __negdi2 function if needed.
>
>
> r~

2002-07-21  Hartmut Schirmer" <hartmut.schirmer@arcor.de>

* libgcc2.c: Use unary minus instead of inlined version of __negdi2

*** libgcc2.orig Wed Apr  3 04:20:52 2002
--- libgcc2.c Sun Jul 21 20:17:37 2002
***************
*** 45,54 ****

  #include "libgcc2.h"
  
! #if defined (L_negdi2) || defined (L_divdi3) || defined (L_moddi3)
! #if defined (L_divdi3) || defined (L_moddi3)
! static inline
! #endif
  DWtype
  __negdi2 (DWtype u)
  {
--- 45,51 ----

  #include "libgcc2.h"
  
! #if defined (L_negdi2)
  DWtype
  __negdi2 (DWtype u)
  {
***************
*** 734,747 ****

    if (uu.s.high < 0)
      c = ~c,
!     uu.ll = __negdi2 (uu.ll);
    if (vv.s.high < 0)
      c = ~c,
!     vv.ll = __negdi2 (vv.ll);

    w = __udivmoddi4 (uu.ll, vv.ll, (UDWtype *) 0);
    if (c)
!     w = __negdi2 (w);

    return w;
  }
--- 731,744 ----

    if (uu.s.high < 0)
      c = ~c,
!     uu.ll = -uu.ll;
    if (vv.s.high < 0)
      c = ~c,
!     vv.ll = -vv.ll;

    w = __udivmoddi4 (uu.ll, vv.ll, (UDWtype *) 0);
    if (c)
!     w = -w;

    return w;
  }
***************
*** 760,772 ****

    if (uu.s.high < 0)
      c = ~c,
!     uu.ll = __negdi2 (uu.ll);
    if (vv.s.high < 0)
!     vv.ll = __negdi2 (vv.ll);

    (void) __udivmoddi4 (uu.ll, vv.ll, &w);
    if (c)
!     w = __negdi2 (w);

    return w;
  }
--- 757,769 ----

    if (uu.s.high < 0)
      c = ~c,
!     uu.ll = -uu.ll;
    if (vv.s.high < 0)
!     vv.ll = -vv.ll;

    (void) __udivmoddi4 (uu.ll, vv.ll, &w);
    if (c)
!     w = -w;

    return w;
  }



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]