[PATCH v2] Support APX PUSHP/POPP

Cui, Lili lili.cui@intel.com
Fri Dec 8 10:39:39 GMT 2023


> On 08.12.2023 03:41, Cui, Lili wrote:
> >> On 07.12.2023 15:26, Cui, Lili wrote:
> >>>> On 07.12.2023 09:56, Cui, Lili wrote:
> >>>>> --- a/gas/config/tc-i386.c
> >>>>> +++ b/gas/config/tc-i386.c
> >>>>> @@ -3894,7 +3894,8 @@ is_apx_evex_encoding (void)  static INLINE
> >>>>> bool is_apx_rex2_encoding (void)  {
> >>>>> -  return i.rex2 || i.rex2_encoding;
> >>>>> +  return i.rex2 || i.rex2_encoding
> >>>>> +    || i.tm.opcode_modifier.operandconstraint == REX2_REQUIRED;
> >>>>
> >>>> Nit: Odd indentation.
> >>>>
> >>>
> >>> Sorry, I didn't find the indentation problem you mentioned.
> >>
> >>   return i.rex2 || i.rex2_encoding
> >>          || i.tm.opcode_modifier.operandconstraint == REX2_REQUIRED;
> >>
> >
> > I want to look for answers in existing cases and find two different uses. This is
> a small change, and I'll keep it consistent with your style.
> >
> > Case 1:
> >
> > static INLINE bool need_evex_encoding (void) {
> >   return i.vec_encoding == vex_encoding_evex
> >         || i.vec_encoding == vex_encoding_evex512
> >         || i.mask.reg;
> > }
> >
> >
> > Case 2:
> > irf_operand (int op, const char *field) {
> >   if (!field)
> >     {
> >       return op == IA64_OPND_RR_R3 || op == IA64_OPND_DBR_R3
> >         || op == IA64_OPND_IBR_R3  || op == IA64_OPND_PKR_R3
> >         || op == IA64_OPND_PMC_R3  || op == IA64_OPND_PMD_R3
> >         || op == IA64_OPND_MSR_R3 || op == IA64_OPND_CPUID_R3;
> >     }
> > ...
> > }
> 
> Funny you should pick out such an (imo obviously bad) example. If this was
> the style to use, then things like
> 
>   if ((code == BFD_RELOC_64 || code == BFD_RELOC_64_PCREL)
>       && GOT_symbol
>       && fixp->fx_addsy == GOT_symbol)
> 
> would also need to be
> 
>   if ((code == BFD_RELOC_64 || code == BFD_RELOC_64_PCREL)
>     && GOT_symbol
>     && fixp->fx_addsy == GOT_symbol)
> 
> According to my understanding (and somewhat simplified), indentation of the
> start of a statement is determined relative to what is before it, whereas
> indentation within a (wrapped) statement is such that respective expression
> parts match up (taking into account both real and virtual parentheses), with
> operators placed at the start of the
> (wrapped) lines. I'm not aware of any place where this is properly written
> down, though. IOW my understanding in this regard may also be entirely
> wrong.
> 

I don't think this is funny, I also found the same indentation as mine in gcc. Maybe they adjusted it using the same script as me. Anyway I don't want to spend any time on this.

Lili.


More information about the Binutils mailing list