aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/pa
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2020-09-13 18:47:59 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2020-09-13 18:47:59 +0000
commit2fd157813c4964033e156ccb7df8889cd2afee99 (patch)
treedc630961840d3916fc66e1d8c05fca0c7e82b68d /gcc/config/pa
parent5de41c886207a3a0ff1f44ce0a5a644e9d9a17f8 (diff)
downloadgcc-2fd157813c4964033e156ccb7df8889cd2afee99.zip
gcc-2fd157813c4964033e156ccb7df8889cd2afee99.tar.gz
gcc-2fd157813c4964033e156ccb7df8889cd2afee99.tar.bz2
Improve costs for DImode shifts of interger constants.
2020-09-13 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * config/pa/pa.c (hppa_rtx_costs) [ASHIFT, ASHIFTRT, LSHIFTRT]: Provide accurate costs for DImode shifts of integer constants.
Diffstat (limited to 'gcc/config/pa')
-rw-r--r--gcc/config/pa/pa.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index a9223ab..210e44f 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
@@ -1661,13 +1664,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
@@ -1692,13 +1698,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