This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 02/13] x86: drop ShortForm attribute
On 04.11.2019 18:13, H.J. Lu wrote:
> On Mon, Nov 4, 2019 at 2:31 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 31.10.2019 18:49, H.J. Lu wrote:
>>> On Wed, Oct 30, 2019 at 1:23 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>> @@ -6208,6 +6209,21 @@ check_string (void)
>>>> return 1;
>>>> }
>>>>
>>>> +static bfd_boolean
>>>> +is_short_form (const insn_template *t)
>>>> +{
>>>> + unsigned int op, num_reg;
>>>> +
>>>> + if (t->opcode_modifier.modrm || t->operands > 2)
>>>> + return FALSE;
>>>> +
>>>> + for (num_reg = op = 0; op < t->operands; ++op)
>>>> + if (t->operand_types[op].bitfield.reg)
>>>> + ++num_reg;
>>>> +
>>>> + return num_reg == 1;
>>>> +}
>>>> +
>>>
>>> So this replaces a bit check with a function. What is the real advantage?
>>
>> Space savings - one bit per template, which sums up with the large
>> number of templates there are.
>>
>
> Is that really necessary?
I think the rest of this series doesn't depend on this (yet I didn't
do a thorough check), but I think where easily possible and not
overly expensive, we should try to avoid having redundant information
in the templates. As to expensiveness: Note that patch 1 arranges for
the function to be called only at the tail of a long if/else-if chain
(which in particular filters out all insns using ModR/M encodings).
And the only other use is for templates with the W attribute set,
which are pretty common ones, but not very many.
If you continue to have severe reservations, I can try to re-order
the series, such that (if it works) the subsequent already approved
patches could go in independent of the decision here.
Jan