Re: [PATCH 2/4] xtensa: Make one_cmplsi2 optimizer-friendly

2022-06-09 Thread Max Filippov via Gcc-patches
On Sun, May 29, 2022 at 4:00 AM Takayuki 'January June' Suwa wrote: > > In Xtensa ISA, there is no single machine instruction that calculates unary > bitwise negation. But a few optimizers assume that bitwise negation can be > done by a single insn. > > As a result, '((x < 0) ? ~x : x)' cannot be

[PATCH 2/4] xtensa: Make one_cmplsi2 optimizer-friendly

2022-05-29 Thread Takayuki 'January June' Suwa via Gcc-patches
In Xtensa ISA, there is no single machine instruction that calculates unary bitwise negation. But a few optimizers assume that bitwise negation can be done by a single insn. As a result, '((x < 0) ? ~x : x)' cannot be optimized to '(x ^ (x >> 31))' ever before, for example. This patch relaxes s