diff options
author | Richard Sandiford <rsandifo@nildram.co.uk> | 2007-10-05 08:34:01 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2007-10-05 08:34:01 +0000 |
commit | 96f38a34e91eb790cdcba0b30aeffa57b12a9dd2 (patch) | |
tree | 22e7bc9fa6eec1db31a72bdd1fb2cb9a588f6698 /gcc | |
parent | afd82ef5ab97b47cbb9413da64a8bf6929caf25a (diff) | |
download | gcc-96f38a34e91eb790cdcba0b30aeffa57b12a9dd2.zip gcc-96f38a34e91eb790cdcba0b30aeffa57b12a9dd2.tar.gz gcc-96f38a34e91eb790cdcba0b30aeffa57b12a9dd2.tar.bz2 |
re PR target/33635 (Bootstrap broken on mips-sgi-irix6.5)
gcc/
PR target/33635
* config/mips/mips.c (mips_register_move_cost): Rewrite to use
subset checks. Make the cost of FPR -> FPR moves depend on
mips_mode_ok_for_mov_fmt_p.
gcc/testsuite/
PR target/33635
* gcc.target/mips/pr33635-1.c: New test.
From-SVN: r129031
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 79 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/mips/pr33635-1.c | 13 |
4 files changed, 57 insertions, 47 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3dabeea..fba43b2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-10-05 Richard Sandiford <rsandifo@nildram.co.uk> + + PR target/33635 + * config/mips/mips.c (mips_register_move_cost): Rewrite to use + subset checks. Make the cost of FPR -> FPR moves depend on + mips_mode_ok_for_mov_fmt_p. + 2007-10-04 Doug Kwan <dougkwan@google.com> * gthr-posix.h (__gthread_cond_broadcast, __gthread_cond_wait, diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 64377b5..889997d 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -10969,69 +10969,54 @@ mips_init_libfuncs (void) we need to use. This gets pretty messy, but it is feasible. */ int -mips_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, +mips_register_move_cost (enum machine_mode mode, enum reg_class to, enum reg_class from) { - if (from == M16_REGS && reg_class_subset_p (to, GENERAL_REGS)) - return 2; - else if (from == M16_NA_REGS && reg_class_subset_p (to, GENERAL_REGS)) - return 2; - else if (reg_class_subset_p (from, GENERAL_REGS)) + if (TARGET_MIPS16) { - if (to == M16_REGS) - return 2; - else if (to == M16_NA_REGS) - return 2; - else if (reg_class_subset_p (to, GENERAL_REGS)) + if (reg_class_subset_p (from, GENERAL_REGS) + && reg_class_subset_p (to, GENERAL_REGS)) { - if (TARGET_MIPS16) - return 4; - else + if (reg_class_subset_p (from, M16_REGS) + || reg_class_subset_p (to, M16_REGS)) return 2; - } - else if (to == FP_REGS) - return 4; - else if (reg_class_subset_p (to, ACC_REGS)) - { - if (TARGET_MIPS16) - return 12; - else - return 6; - } - else if (reg_class_subset_p (to, ALL_COP_REGS)) - { - return 5; + /* Two MOVEs. */ + return 4; } } - else if (from == FP_REGS) + else if (reg_class_subset_p (from, GENERAL_REGS)) { if (reg_class_subset_p (to, GENERAL_REGS)) - return 4; - else if (to == FP_REGS) return 2; - else if (to == ST_REGS) - return 8; + if (reg_class_subset_p (to, FP_REGS)) + return 4; + if (reg_class_subset_p (to, ALL_COP_AND_GR_REGS)) + return 5; + if (reg_class_subset_p (to, ACC_REGS)) + return 6; } - else if (reg_class_subset_p (from, ACC_REGS)) + else if (reg_class_subset_p (to, GENERAL_REGS)) { - if (reg_class_subset_p (to, GENERAL_REGS)) - { - if (TARGET_MIPS16) - return 12; - else - return 6; - } + if (reg_class_subset_p (from, FP_REGS)) + return 4; + if (reg_class_subset_p (from, ST_REGS)) + /* LUI followed by MOVF. */ + return 4; + if (reg_class_subset_p (from, ALL_COP_AND_GR_REGS)) + return 5; + if (reg_class_subset_p (from, ACC_REGS)) + return 6; } - else if (from == ST_REGS && reg_class_subset_p (to, GENERAL_REGS)) - return 4; - else if (reg_class_subset_p (from, ALL_COP_REGS)) + else if (reg_class_subset_p (from, FP_REGS)) { - return 5; + if (reg_class_subset_p (to, FP_REGS) + && mips_mode_ok_for_mov_fmt_p (mode)) + return 4; + if (reg_class_subset_p (to, ST_REGS)) + /* An expensive sequence. */ + return 8; } - /* Fall through. - ??? What cases are these? Shouldn't we return 2 here? */ - return 12; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1ef0d60..2252f67 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-10-05 Richard Sandiford <rsandifo@nildram.co.uk> + + PR target/33635 + * gcc.target/mips/pr33635-1.c: New test. + 2007-10-04 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/33253 diff --git a/gcc/testsuite/gcc.target/mips/pr33635-1.c b/gcc/testsuite/gcc.target/mips/pr33635-1.c new file mode 100644 index 0000000..44a804e --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/pr33635-1.c @@ -0,0 +1,13 @@ +/* { dg-mips-options "-mabi=64 -O2" } */ + +long double __powitf2 (long double x, int m) +{ + long double y = x; + while (m >>= 1) + { + x = x * x; + if (m % 2) + y = y * x; + } + return y; +} |