]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: build constant via li/lis;rldic
authorJiufu Guo <guojiufu@linux.ibm.com>
Tue, 10 Jan 2023 13:40:48 +0000 (21:40 +0800)
committerguojiufu <guojiufu@linux.ibm.com>
Sun, 8 Oct 2023 02:17:08 +0000 (10:17 +0800)
commit3da32cc3d1e48f2eac1630e627d34723b9536166
tree5b67a8de91268374a4b258bac2d94a57576ee4d9
parent8f1a70a4fbcc6441c70da60d4ef6db1e5635e18a
rs6000: build constant via li/lis;rldic

This patch checks if a constant is possible to be built by "li;rldic".
Only need to take care of "negative li", other forms do not need to check.
For example, "negative lis" is just a "negative li" with an additional shift.

gcc/ChangeLog:

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

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/const-build.c: Add more tests.
gcc/config/rs6000/rs6000.cc
gcc/testsuite/gcc.target/powerpc/const-build.c