From: Richard Kenner Date: Fri, 6 May 1994 16:51:22 +0000 (-0400) Subject: (CONST_COSTS): Revise all costs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8b7b2e363992f3001ad15114e3305600e14170c4;p=gcc.git (CONST_COSTS): Revise all costs. From-SVN: r7225 --- diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 2f247161113..ba135336986 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -1312,17 +1312,28 @@ extern char *current_function_name; of a switch statement. If the code is computed here, return it with a return statement. Otherwise, break from the switch. - We only care about the cost if it is valid in an insn, so all constants - are cheap. */ + If this is an 8-bit constant, return zero since it can be used + nearly anywhere with no cost. If it is a valid operand for an + ADD or AND, likewise return 0 if we know it will be used in that + context. Otherwise, return 2 since it might be used there later. + All other constants take at least two insns. */ #define CONST_COSTS(RTX,CODE,OUTER_CODE) \ case CONST_INT: \ + if (INTVAL (RTX) >= 0 && INTVAL (RTX) < 2546) \ + return 0; \ case CONST_DOUBLE: \ - return 0; \ + if (((OUTER_CODE) == PLUS && add_operand (RTX, VOIDmode)) \ + || ((OUTER_CODE) == AND && and_operand (RTX, VOIDmode))) \ + return 0; \ + else if (add_operand (RTX, VOIDmode) || and_operand (RTX, VOIDmode)) \ + return 2; \ + else \ + return COSTS_N_INSNS (2); \ case CONST: \ case SYMBOL_REF: \ case LABEL_REF: \ - return 6; \ + return COSTS_N_INSNS (3); /* Provide the costs of a rtl expression. This is in the body of a switch on CODE. */