This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 02/12] x86: fold various AVX512VL templates into their AVX512F counterparts
On Mon, Jun 4, 2018 at 6:03 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 04.06.18 at 14:41, <hjl.tools@gmail.com> wrote:
>> what is the advantage of
>>
>> +static const initializer opcode_modifier_shorthands[] =
>> +{
>> + { "Disp8ShiftVL", "Disp8MemShift=" stringify(DISP8_SHIFT_VL) },
>> +};
>> +
>>
>> How much does it save? I can't tell what an entry has by just
>> looking at i386-opc.h.
>
> This isn't about space saving at all. It's about not introducing yet
> another easy to break case of specifying some arbitrary number in
> various i386-opc.tbl entries. Writing Disp8MemShift=7 there is simply
> unreadable and unmaintainable (as is for example Evex=2 to mean
> EVEX128 or, even worse, VexW=1 to mean VEX.W=0 and VexW=2
> to mean VEX.W=1). Long term I'm intending to replace all of these
> by suitable (and readable!) shorthands.
>
> With the approach above, anyone can change the definition of
> DISP8_SHIFT_VL to another suitable number without having to
> touch any other place (and in particular without having to modify
> dozens or even hundreds of templates).
>
> If you dislike the shorthand approach, passing i386-opc.tbl through
> the C pre-processor would be another option.
>
I prefer a C pre-processor approach.
--
H.J.