This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: [PATCH] X86: Add pseudo prefixes to control encoding
On Fri, Nov 11, 2016 at 1:28 PM, Florian Weimer <fweimer@redhat.com> wrote:
> On 11/11/2016 10:24 PM, H.J. Lu wrote:
>
>>> Sure, but I think the instruction length specification would still be
>>> *very*
>>> useful in some cases to lock things down (and document the length
>>> dependency).
>>
>>
>> Instruction length can a vague constraint:
>>
>> 0: c4 e1 78 28 50 00 vmovaps 0x0(%rax),%xmm2
>> 6: 62 f1 7c 08 28 10 vmovaps (%rax),%xmm2
>>
>> Both instructions with the same length do the same thing.
>> But one is AVX and the other is AVX512.
>>
>> c: c4 e1 78 28 10 vmovaps (%rax),%xmm2
>> 11: c5 f8 28 50 00 vmovaps 0x0(%rax),%xmm2
>>
>> These 2 are AVX. Majority of programmers don't care how
>> an instruction is encoded. If they want specific instruction
>> length, they can experiment with pseudo prefixes to get
>> exactly what they need.
>
>
> Oh, I didn't intend this as a replacement, just as an additional
> possibility.
>
Control instruction length is one usage of pseudo prefixes.
Specifying instruction length will make assembler unnecessarily
more complex, like how to encode "vmovaps (%rax),%xmm2"
with 7 bytes.
--
H.J.