]> git.ipfire.org Git - thirdparty/gcc.git/commit
pru: Split 64-bit moves into a sequence of 32-bit moves
authorDimitar Dimitrov <dimitar@dinux.eu>
Sun, 9 Feb 2025 15:55:03 +0000 (17:55 +0200)
committerDimitar Dimitrov <dimitar@dinux.eu>
Thu, 26 Jun 2025 19:09:11 +0000 (22:09 +0300)
commita1c592be501b12942181391cb6a7e3cca54e4e45
treeb470850c9ef80699b6b113ebddc48e942321cba3
parentc4d211bba2a86b90ee20a4f6f2cd1af1a036ee26
pru: Split 64-bit moves into a sequence of 32-bit moves

The 64-bit register-to-register moves on PRU are implemented with two
instructions moving 32-bit registers.  Defining a split for the 64-bit
moves allows this to be described in RTL, and thus one of the 32-bit
moves to be eliminated if the destination register is dead.

Also, split the loading of non-trivial 64-bit integer constants.  The
resulting 32-bit integer constants have better chance to be loaded with
something more optimal than an "ldi32".

For now do the splits only after register allocation, because LRA does
not yet efficiently handle subregs.  See
https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651366.html

This patch shows slight improvement for wikisort benchmark from
embench-iot:

Benchmark          size-before  size-after  difference
---------          -----------  ----------  ----------
aha-mont64          1,648       1,648       0
crc32                 104       104         0
depthconv           1,172       1,172       0
edn                 3,040       3,040       0
huffbench           1,616       1,616       0
matmult-int           748       748         0
md5sum                700       700         0
nettle-aes          2,664       2,664       0
nettle-sha256       5,732       5,732       0
nsichneu           21,372       21,372      0
picojpeg            9,716       9,716       0
qrduino             8,556       8,556       0
sglib-combined      3,724       3,724       0
slre                3,488       3,488       0
statemate           1,132       1,132       0
tarfind               652       652         0
ud                  1,004       1,004       0
wikisort           18,120       18,092      -28
xgboost               300       300         0

gcc/ChangeLog:

* config/pru/pru.md (reg move splitter): New splitter for 64-bit
register moves into two 32-bit moves.
(const_int move splitter): New splitter for 64-bit constant
integer moves into two 32-bit moves.

gcc/testsuite/ChangeLog:

* gcc.target/pru/mov64-subreg-1.c: New test.
* gcc.target/pru/mov64-subreg-2.c: New test.

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