On Thu, May 25, 2023 at 8:13 AM Takayuki 'January June' Suwa <jjsuwa_sys3...@yahoo.co.jp> wrote: > > In order to reject voodoo estimation logic with lots of magic numbers, > this patch revises the code to measure the costs of the three memset > methods based on the actual emission size of the insn sequence > corresponding to each method and choose the smallest one. > > gcc/ChangeLog: > > * config/xtensa/xtensa-protos.h > (xtensa_expand_block_set_unrolled_loop, > xtensa_expand_block_set_small_loop): Remove. > (xtensa_expand_block_set): New prototype. > * config/xtensa/xtensa.cc > (xtensa_expand_block_set_libcall): New subfunction. > (xtensa_expand_block_set_unrolled_loop, > xtensa_expand_block_set_small_loop): Rewrite as subfunctions. > (xtensa_expand_block_set): New function that calls the above > subfunctions. > * config/xtensa/xtensa.md (memsetsi): Change to invoke only > xtensa_expand_block_set(). > --- > gcc/config/xtensa/xtensa-protos.h | 3 +- > gcc/config/xtensa/xtensa.cc | 319 ++++++++++++++++-------------- > gcc/config/xtensa/xtensa.md | 4 +- > 3 files changed, 172 insertions(+), 154 deletions(-)
Regtested for target=xtensa-linux-uclibc, no new regressions. Committed to master. -- Thanks. -- Max