]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AVR: Adjust rtx cost of plus + zero_extend.
authorGeorg-Johann Lay <avr@gjlay.de>
Wed, 6 Mar 2024 11:46:25 +0000 (12:46 +0100)
committerGeorg-Johann Lay <avr@gjlay.de>
Wed, 6 Mar 2024 12:19:04 +0000 (13:19 +0100)
gcc/
* config/avr/avr.cc (avr_rtx_costs_1) [PLUS+ZERO_EXTEND]: Adjust
rtx cost.

gcc/config/avr/avr.cc

index 36995e05cbec8a103ed548e598855a16531628d4..b87ae6a256def2534fc8cc9ad988790099c476d4 100644 (file)
@@ -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: