This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 02/13] x86: drop ShortForm attribute


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.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]