From: John David Anglin Date: Sun, 13 Sep 2020 18:50:07 +0000 (+0000) Subject: Improve costs for DImode shifts of interger constants. X-Git-Tag: releases/gcc-10.3.0~908 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23ee7de0be05b0407aaa19b9e7d044c7b6fdd235;p=thirdparty%2Fgcc.git Improve costs for DImode shifts of interger constants. 2020-09-13 Roger Sayle gcc/ChangeLog * config/pa/pa.c (hppa_rtx_costs) [ASHIFT, ASHIFTRT, LSHIFTRT]: Provide accurate costs for DImode shifts of integer constants. --- diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 55185aab6504..2461f2ed7161 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -1630,13 +1630,16 @@ hppa_rtx_costs (rtx x, machine_mode mode, int outer_code, case ASHIFT: if (mode == DImode) { - if (TARGET_64BIT) - *total = COSTS_N_INSNS (3); - else if (REG_P (XEXP (x, 0)) && CONST_INT_P (XEXP (x, 1))) + if (REG_P (XEXP (x, 0)) && CONST_INT_P (XEXP (x, 1))) { - *total = COSTS_N_INSNS (2); + if (TARGET_64BIT) + *total = COSTS_N_INSNS (1); + else + *total = COSTS_N_INSNS (2); return true; } + else if (TARGET_64BIT) + *total = COSTS_N_INSNS (3); else if (speed) *total = COSTS_N_INSNS (13); else @@ -1653,13 +1656,16 @@ hppa_rtx_costs (rtx x, machine_mode mode, int outer_code, case ASHIFTRT: if (mode == DImode) { - if (TARGET_64BIT) - *total = COSTS_N_INSNS (3); - else if (REG_P (XEXP (x, 0)) && CONST_INT_P (XEXP (x, 1))) + if (REG_P (XEXP (x, 0)) && CONST_INT_P (XEXP (x, 1))) { - *total = COSTS_N_INSNS (2); + if (TARGET_64BIT) + *total = COSTS_N_INSNS (1); + else + *total = COSTS_N_INSNS (2); return true; } + else if (TARGET_64BIT) + *total = COSTS_N_INSNS (3); else if (speed) *total = COSTS_N_INSNS (14); else @@ -1676,13 +1682,16 @@ hppa_rtx_costs (rtx x, machine_mode mode, int outer_code, case LSHIFTRT: if (mode == DImode) { - if (TARGET_64BIT) - *total = COSTS_N_INSNS (2); - else if (REG_P (XEXP (x, 0)) && CONST_INT_P (XEXP (x, 1))) + if (REG_P (XEXP (x, 0)) && CONST_INT_P (XEXP (x, 1))) { - *total = COSTS_N_INSNS (2); + if (TARGET_64BIT) + *total = COSTS_N_INSNS (1); + else + *total = COSTS_N_INSNS (2); return true; } + else if (TARGET_64BIT) + *total = COSTS_N_INSNS (2); else if (speed) *total = COSTS_N_INSNS (12); else