From: Roger Sayle Date: Mon, 12 Jul 2004 13:42:28 +0000 (+0000) Subject: rs6000.c (rs6000_rtx_costs): Indicate that the rs6000 doesn't have shift-and-add... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=938bf7475d34bb808144dff4ea0903026bd70b28;p=gcc.git rs6000.c (rs6000_rtx_costs): Indicate that the rs6000 doesn't have shift-and-add or shift-and-sub... * config/rs6000/rs6000.c (rs6000_rtx_costs): Indicate that the rs6000 doesn't have shift-and-add or shift-and-sub instructions by returning the cost of a multiplication plus an addition. From-SVN: r84556 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1cac842bde3..e3d670dece4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-07-12 Roger Sayle + + * config/rs6000/rs6000.c (rs6000_rtx_costs): Indicate that the + rs6000 doesn't have shift-and-add or shift-and-sub instructions + by returning the cost of a multiplication plus an addition. + 2004-07-12 Paolo Bonzini PR tree-optimization/14107 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 713a09bcc96..0722ed75021 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -16535,6 +16535,12 @@ rs6000_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, : rs6000_cost->fp; else if (mode == SFmode) *total = rs6000_cost->fp; + else if (GET_CODE (XEXP (x, 0)) == MULT) + { + /* The rs6000 doesn't have shift-and-add instructions. */ + rs6000_rtx_costs (XEXP (x, 0), MULT, PLUS, total); + *total += COSTS_N_INSNS (1); + } else *total = ((GET_CODE (XEXP (x, 1)) == CONST_INT && ((unsigned HOST_WIDE_INT) (INTVAL (XEXP (x, 1)) @@ -16551,6 +16557,12 @@ rs6000_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, : rs6000_cost->fp; else if (mode == SFmode) *total = rs6000_cost->fp; + else if (GET_CODE (XEXP (x, 0)) == MULT) + { + /* The rs6000 doesn't have shift-and-sub instructions. */ + rs6000_rtx_costs (XEXP (x, 0), MULT, MINUS, total); + *total += COSTS_N_INSNS (1); + } else *total = COSTS_N_INSNS (1); return true;