Hi! On Mon, Jan 20, 2020 at 10:42:12AM +0000, Richard Sandiford wrote: > "Kewen.Lin" <li...@linux.ibm.com> writes: > > gcc/ChangeLog > > > > 2020-01-16 Kewen Lin <li...@gcc.gnu.org> > > > > * config/rs6000/rs6000.c (TARGET_STRIDE_DFORM_VALID_P): New macro. > > (rs6000_stride_dform_valid_p): New function. > > * doc/tm.texi: Regenerate. > > * doc/tm.texi.in (TARGET_STRIDE_DFORM_VALID_P): New hook. > > * target.def (stride_dform_valid_p): New hook. > > It looks like we should able to derive this information from the normal > legitimate_address_p hook.
Yes, probably. > Also, "D-form" vs. "X-form" is AFAIK a PowerPC-specific classification. > It would be good to use a more generic term in target-independent code. Yeah. X-form is [reg+reg] addressing; D-form is [reg+imm] addressing. We can do simple [reg] addressing in either form as well. Whether D-form can be used for some access depends on many factors (ISA version, mode of the datum, alignment, and how big the offset is of course). But the usual legitimate_address_p hook should do fine. The ivopts code already has an addr_offset_valid_p function, maybe that could be adjusted for this? Segher