[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFyJg1248Df6tj6KMA2o2KCQbZJ7i6POCPureVwzX91Dzg@mail.gmail.com>
Date: Wed, 25 Mar 2015 17:05:50 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>,
Ingo Molnar <mingo@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...capital.net>,
Oleg Nesterov <oleg@...hat.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Alexei Starovoitov <ast@...mgrid.com>,
Will Drewry <wad@...omium.org>,
Kees Cook <keescook@...omium.org>,
"the arch/x86 maintainers" <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/4] x86/asm/entry/64: use smaller insns
On Wed, Mar 25, 2015 at 4:56 PM, H. Peter Anvin <hpa@...or.com> wrote:
> No, movabs is yet another instruction (with a 64-bit absolute address.) But movq can mean 10 or 7 bytes...
I mentioned movabs because that is literally what as generates at
least for me (or then objdump is confused):
[torvalds@i7 ~]$ as -v
GNU assembler version 2.24 (x86_64-redhat-linux) using BFD version
version 2.24
[torvalds@i7 ~]$ cat t.s
main:
movq $0x12, %rdi
movq $0x1234, %rdi
movq $0x123456, %rdi
movq $0x12345678, %rdi
movq $0x123456789ab, %rdi
[torvalds@i7 ~]$ as t.s
[torvalds@i7 ~]$ objdump -d a.out
...
0: 48 c7 c7 12 00 00 00 mov $0x12,%rdi
7: 48 c7 c7 34 12 00 00 mov $0x1234,%rdi
e: 48 c7 c7 56 34 12 00 mov $0x123456,%rdi
15: 48 c7 c7 78 56 34 12 mov $0x12345678,%rdi
1c: 48 bf ab 89 67 45 23 movabs $0x123456789ab,%rdi
23: 01 00 00
so 'as' is clearly just stupid. It already takes the size of the
constant into account and generates different instructions. Why not
for the common 32-bit case too?
Oh well.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists