bebbo / gcc

Bebbo's gcc-6-branch for m68k-amigaos
GNU General Public License v2.0
33 stars 11 forks source link

loop construct on An uses cmp.l while cmpa.w would be approbiate #215

Closed GunnarVB closed 9 months ago

GunnarVB commented 9 months ago

Hi Bebbo I hope you are doing fine.

Please let me allow to point out some possible improvement: The loop construct defined in m68k.md uses cmp.l while cmpa.w would be optimal in this case.

file : gcc/gcc/config/m68k/m68k.md

(define_insn "*dbge_si"
  [(set (pc)
...
  if (GET_CODE (operands[0]) == MEM)
    return "subq%.l bebbo/amiga-gcc#1,%0\;jcc %l1";
  return "subq%.l bebbo/amiga-gcc#1,%0\;**cmp%.l #-1,%0**\;jne %l1";
})

here CMP.l is used. while optimal would be "cmpa.w #-1,%0"

Benefit: Size and performance tuning