pru: Optimize 64-bit logical operations
authorDimitar Dimitrov <dimitar@dinux.eu>
Sat, 20 Aug 2022 20:58:27 +0000 (23:58 +0300)
committerDimitar Dimitrov <dimitar@dinux.eu>
Mon, 22 Aug 2022 19:29:10 +0000 (22:29 +0300)
commit990124c35cd60cd23e0b70fc84cfb75311e80276
tree7fe10eacaf165e21eaa5acbd4da87a68b43bb398
parent151effa22106a81f5835bb2dab7b95130f8fe2ef
pru: Optimize 64-bit logical operations

The earlyclobber in the pattern yields inefficient code due to
unnecessarily generated moves.  Optimize by removing the earlyclobber
for two special alternatives:
  - If OP2 is a small constant integer.
  - If the logical bit operation has only two operands.

gcc/ChangeLog:

* config/pru/pru.md (pru_<code>di3): New alternative for
two operands but without earlyclobber.

gcc/testsuite/ChangeLog:

* gcc.target/pru/bitop-di.c: New test.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
gcc/config/pru/pru.md
gcc/testsuite/gcc.target/pru/bitop-di.c [new file with mode: 0644]