This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] rs6000: Add eI constraint for 34-bit constants
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Bill Schmidt <wschmidt at linux dot ibm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 29 May 2019 14:19:52 -0500
- Subject: Re: [PATCH] rs6000: Add eI constraint for 34-bit constants
- References: <c2ceb61a-44c7-db9a-021d-054ca3a26ecf@linux.ibm.com>
Hi!
On Wed, May 29, 2019 at 01:08:28PM -0500, Bill Schmidt wrote:
> +/* Whether a given VALUE is a valid 16- or 34-bit signed offset. EXTRA is the
> + amount that we can't touch at the high end of the range (typically if the
> + address is split into smaller addresses, the extra covers the addresses
> + which might be generated when the insn is split). */
> +#define SIGNED_16BIT_OFFSET_P(VALUE, EXTRA) \
> + IN_RANGE (VALUE, \
> + ~(HOST_WIDE_INT_1 << 15), \
> + (HOST_WIDE_INT_1 << 15) - 1 - (EXTRA))
> +
> +#define SIGNED_34BIT_OFFSET_P(VALUE, EXTRA) \
> + IN_RANGE (VALUE, \
> + ~(HOST_WIDE_INT_1 << 33), \
> + (HOST_WIDE_INT_1 << 33) - 1 - (EXTRA))
The ~ should be - I think?
Okay for trunk with that change. Thanks,
Segher