This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Use 2-byte VEX prefix if possible
- From: "Jan Beulich" <jbeulich at novell dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: <binutils at sourceware dot org>
- Date: Tue, 23 Dec 2008 07:46:18 +0000
- Subject: Re: PATCH: Use 2-byte VEX prefix if possible
- References: <6dc9ffc80812221450w47ec428ft56dd3f0bca5a4506@mail.gmail.com>
>>> "H.J. Lu" <hjl.tools@gmail.com> 22.12.08 23:50 >>>
>On Mon, Dec 22, 2008 at 7:47 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>
>>> Btw., in an entirely different context I noticed that this operand swapping
>>> may be desirable elsewhere: vmovq and vmovss (perhaps other?) in some
>>> case currently use the longer encoding starting with opcode 0xc4 on
>>> x86-64 when, by using the alternative base opcode, the short 0xc5-based
>>> encoding could be used - just look at the disassembly of this fragment:
>>>
>>> .intel_syntax noprefix
>>> .text
>>> .code64
>>> Start64:
>>> vmovq xmm15, xmm0
>>> vmovq xmm0, xmm15
>>> .byte 0xc5, 0x79, 0xd6, 0xf8 # vmovq xmm0, xmm15
>>>
>>> vmovss xmm15, xmm0, xmm0
>>> vmovss xmm0, xmm15, xmm0
>>> vmovss xmm0, xmm0, xmm15
>>> .byte 0xc5, 0x7a, 0x11, 0xf8 # vmovss xmm0, xmm0, xmm15
>>>
>>> As the assembler generally uses the shortest possible encoding, it should
>>> do so in these cases too, I would think.
>>>
>>
>
>Here is the patch. I will check it in after some testing.
Wow - that was fast! Thanks, Jan