This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 02/13] x86: drop ShortForm attribute
- From: Jan Beulich <jbeulich at suse dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 4 Nov 2019 11:31:16 +0100
- Subject: Re: [PATCH 02/13] x86: drop ShortForm attribute
- References: <773baa32-a12c-5da3-32a4-3db5a424d102@suse.com> <da5eab10-c2c1-9f05-2050-cab7e7b9d9e6@suse.com> <CAMe9rOpv=DsvmY_SkXHKD+TwQB+1pE6VmxNByhy6-9FWhJJ1eA@mail.gmail.com>
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.
Jan