This is the mail archive of the gcc-patches@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]

Re: libgcc2.c/longlong.h


On Thu, Dec 16, 1999 at 11:21:23PM +1300, Michael Hayes wrote:
> Jakub Jelinek writes:
>  > On Thu, Dec 16, 1999 at 07:24:20PM +1300, Michael Hayes wrote:
> 
>  > Sorry, thinko on my part.
>  > This patch should fix it. As I was not much familiar with BITS_PER_UNIT != 8
>  > archs, I've built cross compilers for all of them to check it.
> 
> I don't think this is correct.

It matches exactly the code which used to be in libgcc2.c.

>  The original code had the correct idea
> but the wrong implementation.  Unfortunately, libgcc2 was written
> assuming that BITS_PER_UNIT is always 8, so I've always built it
> redefining DImode as HImode and SImode as QImode.  Yuk!  But it used
> to work.

Why do you do it? It is doable with the updated longlong.h and libgcc2.c
changes as well, along the lines of:

#if defined(_C3X) || defined(_C4X)
#define W_TYPE_SIZE 32
#define Wtype   QItype
#define UWtype  UQItype
#define HWtype  QItype
#define UHWtype UQItype
#define DWtype  HItype
#define UDWtype UHItype
#define __muldi3        __mulqi3
#define __divdi3        __divqi3
#define __udivdi3       __udivqi3
#define __moddi3        __modqi3
#define __umoddi3       __umodqi3
...
#else
#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
#define Wtype   SItype
#define UWtype  USItype
#define HWtype  SItype
#define UHWtype USItype
#define DWtype  DItype
#define UDWtype UDItype
#endif

and making sure libgcc2.c only uses {W,UW,HW,UHW,DW,UDW}type and DWunion.
I've started to write such a patch, but then realized you already have all
those routines in c4x/libgcc.S in assembly, so it does not make much sense
to me why do you want all those routines in libgcc2.c at all, especially
when they have confusing names and nobody uses them.

Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.26 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________


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