From: Richard Sandiford Date: Thu, 7 Jul 2011 15:05:42 +0000 (+0000) Subject: reload1.c (choose_reload_regs): Use mode sizes to check whether an old reload registe... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f125532e6f26606080d77738c0a385a20733a39;p=gcc.git reload1.c (choose_reload_regs): Use mode sizes to check whether an old reload register completely defines the... gcc/ * reload1.c (choose_reload_regs): Use mode sizes to check whether an old reload register completely defines the required value. gcc/testsuite/ * gcc.target/arm/neon-modes-3.c: New test. From-SVN: r175980 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7a7c0ecdd53..ea7c24b94b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-07-07 Richard Sandiford + + * reload1.c (choose_reload_regs): Use mode sizes to check whether + an old reload register completely defines the required value. + 2011-07-07 Richard Guenther * fold-const.c (fold_unary_loc): Do not strip sign-changes diff --git a/gcc/reload1.c b/gcc/reload1.c index 7f84fc81416..499412c0ba4 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -6481,6 +6481,8 @@ choose_reload_regs (struct insn_chain *chain) if (regno >= 0 && reg_last_reload_reg[regno] != 0 + && (GET_MODE_SIZE (GET_MODE (reg_last_reload_reg[regno])) + >= GET_MODE_SIZE (mode) + byte) #ifdef CANNOT_CHANGE_MODE_CLASS /* Verify that the register it's in can be used in mode MODE. */ @@ -6492,24 +6494,12 @@ choose_reload_regs (struct insn_chain *chain) { enum reg_class rclass = rld[r].rclass, last_class; rtx last_reg = reg_last_reload_reg[regno]; - enum machine_mode need_mode; i = REGNO (last_reg); i += subreg_regno_offset (i, GET_MODE (last_reg), byte, mode); last_class = REGNO_REG_CLASS (i); - if (byte == 0) - need_mode = mode; - else - need_mode - = smallest_mode_for_size - (GET_MODE_BITSIZE (mode) + byte * BITS_PER_UNIT, - GET_MODE_CLASS (mode) == MODE_PARTIAL_INT - ? MODE_INT : GET_MODE_CLASS (mode)); - - if ((GET_MODE_SIZE (GET_MODE (last_reg)) - >= GET_MODE_SIZE (need_mode)) - && reg_reloaded_contents[i] == regno + if (reg_reloaded_contents[i] == regno && TEST_HARD_REG_BIT (reg_reloaded_valid, i) && HARD_REGNO_MODE_OK (i, rld[r].mode) && (TEST_HARD_REG_BIT (reg_class_contents[(int) rclass], i) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index abf696c8260..9c5f80a31b5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-07-07 Richard Sandiford + + * gcc.target/arm/neon-modes-3.c: New test. + 2011-07-07 Uros Bizjak * gcc.dg/graphite/pr37485.c (dg-options): Add -fno-loop-strip-mine diff --git a/gcc/testsuite/gcc.target/arm/neon-modes-3.c b/gcc/testsuite/gcc.target/arm/neon-modes-3.c new file mode 100644 index 00000000000..fe8187570b5 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/neon-modes-3.c @@ -0,0 +1,61 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-options "-O" } */ +/* { dg-add-options arm_neon } */ + +#include + +void f1 (volatile float32x4_t *dest, volatile float32x4x4_t *src, int n) +{ + float32x4x4_t a5, a6, a7, a8, a9; + int i; + + a5 = *src; + a6 = *src; + a7 = *src; + a8 = *src; + a9 = *src; + while (n--) + { + for (i = 0; i < 8; i++) + { + float32x4x4_t a0, a1, a2, a3, a4; + + a0 = *src; + a1 = *src; + a2 = *src; + a3 = *src; + a4 = *src; + *src = a0; + *dest = a0.val[0]; + *dest = a0.val[3]; + *src = a1; + *dest = a1.val[0]; + *dest = a1.val[3]; + *src = a2; + *dest = a2.val[0]; + *dest = a2.val[3]; + *src = a3; + *dest = a3.val[0]; + *dest = a3.val[3]; + *src = a4; + *dest = a4.val[0]; + *dest = a4.val[3]; + } + *src = a5; + *dest = a5.val[0]; + *dest = a5.val[3]; + *src = a6; + *dest = a6.val[0]; + *dest = a6.val[3]; + *src = a7; + *dest = a7.val[0]; + *dest = a7.val[3]; + *src = a8; + *dest = a8.val[0]; + *dest = a8.val[3]; + *src = a9; + *dest = a9.val[0]; + *dest = a9.val[3]; + } +}