diff options
| author | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-27 23:00:57 +0000 |
|---|---|---|
| committer | dje <dje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-27 23:00:57 +0000 |
| commit | 37419db7707bdf2c87c6c5afcbddebfbacb215db (patch) | |
| tree | 1f07b6f19a05e0aae2020b433c8a7b2c43c1097f | |
| parent | f395d09d54659f76bec2b9e25950ab43e43c5ee6 (diff) | |
| download | ppe42-gcc-37419db7707bdf2c87c6c5afcbddebfbacb215db.tar.gz ppe42-gcc-37419db7707bdf2c87c6c5afcbddebfbacb215db.zip | |
PR target/16800
* config/rs6000/rs6000.c (rs6000_rtx_costs): Improve accuracy of
EQ, GTU, and LTU costs. Add costs for GT, LT, and UNORDERED.
Distinguish between SImode and DImode CONST_INT.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91399 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/config/rs6000/rs6000.c | 75 |
2 files changed, 59 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6def113843b..cc56027bc39 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-11-28 David Edelsohn <edelsohn@gnu.org> + + PR target/16800 + * config/rs6000/rs6000.c (rs6000_rtx_costs): Improve accuracy of + EQ, GTU, and LTU costs. Add costs for GT, LT, and UNORDERED. + Distinguish between SImode and DImode CONST_INT. + 2004-11-28 Andreas Fischer <a_fisch@gmx.de> Alan Modra <amodra@bigpond.net.au> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index ca919b35a0f..ab80a47bdf2 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -18050,16 +18050,15 @@ rs6000_rtx_costs (rtx x, int code, int outer_code, int *total) || outer_code == MINUS) && (CONST_OK_FOR_LETTER_P (INTVAL (x), 'I') || CONST_OK_FOR_LETTER_P (INTVAL (x), 'L'))) - || ((outer_code == IOR || outer_code == XOR) - && (CONST_OK_FOR_LETTER_P (INTVAL (x), 'K') - || CONST_OK_FOR_LETTER_P (INTVAL (x), 'L'))) - || ((outer_code == DIV || outer_code == UDIV - || outer_code == MOD || outer_code == UMOD) - && exact_log2 (INTVAL (x)) >= 0) || (outer_code == AND && (CONST_OK_FOR_LETTER_P (INTVAL (x), 'K') - || CONST_OK_FOR_LETTER_P (INTVAL (x), 'L') + || (CONST_OK_FOR_LETTER_P (INTVAL (x), + mode == SImode ? 'L' : 'J')) || mask_operand (x, VOIDmode))) + || ((outer_code == IOR || outer_code == XOR) + && (CONST_OK_FOR_LETTER_P (INTVAL (x), 'K') + || (CONST_OK_FOR_LETTER_P (INTVAL (x), + mode == SImode ? 'L' : 'J')))) || outer_code == ASHIFT || outer_code == ASHIFTRT || outer_code == LSHIFTRT @@ -18068,9 +18067,21 @@ rs6000_rtx_costs (rtx x, int code, int outer_code, int *total) || outer_code == ZERO_EXTRACT || (outer_code == MULT && CONST_OK_FOR_LETTER_P (INTVAL (x), 'I')) + || ((outer_code == DIV || outer_code == UDIV + || outer_code == MOD || outer_code == UMOD) + && exact_log2 (INTVAL (x)) >= 0) || (outer_code == COMPARE && (CONST_OK_FOR_LETTER_P (INTVAL (x), 'I') - || CONST_OK_FOR_LETTER_P (INTVAL (x), 'K')))) + || CONST_OK_FOR_LETTER_P (INTVAL (x), 'K'))) + || (outer_code == EQ + && (CONST_OK_FOR_LETTER_P (INTVAL (x), 'I') + || CONST_OK_FOR_LETTER_P (INTVAL (x), 'K') + || (CONST_OK_FOR_LETTER_P (INTVAL (x), + mode == SImode ? 'L' : 'J')))) + || (outer_code == GTU + && CONST_OK_FOR_LETTER_P (INTVAL (x), 'I')) + || (outer_code == LTU + && CONST_OK_FOR_LETTER_P (INTVAL (x), 'P'))) { *total = 0; return true; @@ -18348,26 +18359,44 @@ rs6000_rtx_costs (rtx x, int code, int outer_code, int *total) case EQ: case GTU: case LTU: - if (mode == Pmode) + /* Carry bit requires mode == Pmode. + NEG or PLUS already counted so only add one. */ + if (mode == Pmode + && (outer_code == NEG || outer_code == PLUS)) { - switch (outer_code) + *total = COSTS_N_INSNS (1); + return true; + } + if (outer_code == SET) + { + if (XEXP (x, 1) == const0_rtx) { - case PLUS: - case NEG: - /* PLUS or NEG already counted so only add one more. */ - *total = COSTS_N_INSNS (1); - break; - case SET: - *total = COSTS_N_INSNS (3); - break; - case COMPARE: - *total = 0; + *total = COSTS_N_INSNS (2); return true; - default: - break; } - return false; + else if (mode == Pmode) + { + *total = COSTS_N_INSNS (3); + return false; + } + } + /* FALLTHRU */ + + case GT: + case LT: + case UNORDERED: + if (outer_code == SET && (XEXP (x, 1) == const0_rtx)) + { + *total = COSTS_N_INSNS (2); + return true; } + /* CC COMPARE. */ + if (outer_code == COMPARE) + { + *total = 0; + return true; + } + break; default: break; |

