From c5d9672394dcf9cb8314d1c1fa85dba05c9c1128 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Wed, 29 Apr 2009 12:44:00 +0000 Subject: [PATCH] bfin.c (bfin_register_move_cost): Test for subsets of DREGS rather than comparing directly. * config/bfin/bfin.c (bfin_register_move_cost): Test for subsets of DREGS rather than comparing directly. Remove code that tries to account for latencies. From-SVN: r146956 --- gcc/ChangeLog | 4 ++++ gcc/config/bfin/bfin.c | 10 ++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 39214fbc172..883f1b84f6f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -5,6 +5,10 @@ Remove special case testing for last insn of inner loops. Don't fail if the loop ends with a jump, emit an extra nop instead. + * config/bfin/bfin.c (bfin_register_move_cost): Test for subsets of + DREGS rather than comparing directly. Remove code that tries to + account for latencies. + 2009-04-29 Richard Guenther PR tree-optimization/39941 diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index 43682a3dd57..6a77c57b092 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -2331,20 +2331,14 @@ bfin_register_move_cost (enum machine_mode mode, enum reg_class class1, enum reg_class class2) { /* These need secondary reloads, so they're more expensive. */ - if ((class1 == CCREGS && class2 != DREGS) - || (class1 != DREGS && class2 == CCREGS)) + if ((class1 == CCREGS && !reg_class_subset_p (class2, DREGS)) + || (class2 == CCREGS && !reg_class_subset_p (class1, DREGS))) return 4; /* If optimizing for size, always prefer reg-reg over reg-memory moves. */ if (optimize_size) return 2; - /* There are some stalls involved when moving from a DREG to a different - class reg, and using the value in one of the following instructions. - Attempt to model this by slightly discouraging such moves. */ - if (class1 == DREGS && class2 != DREGS) - return 2 * 2; - if (GET_MODE_CLASS (mode) == MODE_INT) { /* Discourage trying to use the accumulators. */