On Thu, Jun 9, 2022 at 9:26 PM Takayuki 'January June' Suwa <jjsuwa_sys3...@yahoo.co.jp> wrote: > > This patch implements a new target-specific relative RTL insn cost function > because of suboptimal cost estimation by default, and fixes several "length" > insn attributes (related to the cost estimation). > > And also introduces a new machine-dependent option "-mextra-l32r-costs=" > that tells implementation-specific InstRAM/ROM access penalty for L32R > instruction to the compiler (in clock-cycle units, 0 by default). > > gcc/ChangeLog: > > * config/xtensa/xtensa.cc (xtensa_rtx_costs): Correct wrong case > for ABS and NEG, add missing case for BSWAP and CLRSB, and > double the costs for integer divisions using libfuncs if > optimizing for speed, in order to take advantage of fast constant > division by multiplication. > (TARGET_INSN_COST): New macro definition. > (xtensa_is_insn_L32R_p, xtensa_insn_cost): New functions for > calculating relative costs of a RTL insns, for both of speed and > size. > * config/xtensa/xtensa.md (return, nop, trap): Correct values of > the attribute "length" that depends on TARGET_DENSITY. > (define_asm_attributes, blockage, frame_blockage): Add missing > attributes. > * config/xtensa/xtensa.opt (-mextra-l32r-costs=): New machine- > dependent option, however, preparatory work for now. > --- > gcc/config/xtensa/xtensa.cc | 116 ++++++++++++++++++++++++++++++++--- > gcc/config/xtensa/xtensa.md | 29 ++++++--- > gcc/config/xtensa/xtensa.opt | 4 ++ > 3 files changed, 134 insertions(+), 15 deletions(-)
Regtested for target=xtensa-linux-uclibc, no new regressions. Committed to master. -- Thanks. -- Max