On Fri, Oct 27, 2017 at 02:27:08PM +0100, Richard Sandiford wrote:
> This patch reworks aarch64_simd_valid_immediate so that
> it's easier to add SVE support.  The main changes are:
> 
> - make simd_immediate_info easier to construct
> - replace the while (1) { ... break; } blocks with checks that use
>   the full 64-bit value of the constant
> - treat floating-point modes as integers if they aren't valid
>   as floating-point values

This is a nice cleanup. I'm very pleased that we can now read which
conditions you are checking rather than trying to derive them from the
old CHECK macros.

Thanks for the patch, this is OK for trunk.

Reviewed-by: James Greenhalgh <james.greenha...@arm.com>

James



> 
> 
> 2017-10-26  Richard Sandiford  <richard.sandif...@linaro.org>
>           Alan Hayward  <alan.hayw...@arm.com>
>           David Sherwood  <david.sherw...@arm.com>
> 
> gcc/
>       * config/aarch64/aarch64-protos.h (aarch64_output_simd_mov_immediate):
>       Remove the mode argument.
>       (aarch64_simd_valid_immediate): Remove the mode and inverse
>       arguments.
>       * config/aarch64/iterators.md (bitsize): New iterator.
>       * config/aarch64/aarch64-simd.md (*aarch64_simd_mov<mode>, and<mode>3)
>       (ior<mode>3): Update calls to aarch64_output_simd_mov_immediate.
>       * config/aarch64/constraints.md (Do, Db, Dn): Update calls to
>       aarch64_simd_valid_immediate.
>       * config/aarch64/predicates.md (aarch64_reg_or_orr_imm): Likewise.
>       (aarch64_reg_or_bic_imm): Likewise.
>       * config/aarch64/aarch64.c (simd_immediate_info): Replace mvn
>       with an insn_type enum and msl with a modifier_type enum.
>       Replace element_width with a scalar_mode.  Change the shift
>       to unsigned int.  Add constructors for scalar_float_mode and
>       scalar_int_mode elements.
>       (aarch64_vect_float_const_representable_p): Delete.
>       (aarch64_can_const_movi_rtx_p, aarch64_legitimate_constant_p)
>       (aarch64_simd_scalar_immediate_valid_for_move)
>       (aarch64_simd_make_constant): Update call to
>       aarch64_simd_valid_immediate.
>       (aarch64_advsimd_valid_immediate_hs): New function.
>       (aarch64_advsimd_valid_immediate): Likewise.
>       (aarch64_simd_valid_immediate): Remove mode and inverse
>       arguments.  Rewrite to use the above.  Use const_vec_duplicate_p
>       to detect duplicated constants and use aarch64_float_const_zero_rtx_p
>       and aarch64_float_const_representable_p on the result.
>       (aarch64_output_simd_mov_immediate): Remove mode argument.
>       Update call to aarch64_simd_valid_immediate and use of
>       simd_immediate_info.
>       (aarch64_output_scalar_simd_mov_immediate): Update call
>       accordingly.
> 
> gcc/testsuite/
>       * gcc.target/aarch64/vect-movi.c (movi_float_lsl24): New function.
>       (main): Call it.
> 
   

Reply via email to