This patch provides more accurate rtx_costs estimates for shifts by
integer constants (which are cheaper than by a register amount).
2020-09-02 Roger Sayle <roger@nextmovesoftware.com>
gcc/ChangeLog
* config/pa/pa.c (hppa_rtx_costs) [ASHIFT, ASHIFTRT, LSHIFTRT]:
Provide accurate costs for shifts of integer constants.
else
*total = COSTS_N_INSNS (18);
}
else
*total = COSTS_N_INSNS (18);
}
+ else if (REG_P (XEXP (x, 0)) && CONST_INT_P (XEXP (x, 1)))
+ {
+ if (TARGET_64BIT)
+ *total = COSTS_N_INSNS (2);
+ else
+ *total = COSTS_N_INSNS (1);
+ return true;
+ }
else if (TARGET_64BIT)
*total = COSTS_N_INSNS (4);
else
else if (TARGET_64BIT)
*total = COSTS_N_INSNS (4);
else
else
*total = COSTS_N_INSNS (19);
}
else
*total = COSTS_N_INSNS (19);
}
+ else if (REG_P (XEXP (x, 0)) && CONST_INT_P (XEXP (x, 1)))
+ {
+ if (TARGET_64BIT)
+ *total = COSTS_N_INSNS (2);
+ else
+ *total = COSTS_N_INSNS (1);
+ return true;
+ }
else if (TARGET_64BIT)
*total = COSTS_N_INSNS (4);
else
else if (TARGET_64BIT)
*total = COSTS_N_INSNS (4);
else
else
*total = COSTS_N_INSNS (15);
}
else
*total = COSTS_N_INSNS (15);
}
+ else if (REG_P (XEXP (x, 0)) && CONST_INT_P (XEXP (x, 1)))
+ {
+ *total = COSTS_N_INSNS (1);
+ return true;
+ }
else if (TARGET_64BIT)
*total = COSTS_N_INSNS (3);
else
else if (TARGET_64BIT)
*total = COSTS_N_INSNS (3);
else