[Top] [All Lists]

Re: [PATCH] mm/pg-r4k.c: Dump the generated code

To: Franck Bui-Huu <>
Subject: Re: [PATCH] mm/pg-r4k.c: Dump the generated code
From: Nigel Stephens <>
Date: Mon, 15 Oct 2007 21:11:04 +0100
Cc: Thiemo Seufer <>, "Maciej W. Rozycki" <>, Ralf Baechle <>,
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <> <> <> <> <> <> <> <>
User-agent: IceDove (X11/20070607)

Franck Bui-Huu wrote:
Thiemo Seufer wrote:
Could you check what "-march=mips32r2 -smartmips -mtune=4ksd" does?
I expect it to have the same result than "-march=4ksd".

OK, I give it a try and here are some figures:

$ mipsel-linux-size mipssde-6.05.00-20061023/vmlinux~*
   text    data     bss     dec     hex filename
1446130   58456   93056 1597642  1860ca mipssde-6.05.00-20061023/vmlinux~4ksd
1472034   58456   93056 1623546  18c5fa 
1446130   58456   93056 1597642  1860ca 

So you're right "-march=mips32r2 -smartmips -mtune=4ksd" gives the
same result as "-march=4ksd"

IIRC that should be -msmartmips, not -smartmips.

And the extra space given by "-march=mips32r2 -smartmips" is coming
from some additional nop instructions:

$ mipsel-linux-objdump -D vmlinux~mips32r2-smartmips > 
$ mipsel-linux-objdump -D vmlinux~4ksd > vmlinux~4ksd.S
$ grep -c nop *.S

It seems that these extra nops are used for load delays. For example:

c00008b4:      8fa40040        lw      a0,64(sp)
c00008b8:      27a40018        addiu   a0,sp,24
c00008bc:      0c000148        jal     c0000520 <try_name>

c00008b8:      8fa40040        lw      a0,64(sp)
c00008bc:      00000000        nop
c00008c0:      27a40018        addiu   a0,sp,24
c00008c4:      0c000148        jal     c0000520 <try_name>

That's weird: load delay slots should only be required by -march=mips1 (or no -march)

Are you sure that the -march=mips32r2 option is really getting passed to the compiler and assembler?


<Prev in Thread] Current Thread [Next in Thread>