lkml.org 
[lkml]   [2015]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] x86/asm/entry/64: use smaller insns
On Thu, Mar 26, 2015 at 10:37:32AM +0100, Ingo Molnar wrote:
> But here GAS generates the 10-byte opcode even if 'mov $0x12345678,
> %rdi' is used, which is an unforced error.

7 bytes:

48 c7 c7 78 56 34 12 mov $0x12345678,%rdi

which is REX + opcode C7 + ModRM + 4-byte immediate.

If it used the bX opcodes, it would have to use REX prefix too for the
%rdi register which would generate a 10-byte insn then:

0: 48 bf 78 56 43 12 00 mov $0x12435678,%rdi
7: 00 00 00

REX + opcode BF + 8 bytes immediate.

So I think using the REX register "rdi" forces it to use the REX prefix
and thus the longer instructions.

All IMHO of course.

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--


\
 
 \ /
  Last update: 2015-03-26 11:01    [W:0.073 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site