[ Please do not send patches as replies. ]

On Thu, Jul 11, 2019 at 08:11:52AM -0400, Michael Meissner wrote:
> In a future patch, I plan to introduce a new function that says whether an
> address is prefixed based on the address format (D-form, DS-form, DQ-form) 
> used
> by the instruction.  I plan on naming the new function:
> 
>       rs6000_prefixed_address_format
> 
> This means the existing function that takes a mode argument will be renamed 
> to:
> 
>       rs6000_prefixed_address_mode

D/DQ/DS are the "instruction form", not "address format".  Let's not
invent new similar names :-/

> Rs6000_prefixed_address_mode will have a table mapping the mode into the
> expected address format, and then call rs6000_prefixed_address_format.  This 
> is
> due to the number of irregularities in the PowerPC architecture:
> 
>       LWA is DS-form, but LWZ is D-form
>       LFD is D-form, LXSD is DS-form

Great isn't it?

> In the tests that will occur after register allocation, we can check the
> register type, and more accurately determine if a prefixed instruction must be
> used if the offset is odd (for DS-form) or the offset is not aligned on a
> 16-byte boundary (for DQ-form).

Is not 0 mod 4, for DS, even.

> --- gcc/config/rs6000/predicates.md   (revision 273368)
> +++ gcc/config/rs6000/predicates.md   (working copy)
> @@ -1686,7 +1686,7 @@ (define_predicate "pcrel_external_addres
>  (define_predicate "prefixed_mem_operand"
>    (match_code "mem")
>  {
> -  return rs6000_prefixed_address (XEXP (op, 0), GET_MODE (op));
> +  return rs6000_prefixed_address_mode (XEXP (op, 0), GET_MODE (op));
>  })

That sounds like it returns a mode.  rs6000_prefixed_address_mode_p or
rs6000_is_prefixed_address_mode, maybe?  Well you use _p alredy, so
please do that here as well.

Okay for trunk with that change.  Thanks!


Segher

Reply via email to