Subject: Re: linux.h patch for mips

From: "H . J . Lu" <[email-masked]>
Date: Fri, 24 May 2002 19:03:22 -0700

I will leave it to the Linux mips people. Any comments?

H.J.
---
On Fri, May 24, 2002 at 03:11:23PM -0700, Eric Christopher wrote:
> Hey, wanted to run this by you.
> 
> I've noticed a tendency for the linux kernel people to test
> _MIPS_ISA_MIPSXX when writing defines for 32 v. 64 bit code in the asm
> headers (and other places). Personally I'd prefer they check something
> else like -D__mips_fpr=32/64, but it's not something I have time to fix
> in the kernel right now (and for gpr I'd have to define something new,
> which wouldn't be hard).
> 
> Thought I'd check with you and see if you had any other ideas how better
> to do that kind of interface?
> 
> -eric
> 
> ps. I'm checking the following patch in momentarily to fix a problem I
> noticed.
> 
> -- 
> I will not carve gods
> 
> Index: linux.h
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/config/mips/linux.h,v
> retrieving revision 1.44
> diff -u -p -w -r1.44 linux.h
> --- linux.h	20 May 2002 17:11:53 -0000	1.44
> +++ linux.h	24 May 2002 21:56:01 -0000
> @@ -155,6 +155,8 @@ void FN ()							\
>  %{mips2: -D_MIPS_ISA=_MIPS_ISA_MIPS2} \
>  %{mips3: -D_MIPS_ISA=_MIPS_ISA_MIPS3} \
>  %{mips4: -D_MIPS_ISA=_MIPS_ISA_MIPS4} \
> +%{mips32: -D_MIPS_ISA=_MIPS_ISA_MIPS32} \
> +%{mips64: -D_MIPS_ISA=_MIPS_ISA_MIPS64} \
>  %{!mips*: -D_MIPS_ISA=_MIPS_ISA_MIPS1} \
>  %{mabi=32: -D_MIPS_SIM=_MIPS_SIM_ABI32}	\
>  %{mabi=n32: -D_ABIN32=2 -D_MIPS_SIM=_ABIN32} \

---

From: Thiemo Seufer <[email-masked]>
Date: Sat, 25 May 2002 20:14:04 +0200

> > ps. I'm checking the following patch in momentarily to fix a problem I

At least for completeness there should be also _MIPS_ISA_MIPS5
(the -mips5 swich would cause _MIPS_ISA_MIPS1 otherwise).

---

From: Eric Christopher <[email-masked]>
Date: 26 May 2002 11:00:54 -0700

> (the -mips5 swich would cause _MIPS_ISA_MIPS1 otherwise).

Rather irrelevent since mips5 really isn't supported in gcc, but ok. I
was more concerned with the kernel issues and how checks for processor
features was being done. Requiring -mipsX for anything isn't a good idea
(what if you want to compile for something that is not a particular
architecture, e.g. -march=r4600). 

-eric

-- 
I will not carve gods

---

From: Thiemo Seufer <[email-masked]>
Date: Sun, 26 May 2002 20:29:59 +0200

> architecture, e.g. -march=r4600). 

That's why my private patch for mips64-linux has:

  %{mips1:-D_MIPS_ISA=_MIPS_ISA_MIPS1} \
  %{mips2:-D_MIPS_ISA=_MIPS_ISA_MIPS2} \
  %{mips32:-D_MIPS_ISA=_MIPS_ISA_MIPS32} \
  %{mips3:-D_MIPS_ISA=_MIPS_ISA_MIPS3} \
  %{mips4:-D_MIPS_ISA=_MIPS_ISA_MIPS4} \
  %{mips5:-D_MIPS_ISA=_MIPS_ISA_MIPS5} \
  %{mips64:-D_MIPS_ISA=_MIPS_ISA_MIPS64} \
  %{!mips*: \
    %{mabi=32|mabi=o32|!mabi*:-D_MIPS_ISA=_MIPS_ISA_MIPS1} \
    %{mabi=n32|mabi=64|mabi=n64:-D_MIPS_ISA=_MIPS_ISA_MIPS3}} \

Thiemo

---

From: Eric Christopher <[email-masked]>
Date: 26 May 2002 23:55:18 -0700

>     %{mabi=n32|mabi=64|mabi=n64:-D_MIPS_ISA=_MIPS_ISA_MIPS3}} \

Not a bad start. There's more that needs to be done, I may end up having
to submit kernel patches to make everything agree. Do people use a cvs
server or ...

-eric

-- 
I will not carve gods