]> git.ipfire.org Git - thirdparty/gcc.git/commit
pru: Optimize DI shifts
authorDimitar Dimitrov <dimitar@dinux.eu>
Thu, 22 Sep 2022 20:08:43 +0000 (23:08 +0300)
committerDimitar Dimitrov <dimitar@dinux.eu>
Sun, 9 Oct 2022 11:38:34 +0000 (14:38 +0300)
commit73137f365a01327ae245fa0a9f0b127cb06e0cb3
treeaa5f20dc7b5d3565ae5534a8fbe541c2f6f7f7c8
parent66c48be23e0fa5ee7474b4b078e013f901c71eed
pru: Optimize DI shifts

If the number of shift positions is a constant, then the DI shift
operation is expanded to a sequence of 2 to 4 machine instructions.
That is more efficient than the default action to call libgcc.

gcc/ChangeLog:

* config/pru/pru.md (lshrdi3): New expand pattern.
(ashldi3): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/pru/ashiftdi-1.c: New test.
* gcc.target/pru/lshiftrtdi-1.c: New test.

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