]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: build constant via li;rotldi
authorJiufu Guo <guojiufu@linux.ibm.com>
Thu, 24 Aug 2023 01:08:34 +0000 (09:08 +0800)
committerguojiufu <guojiufu@linux.ibm.com>
Sun, 8 Oct 2023 02:17:08 +0000 (10:17 +0800)
commit25b91754ed459c295bd3979fbbce4f1010483e5d
treedb6d9aa5cccbb4a46fcd2b24921fb74b3d218997
parente067e894d62150b3ab4baca4653b4267fd7e0dc1
rs6000: build constant via li;rotldi

If a constant is possible to be rotated to/from a positive or negative
value which "li" can generated, then "li;rotldi" can be used to build
the constant.

gcc/ChangeLog:

* config/rs6000/rs6000.cc (can_be_built_by_li_and_rotldi): New function.
(rs6000_emit_set_long_const): Call can_be_built_by_li_and_rotldi.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/const-build.c: New test.
gcc/config/rs6000/rs6000.cc
gcc/testsuite/gcc.target/powerpc/const-build.c [new file with mode: 0644]