Skip to contentSkip to conversation

linux.h patch for mips

DISCUSSION H . J . Lu 3 participants 5 messages May 25, 2002 – May 27, 2002 1 message not in the archive MIPS

lore
Share & tools
lore

H . J . Lu

author
#1 lore raw
In reply to a message not in the archive

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

H.J.
---

Quoted 36 lines · Eric Christopher

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.

Signature · 7 lines
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 +2 -0
@@ -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} \
#2 lore raw
Quoted 26 lines · H . J . Lu

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

H.J.
---

Quoted 20 lines · Eric Christopher

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.

Signature · 1 line
I will not carve gods
Quoted 11 lines

linux.h void FN () \ · line 157

Quoted 11 lines

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 +0 -0
@@ -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} \

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

Quoted 5 lines
Quoted 5 lines
linux.h +2 -0
+%{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} \
#3 lore raw
Quoted 4 lines

At least for completeness there should be also _MIPS_ISA_MIPS5 (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

Signature · 1 line
I will not carve gods
#4 lore raw
Quoted 10 lines · Eric Christopher
Quoted 4 lines

At least for completeness there should be also _MIPS_ISA_MIPS5 (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).

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

#5 lore raw
Quoted 13 lines

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}} \

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

Signature · 1 line
I will not carve gods