xtensa: Make use of BALL/BNALL instructions
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Thu, 27 May 2021 10:04:12 +0000 (19:04 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 14 Jun 2022 00:25:48 +0000 (17:25 -0700)
commit70ce04ca353bb0cda8321b91a77c2477e26d339b
tree024ec5354e8f68d1928e3d3ea97b3f044ac24d26
parente1b193c1cce3a975a9ed60dd0f30182fe0255d7c
xtensa: Make use of BALL/BNALL instructions

In Xtensa ISA, there is no single machine instruction that calculates unary
bitwise negation, but a few similar fused instructions are exist:

  "BALL  Ax, Ay, label"  // if ((~Ax & Ay) == 0) goto label;
  "BNALL Ax, Ay, label"  // if ((~Ax & Ay) != 0) goto label;

These instructions have never been emitted before, but it seems no reason not
to make use of them.

gcc/ChangeLog:

* config/xtensa/xtensa.md (*masktrue_bitcmpl): New insn pattern.

gcc/testsuite/ChangeLog:

* gcc.target/xtensa/BALL-BNALL.c: New.
gcc/config/xtensa/xtensa.md
gcc/testsuite/gcc.target/xtensa/BALL-BNALL.c [new file with mode: 0644]