* gcc: mips32 vs mips3
@ 2009-03-06 16:55 Marian Jancar
2009-03-09 19:39 ` Ralf Baechle
0 siblings, 1 reply; 4+ messages in thread
From: Marian Jancar @ 2009-03-06 16:55 UTC (permalink / raw)
To: linux-mips
Hi,
which option is supposed to compile faster code, -mips3 or -mips32?
Marian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gcc: mips32 vs mips3
2009-03-06 16:55 gcc: mips32 vs mips3 Marian Jancar
@ 2009-03-09 19:39 ` Ralf Baechle
2009-04-06 14:21 ` Marian Jancar
0 siblings, 1 reply; 4+ messages in thread
From: Ralf Baechle @ 2009-03-09 19:39 UTC (permalink / raw)
To: Marian Jancar; +Cc: linux-mips
On Fri, Mar 06, 2009 at 05:55:10PM +0100, Marian Jancar wrote:
> which option is supposed to compile faster code, -mips3 or -mips32?
That question doesn't quite make sense. A MIPS32 processor can't execute
MIPS III code and a MIPS III processor can't execute MIPS32 code. Only a
MIPS64 processor could execute code compiled for either MIPS32 or MIPS III.
So choose the option to match the architecture of your processor.
Ralf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gcc: mips32 vs mips3
2009-03-09 19:39 ` Ralf Baechle
@ 2009-04-06 14:21 ` Marian Jancar
2009-04-06 14:30 ` Ralf Baechle
0 siblings, 1 reply; 4+ messages in thread
From: Marian Jancar @ 2009-04-06 14:21 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips
Ralf Baechle wrote:
> On Fri, Mar 06, 2009 at 05:55:10PM +0100, Marian Jancar wrote:
>
>> which option is supposed to compile faster code, -mips3 or -mips32?
>
> That question doesn't quite make sense. A MIPS32 processor can't execute
> MIPS III code and a MIPS III processor can't execute MIPS32 code. Only a
> MIPS64 processor could execute code compiled for either MIPS32 or MIPS III.
> So choose the option to match the architecture of your processor.
The processor in question is the processos in the Atheros 802.11 SoC
AR5312, 4Kc AFAIK.
OpenWRT uses -mips32 for this target but the GPL SDK for NanoStation
uses -march=r4600. Both options produce code that runs without oops
or any other immediately manifested issues.
So you are right, the correct question is "-mips32 vs -march=r4600".
I got confused because I left some bits compiled with -march=4600 when
recompiling with -mips32 and gcc complained about it being compiled
for MIPS III when linking.
Marian
# cat /proc/cpuinfo
system type : Atheros AR2313
processor : 0
cpu model : MIPS 4Kc V0.10
BogoMIPS : 179.40
wait instruction : yes
microsecond timers : yes
tlb_entries : 16
extra interrupt vector : yes
hardware watchpoint : yes
ASEs implemented :
VCED exceptions : not available
VCEI exceptions : not available
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: gcc: mips32 vs mips3
2009-04-06 14:21 ` Marian Jancar
@ 2009-04-06 14:30 ` Ralf Baechle
0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2009-04-06 14:30 UTC (permalink / raw)
To: Marian Jancar; +Cc: linux-mips
On Mon, Apr 06, 2009 at 04:21:23PM +0200, Marian Jancar wrote:
>> That question doesn't quite make sense. A MIPS32 processor can't execute
>> MIPS III code and a MIPS III processor can't execute MIPS32 code. Only a
>> MIPS64 processor could execute code compiled for either MIPS32 or MIPS III.
>> So choose the option to match the architecture of your processor.
>
> The processor in question is the processos in the Atheros 802.11 SoC
> AR5312, 4Kc AFAIK.
> OpenWRT uses -mips32 for this target but the GPL SDK for NanoStation
> uses -march=r4600. Both options produce code that runs without oops
> or any other immediately manifested issues.
>
> So you are right, the correct question is "-mips32 vs -march=r4600".
> I got confused because I left some bits compiled with -march=4600 when
> recompiling with -mips32 and gcc complained about it being compiled
> for MIPS III when linking.
That's correct because the the R4600 is MIPS III but but when building o32
binaries gcc will automatically limit itself to the 32-bit subset of
MIPS III which is MIPS II. MIPS II in turn is a subset of MIPS32. So
that's actually safe but it won't deliver optimal code.
Occasionally one may have to cheat to the compiler like this for example
if the compiler is very (VERY!!!) old and doesn't know about the 4K or
MIPS32 yet. Not recommended for those who don't know what gcc will
actually do with the options.
Ralf
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-06 14:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-06 16:55 gcc: mips32 vs mips3 Marian Jancar
2009-03-09 19:39 ` Ralf Baechle
2009-04-06 14:21 ` Marian Jancar
2009-04-06 14:30 ` Ralf Baechle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.