Re: [PATCH], V4, patch #9 [part of patch #4.2], Add prefixed address offset checks
On Wed, Oct 09, 2019 at 07:40:23PM -0400, Michael Meissner wrote: > On Wed, Oct 09, 2019 at 04:56:48PM -0500, Segher Boessenkool wrote: > > On Fri, Oct 04, 2019 at 08:29:11AM -0400, Michael Meissner wrote: > > > @@ -8651,6 +8675,11 @@ rs6000_legitimate_address_p (machine_mod > > >&& mode_supports_pre_incdec_p (mode) > > >&& legitimate_indirect_address_p (XEXP (x, 0), reg_ok_strict)) > > > return 1; > > > + > > > + /* Handle prefixed addresses (PC-relative or 34-bit offset). */ > > > + if (address_is_prefixed (x, mode, NON_PREFIXED_DEFAULT)) > > > +return 1; > > > > Is this correct? Are addresses with a larger offset always legitimate? > > I don't see why that would be the case. > The function address_to_insn_form, which is called by address_is_prefixed, > checks if the offset is 34-bits or less Ah, right. And "address_is_prefixed" is a long enough name, "address_is_a_valid_prefixed_address" isn't better ;-) Segher
Re: [PATCH], V4, patch #9 [part of patch #4.2], Add prefixed address offset checks
On Wed, Oct 09, 2019 at 04:56:48PM -0500, Segher Boessenkool wrote: > Hi! > > On Fri, Oct 04, 2019 at 08:29:11AM -0400, Michael Meissner wrote: > > @@ -8651,6 +8675,11 @@ rs6000_legitimate_address_p (machine_mod > >&& mode_supports_pre_incdec_p (mode) > >&& legitimate_indirect_address_p (XEXP (x, 0), reg_ok_strict)) > > return 1; > > + > > + /* Handle prefixed addresses (PC-relative or 34-bit offset). */ > > + if (address_is_prefixed (x, mode, NON_PREFIXED_DEFAULT)) > > +return 1; > > Is this correct? Are addresses with a larger offset always legitimate? > I don't see why that would be the case. > > The rest of the patch looks good, thanks. This patch BTW is the same as the new V5 patch #1. -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797
Re: [PATCH], V4, patch #9 [part of patch #4.2], Add prefixed address offset checks
On Wed, Oct 09, 2019 at 04:56:48PM -0500, Segher Boessenkool wrote: > Hi! > > On Fri, Oct 04, 2019 at 08:29:11AM -0400, Michael Meissner wrote: > > @@ -8651,6 +8675,11 @@ rs6000_legitimate_address_p (machine_mod > >&& mode_supports_pre_incdec_p (mode) > >&& legitimate_indirect_address_p (XEXP (x, 0), reg_ok_strict)) > > return 1; > > + > > + /* Handle prefixed addresses (PC-relative or 34-bit offset). */ > > + if (address_is_prefixed (x, mode, NON_PREFIXED_DEFAULT)) > > +return 1; > > Is this correct? Are addresses with a larger offset always legitimate? > I don't see why that would be the case. > > The rest of the patch looks good, thanks. As far as I know, with the exception of SDmode (which is not allowed to have an offset) all other modes that use D*-form addresses would work with a prefixed instruction, assuming the offset fits in the 34-bit field. The function address_to_insn_form, which is called by address_is_prefixed, checks if the offset is 34-bits or less, whether the mode is SDmode, etc. are all valid. -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797
Re: [PATCH], V4, patch #9 [part of patch #4.2], Add prefixed address offset checks
Hi! On Fri, Oct 04, 2019 at 08:29:11AM -0400, Michael Meissner wrote: > @@ -8651,6 +8675,11 @@ rs6000_legitimate_address_p (machine_mod >&& mode_supports_pre_incdec_p (mode) >&& legitimate_indirect_address_p (XEXP (x, 0), reg_ok_strict)) > return 1; > + > + /* Handle prefixed addresses (PC-relative or 34-bit offset). */ > + if (address_is_prefixed (x, mode, NON_PREFIXED_DEFAULT)) > +return 1; Is this correct? Are addresses with a larger offset always legitimate? I don't see why that would be the case. The rest of the patch looks good, thanks. Segher