diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2011-09-29 15:03:06 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2011-09-29 15:03:06 +0000 |
commit | 2af8e257c9387aec8beb091f25684d0c14a194ec (patch) | |
tree | ac3987acf270e78ee728d7301549854f65d862b3 /gcc | |
parent | 99e2796b5c6ec4d6fff1b5aa0ba1fd9d19a1f1a2 (diff) | |
download | gcc-2af8e257c9387aec8beb091f25684d0c14a194ec.zip gcc-2af8e257c9387aec8beb091f25684d0c14a194ec.tar.gz gcc-2af8e257c9387aec8beb091f25684d0c14a194ec.tar.bz2 |
arm-protos.h (arm_modes_tieable_p): Declare.
gcc/
* config/arm/arm-protos.h (arm_modes_tieable_p): Declare.
* config/arm/arm.h (MODES_TIEABLE_P): Use it.
* config/arm/arm.c (arm_modes_tieable_p): New function. Allow
NEON vector and structure modes to be tied.
From-SVN: r179355
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/arm/arm-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 23 | ||||
-rw-r--r-- | gcc/config/arm/arm.h | 7 |
4 files changed, 32 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 71f9b59..5a1d101 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-09-29 Richard Sandiford <richard.sandiford@linaro.org> + + * config/arm/arm-protos.h (arm_modes_tieable_p): Declare. + * config/arm/arm.h (MODES_TIEABLE_P): Use it. + * config/arm/arm.c (arm_modes_tieable_p): New function. Allow + NEON vector and structure modes to be tied. + 2011-09-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * graphite-scop-detection.c (make_close_phi_nodes_unique): New diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 9030e96..23a29c6 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -46,6 +46,7 @@ extern void arm_output_fn_unwind (FILE *, bool); extern bool arm_vector_mode_supported_p (enum machine_mode); extern bool arm_small_register_classes_for_mode_p (enum machine_mode); extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode); +extern bool arm_modes_tieable_p (enum machine_mode, enum machine_mode); extern int const_ok_for_arm (HOST_WIDE_INT); extern int const_ok_for_op (HOST_WIDE_INT, enum rtx_code); extern int arm_split_constant (RTX_CODE, enum machine_mode, rtx, diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index e730881..5161439 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -18260,6 +18260,29 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) && regno <= LAST_FPA_REGNUM); } +/* Implement MODES_TIEABLE_P. */ + +bool +arm_modes_tieable_p (enum machine_mode mode1, enum machine_mode mode2) +{ + if (GET_MODE_CLASS (mode1) == GET_MODE_CLASS (mode2)) + return true; + + /* We specifically want to allow elements of "structure" modes to + be tieable to the structure. This more general condition allows + other rarer situations too. */ + if (TARGET_NEON + && (VALID_NEON_DREG_MODE (mode1) + || VALID_NEON_QREG_MODE (mode1) + || VALID_NEON_STRUCT_MODE (mode1)) + && (VALID_NEON_DREG_MODE (mode2) + || VALID_NEON_QREG_MODE (mode2) + || VALID_NEON_STRUCT_MODE (mode2))) + return true; + + return false; +} + /* For efficiency and historical reasons LO_REGS, HI_REGS and CC_REGS are not used in arm mode. */ diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index a76988e..993e3a0 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -975,12 +975,7 @@ extern int arm_arch_thumb_hwdiv; #define HARD_REGNO_MODE_OK(REGNO, MODE) \ arm_hard_regno_mode_ok ((REGNO), (MODE)) -/* Value is 1 if it is a good idea to tie two pseudo registers - when one has mode MODE1 and one has mode MODE2. - If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, - for any hard reg, then this must be 0 for correct output. */ -#define MODES_TIEABLE_P(MODE1, MODE2) \ - (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2)) +#define MODES_TIEABLE_P(MODE1, MODE2) arm_modes_tieable_p (MODE1, MODE2) #define VALID_IWMMXT_REG_MODE(MODE) \ (arm_vector_mode_supported_p (MODE) || (MODE) == DImode) |