aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2024-03-06 12:46:25 +0100
committerGeorg-Johann Lay <avr@gjlay.de>2024-03-06 13:19:04 +0100
commitb7d14310406a13aaf518c6c34728433077cd545a (patch)
treed97701663b2c5403db5a0828124ba74dee36ae60 /gcc
parent89c443a7e9a0780a52a698fb02d4f5173e025918 (diff)
downloadgcc-b7d14310406a13aaf518c6c34728433077cd545a.zip
gcc-b7d14310406a13aaf518c6c34728433077cd545a.tar.gz
gcc-b7d14310406a13aaf518c6c34728433077cd545a.tar.bz2
AVR: Adjust rtx cost of plus + zero_extend.
gcc/ * config/avr/avr.cc (avr_rtx_costs_1) [PLUS+ZERO_EXTEND]: Adjust rtx cost.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/avr/avr.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index 36995e0..b87ae6a 100644
--- a/gcc/config/avr/avr.cc
+++ b/gcc/config/avr/avr.cc
@@ -12513,6 +12513,13 @@ avr_rtx_costs_1 (rtx x, machine_mode mode, int outer_code,
return true;
case PLUS:
+ if (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
+ && REG_P (XEXP (x, 1)))
+ {
+ *total = COSTS_N_INSNS (GET_MODE_SIZE (mode) - 1);
+ return true;
+ }
+
switch (mode)
{
case E_QImode: