From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: Nigel Stephens <nigel@mips.com>
Cc: Thiemo Seufer <ths@networkno.de>,
"Maciej W. Rozycki" <macro@linux-mips.org>,
Ralf Baechle <ralf@linux-mips.org>,
linux-mips@linux-mips.org
Subject: Re: [PATCH] mm/pg-r4k.c: Dump the generated code
Date: Tue, 16 Oct 2007 10:24:49 +0200 [thread overview]
Message-ID: <47147551.1010004@gmail.com> (raw)
In-Reply-To: <4713C958.8080805@mips.com>
Nigel Stephens wrote:
>
>
> 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
>> mipssde-6.05.00-20061023/vmlinux~mips32r2-smartmips
>> 1446130 58456 93056 1597642 1860ca
>> mipssde-6.05.00-20061023/vmlinux~mips32r2-smartmips-mtune4ksd
>>
>> So you're right "-march=mips32r2 -smartmips -mtune=4ksd" gives the
>> same result as "-march=4ksd"
>>
>>
>
> IIRC that should be -msmartmips, not -smartmips.
yes '-msmartmips' is used.
>
>> And the extra space given by "-march=mips32r2 -smartmips" is coming
>> from some additional nop instructions:
>>
>> $ mipsel-linux-objdump -D vmlinux~mips32r2-smartmips >
>> vmlinux~mips32r2-smartmips.S
>> $ mipsel-linux-objdump -D vmlinux~4ksd > vmlinux~4ksd.S
>> $ grep -c nop *.S
>> vmlinux~4ksd.S:18708
>> vmlinux~mips32r2-smartmips.S:27895
>>
>> It seems that these extra nops are used for load delays. For example:
>>
>> vmlinux~4ksd.S:
>> --------------
>> <snip>
>> c00008b4: 8fa40040 lw a0,64(sp)
>> c00008b8: 27a40018 addiu a0,sp,24
>> c00008bc: 0c000148 jal c0000520 <try_name>
>> <snip>
>>
>> vmlinux~mips32r2-smartmips.S:
>> ---------------------------
>> 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?
>
Yes I'm pretty sure:
$ mispel-linux-readelf -h vmlinux~mips32r2-smartmips
File: vmlinux~mips32r2-smartmips
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0xc015e000
Start of program headers: 52 (bytes into file)
Start of section headers: 12097028 (bytes into file)
Flags: 0x70001001, noreorder, o32, mips32r2
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 1
Size of section headers: 40 (bytes)
Number of section headers: 42
Section header string table index: 39
$ head kernel/.user.o.cmd
cmd_kernel/user.o := mipsel-linux-gcc -Wp,-MD,kernel/.user.o.d -nostdinc -isystem /usr/lib/gcc/mipsel-linux/3.4.4/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -O2 -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32r2 -Wa,-mips32r2 -Wa,--trap -msmartmips -Iinclude/asm-mips/mach-usip -Iinclude/asm-mips/mach-generic -D"VMLINUX_LOAD_ADDRESS=0xffffffffc0000000" -fomit-frame-pointer -g -Wdeclaration-after-statement -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(user)" -D"KBUILD_MODNAME=KBUILD_STR(user)" -c -o kernel/user.o kernel/user.c
deps_kernel/user.o := \
kernel/user.c \
$(wildcard include/config/keys.h) \
$(wildcard include/config/inotify/user.h) \
include/linux/init.h \
$(wildcard include/config/modules.h) \
$(wildcard include/config/hotplug.h) \
$(wildcard include/config/hotplug/cpu.h) \
Franck
next prev parent reply other threads:[~2007-10-16 8:25 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-02 13:54 [PATCH] mm/pg-r4k.c: Dump the generated code Maciej W. Rozycki
2007-10-02 14:11 ` Thiemo Seufer
2007-10-02 15:49 ` Ralf Baechle
2007-10-02 16:03 ` Thiemo Seufer
2007-10-02 16:08 ` Maciej W. Rozycki
2007-10-03 1:00 ` Ralf Baechle
2007-10-03 7:05 ` Geert Uytterhoeven
2007-10-03 10:32 ` Ralf Baechle
2007-10-03 12:17 ` Franck Bui-Huu
2007-10-03 13:11 ` Thiemo Seufer
2007-10-03 13:51 ` Maciej W. Rozycki
2007-10-03 19:45 ` Franck Bui-Huu
2007-10-03 20:18 ` Thiemo Seufer
2007-10-04 7:33 ` Franck Bui-Huu
2007-10-04 10:30 ` Maciej W. Rozycki
2007-10-04 12:15 ` Ralf Baechle
2007-10-04 15:01 ` Franck Bui-Huu
2007-10-04 15:23 ` Maciej W. Rozycki
2007-10-04 15:30 ` Ralf Baechle
2007-10-04 15:35 ` Maciej W. Rozycki
2007-10-04 15:42 ` Ralf Baechle
2007-10-04 17:34 ` Maciej W. Rozycki
2007-10-08 15:46 ` Maciej W. Rozycki
2007-10-08 16:41 ` Ralf Baechle
2007-10-08 16:45 ` Maciej W. Rozycki
2007-10-08 16:53 ` Ralf Baechle
2007-10-05 8:03 ` Franck Bui-Huu
2007-10-05 9:09 ` Geert Uytterhoeven
2007-10-08 15:02 ` Franck Bui-Huu
2007-10-08 15:21 ` Geert Uytterhoeven
2007-10-08 15:26 ` Ralf Baechle
2007-10-09 20:20 ` Franck Bui-Huu
2007-10-05 12:19 ` Maciej W. Rozycki
2007-10-08 14:48 ` Franck Bui-Huu
2007-10-08 15:24 ` Ralf Baechle
2007-10-08 15:39 ` Maciej W. Rozycki
2007-10-09 20:17 ` Franck Bui-Huu
2007-10-10 11:58 ` Maciej W. Rozycki
2007-10-10 12:08 ` [SPAM?] " Nigel Stephens
2007-10-11 12:01 ` Maciej W. Rozycki
2007-10-13 10:53 ` Richard Sandiford
2007-10-15 13:17 ` Maciej W. Rozycki
2007-10-14 19:37 ` Franck Bui-Huu
2007-10-15 13:26 ` Maciej W. Rozycki
2007-10-14 19:32 ` Franck Bui-Huu
2007-10-14 19:53 ` Thiemo Seufer
2007-10-14 20:29 ` Franck Bui-Huu
2007-10-15 19:35 ` Franck Bui-Huu
2007-10-15 20:11 ` Nigel Stephens
2007-10-16 8:24 ` Franck Bui-Huu [this message]
2007-10-16 12:58 ` Nigel Stephens
2007-10-17 7:56 ` Franck Bui-Huu
2007-10-17 12:30 ` Thiemo Seufer
2007-10-17 13:25 ` Nigel Stephens
2007-10-17 13:31 ` Maciej W. Rozycki
2007-11-04 8:21 ` Franck Bui-Huu
2007-11-04 17:47 ` Thiemo Seufer
2007-11-04 20:19 ` Franck Bui-Huu
2007-11-05 11:36 ` Ralf Baechle
2007-11-05 21:34 ` Franck Bui-Huu
2007-11-05 23:30 ` Ralf Baechle
2007-11-06 7:23 ` Franck Bui-Huu
2007-11-05 15:58 ` Nigel Stephens
2007-11-05 20:43 ` Franck Bui-Huu
2007-10-10 8:53 ` Ralf Baechle
2007-10-10 12:17 ` Maciej W. Rozycki
2007-10-05 11:51 ` Ralf Baechle
2007-10-08 14:11 ` Franck Bui-Huu
2007-10-08 14:41 ` Ralf Baechle
2007-10-09 20:33 ` Franck Bui-Huu
2007-10-09 20:34 ` [PATCH 1/6] tlbex.c: Cleanup __init usages Franck Bui-Huu
2007-10-11 16:16 ` Ralf Baechle
2007-10-12 6:36 ` Franck Bui-Huu
2007-10-12 14:43 ` Ralf Baechle
2007-10-09 20:35 ` [PATCH 2/6] tlbex.c: Remove relocs[] and labels[] from the init.data section Franck Bui-Huu
2007-10-09 20:35 ` Franck Bui-Huu
2007-10-10 14:27 ` Ralf Baechle
2007-10-10 16:17 ` Maciej W. Rozycki
2007-10-10 16:42 ` Ralf Baechle
2007-10-10 16:55 ` Geert Uytterhoeven
2007-10-10 17:01 ` Maciej W. Rozycki
2007-10-10 17:09 ` Geert Uytterhoeven
2007-10-10 19:58 ` Franck Bui-Huu
2007-10-10 19:29 ` Franck Bui-Huu
2007-10-09 20:36 ` [PATCH 3/6] tlbex.c: remove tlb_handler[] from " Franck Bui-Huu
2007-10-09 20:36 ` Franck Bui-Huu
2007-10-09 20:37 ` [PATCH 4/6] tlbex.c: remove final_handler[] " Franck Bui-Huu
2007-10-09 20:37 ` Franck Bui-Huu
2007-10-09 20:38 ` [PATCH 5/6] tlbex.c: cleanup debug code Franck Bui-Huu
2007-10-09 20:38 ` Franck Bui-Huu
2007-10-09 20:39 ` [PATCH 6/6] tlbex.c: cleanup include files Franck Bui-Huu
2007-10-09 20:39 ` Franck Bui-Huu
2007-10-03 13:41 ` [PATCH] mm/pg-r4k.c: Dump the generated code Ralf Baechle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47147551.1010004@gmail.com \
--to=vagabon.xyz@gmail.com \
--cc=linux-mips@linux-mips.org \
--cc=macro@linux-mips.org \
--cc=nigel@mips.com \
--cc=ralf@linux-mips.org \
--cc=ths@networkno.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox