[PATCH 02/13] x86: drop ShortForm attribute

Jan Beulich jbeulich@suse.com
Fri Nov 8 07:49:00 GMT 2019


On 07.11.2019 18:44,  H.J. Lu  wrote:
> On Wed, Nov 6, 2019 at 11:26 PM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 05.11.2019 15:58, Michael Matz wrote:
>>> Hi,
>>>
>>> On Mon, 4 Nov 2019, H.J. Lu wrote:
>>>
>>>>>>> +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?
>>>
>>> If I may add an opinion: to me the memory space savings in the tables
>>> aren't the important part, but rather the savings in textual clutter in
>>> i386-opc.tbl.  The latter makes it so that it's very easy to overlook
>>> something (either the attribute missing, or invalidly there for certain
>>> instructions), so everything that can be instead computed (quickly) from
>>> other information should be computed.
>>
>> The memory space savings aren't the primary aspect when thinking of
>> space savings - it's rather the better cache utilization that I view
>> as relevant. (The memory size reduction is welcome to me nevertheless,
>> since I don't think software has to only ever grow in size.)
> 
> For this particular case, I prefer a bit over a function.

Well, as the (sadly) only ix86 maintainer you have the final say here.
Yet I'd nevertheless like you to re-consider on the basis that both
Michael and I think differently. I'd also like to point out again the
fundamental goal of mine (with long term supportablity in mind): The
opcode table would preferably contain as little redundancy as
reasonably possible (and nothing at all that's plain unnecessary, like
stray attributes).

I guess I'll submit a v2 of this patch once swapped in order with the
already approved ones, and we'll further take it from there.

Jan



More information about the Binutils mailing list