This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ARM, LRA] Prepare ARM build with LRA
- From: Yvan Roux <yvan dot roux at linaro dot org>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Vladimir Makarov <vmakarov at redhat dot com>, "rdsandiford at googlemail dot com" <rdsandiford at googlemail dot com>, Richard Earnshaw <rearnsha at arm dot com>, Marcus Shawcroft <marcus dot shawcroft at arm dot com>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>, Matthew Gretton-Dann <matthew dot gretton-dann at linaro dot org>, Patch Tracking <patches at linaro dot org>, Richard Henderson <rth at redhat dot com>
- Date: Tue, 24 Sep 2013 13:06:24 +0200
- Subject: Re: [PATCH, ARM, LRA] Prepare ARM build with LRA
- Authentication-results: sourceware.org; auth=none
- References: <CAD57uCfrF9Ns=jghNJOD07p5wg+_zcTc6wmfOknau3iSg4FvWg at mail dot gmail dot com> <CAD57uCcQrc4ooprKbHj5OjpVK6DGgTsXkh+9EQGrnZUVVYLEog at mail dot gmail dot com> <CAD57uCeb_AqkjU8ptE3aggnnHi+WasrLxMjnR_YGqZ4+XJ6Pgw at mail dot gmail dot com> <1453242 dot WdQ8ekkeyQ at polaris>
Hi Eric,
Thanks for the review.
> +/* Return true if X is a sign_extract or zero_extract from the least
> + significant bit. */
> +
> +static bool
> +lsb_bitfield_op_p (rtx x)
> +{
> + if (GET_RTX_CLASS (GET_CODE (x)) == RTX_BITFIELD_OPS)
> + {
> + enum machine_mode mode = GET_MODE(x);
> + unsigned HOST_WIDE_INT len = INTVAL (XEXP (x, 1));
> + HOST_WIDE_INT pos = INTVAL (XEXP (x, 2));
> +
> + return (pos == (BITS_BIG_ENDIAN ? GET_MODE_PRECISION (mode) - len :
> 0));
>
> It seems strange to use the destination mode to decide whether this is the LSB
> of the source.
Indeed, I think it has to be the mode of loc, but I just wonder if it
is not always the same, as in the doc it is written that mode m is the
same as the mode that would be used for loc if it were a register.
> +/* Return true if X is a shifting operation. */
> +
> +static bool
> +shift_code_p (rtx x)
> +{
> + return (GET_CODE (x) == ASHIFT
> + || GET_CODE (x) == ASHIFTRT
> + || GET_CODE (x) == LSHIFTRT
> + || GET_CODE (x) == ROTATE
> + || GET_CODE (x) == ROTATERT);
> +}
>
> ROTATE and ROTATERT aren't really shifting operations though, so are they
> really needed here?
According to gcc internals, ROTATE and ROTATERT are similar to the
shifting operations, but to be more accurate maybe we can rename
shif_code_p in shift_and _rotate_code_p rotation are used in arm
address calculation, and thus need to be handle in must_be_index_p
and set_address_index
Thanks,
Yvan