On Mon, Jul 7, 2025 at 7:40 AM Takayuki 'January June' Suwa
<jjsuwa_sys3...@yahoo.co.jp> wrote:
>
> This is because in canonicalize_comparison() in gcc/expmed.cc, the COMPARE
> rtx_cost() for the immediate values in the title does not change between
> the old and new versions.  This patch fixes that.
>
> (note: Currently, this patch only works if some constant propagation
> optimizations are enabled (-O2 or higher) or if bare large constant
> assignments are possible (-mconst16 or -mauto-litpools).  In the future
> I hope to make it work at -O1...)
>
> gcc/ChangeLog:
>
>         * config/xtensa/xtensa.cc (xtensa_b4const_or_zero):
>         Remove.
>         (xtensa_b4const): Add a case where the value is 0, and rename
>         to xtensa_b4const_or_zero.
>         (xtensa_rtx_costs): Fix to also consider the result of
>         xtensa_b4constu().
>
> gcc/testsuite/ChangeLog:
>
>         * gcc.target/xtensa/BGEUI-BLTUI-32k-64k.c: New.
> ---
>   gcc/config/xtensa/xtensa.cc                   | 17 +++++------------
>   .../gcc.target/xtensa/BGEUI-BLTUI-32k-64k.c   | 19 +++++++++++++++++++
>   2 files changed, 24 insertions(+), 12 deletions(-)
>   create mode 100644 gcc/testsuite/gcc.target/xtensa/BGEUI-BLTUI-32k-64k.c

Regtested for target=xtensa-linux-uclibc, no new regressions.
Committed to master.

-- 
Thanks.
-- Max

Reply via email to