On Mon, Jun 13, 2022 at 8:54 PM Takayuki 'January June' Suwa <jjsuwa_sys3...@yahoo.co.jp> wrote: > > This patch offers better RTL representations against straightforward > derivations from some tree optimizers' canonicalized forms. > > - rounding up to even, such as '(x + (x & 1))', is canonicalized to > '((x + 1) & -2)', but the former is one instruction less than the latter > in Xtensa ISA. > - signed greater or equal to zero as logical value '((signed)x >= 0)', > is canonicalized to '((unsigned)(x ^ -1) >> 31)', but the equivalent > '(((signed)x >> 31) + 1)' is one instruction less. > > gcc/ChangeLog: > > * config/xtensa/xtensa.md (*round_up_to_even): > New insn-and-split pattern. > (*signed_ge_zero): Ditto. > --- > gcc/config/xtensa/xtensa.md | 45 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 45 insertions(+)
Regtested for target=xtensa-linux-uclibc, no new regressions. Committed to master. -- Thanks. -- Max