]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: accurate num_insns_constant_gpr
authorJiufu Guo <guojiufu@linux.ibm.com>
Wed, 13 Dec 2023 00:10:25 +0000 (08:10 +0800)
committerguojiufu <guojiufu@linux.ibm.com>
Wed, 13 Dec 2023 00:53:10 +0000 (08:53 +0800)
commit97b3b38e5faec2b5486368f5a0ffb16eb4ab4190
treecb008b702005b4b46e31957f46ac1227bfb52415
parent8a5d6ce0e83c17a48541d27758291d6f7ef5c829
rs6000: accurate num_insns_constant_gpr

Trunk gcc supports more constants to be built via two instructions:
e.g. "li/lis; xori/xoris/rldicl/rldicr/rldic".
And then num_insns_constant should also be updated.

Function "rs6000_emit_set_long_const" is used to build complicated
constants; and "num_insns_constant_gpr" is used to compute 'how
many instructions are needed" to build the constant. So, these
two functions should be aligned.

The idea of this patch is: to reuse "rs6000_emit_set_long_const" to
compute/record the instruction number(when computing the insn_num,
then do not emit instructions).

gcc/ChangeLog:

* config/rs6000/rs6000.cc (rs6000_emit_set_long_const): Add new
parameter to record number of instructions to build the constant.
(num_insns_constant_gpr): Call rs6000_emit_set_long_const to compute
num_insn.
gcc/config/rs6000/rs6000.cc