mbox series

[0/4] rs6000: build constant via li/lis;rldicX

Message ID 20230203102208.53215-1-guojiufu@linux.ibm.com
Headers show
Series rs6000: build constant via li/lis;rldicX | expand

Message

Jiufu Guo Feb. 3, 2023, 10:22 a.m. UTC
Hi,

For a given constant, it would be profitable if we can use 2 insns to build.
This patch enables more constants building through 2 insns: one is "li or lis",
another is 'rldicl, rldicr or rldic'.
Through checking and analyzing the characters of the insns "li/lis;rldicX",
all the possible constant values are considered by this patch.

Previously, a patch is posted, but it is too large.
https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601276.html
As suggested, I split it into this series.

Considering the functionality and size, 4 patches are split as below:
1. Support the constants which can be built by "li;rotldi"
   Both positive and negative values from insn "li" are analyzed.
2. Support the constants which can be built by "lis;rotldi"
   We only need to analyze the negative value from "lis".
   And this patch uses more code to check leading 1s and tailing 0s from "lis".
3. Support the constants which can be built by "li/lis;rldicl/rldicr":
   Leverage the APIs defined/analyzed in patches 1 and 2,
   this patch checks the characters for the mask of "rldicl/rldicr"
   to support more constants.
4. Support the constants which can be built by "li/lis;rldic":
   The mask of "rldic" is relatively complicated, it is analyzed in this
   patch to support more constants.

BR,
Jeff (Jiufu)

Comments

Jiufu Guo Feb. 20, 2023, 3:16 a.m. UTC | #1
Hi,

Gental ping these patches:
https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611286.html

BR,
Jeff (Jiufu)


Jiufu Guo <guojiufu@linux.ibm.com> writes:

> Hi,
>
> For a given constant, it would be profitable if we can use 2 insns to build.
> This patch enables more constants building through 2 insns: one is "li or lis",
> another is 'rldicl, rldicr or rldic'.
> Through checking and analyzing the characters of the insns "li/lis;rldicX",
> all the possible constant values are considered by this patch.
>
> Previously, a patch is posted, but it is too large.
> https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601276.html
> As suggested, I split it into this series.
>
> Considering the functionality and size, 4 patches are split as below:
> 1. Support the constants which can be built by "li;rotldi"
>    Both positive and negative values from insn "li" are analyzed.
> 2. Support the constants which can be built by "lis;rotldi"
>    We only need to analyze the negative value from "lis".
>    And this patch uses more code to check leading 1s and tailing 0s from "lis".
> 3. Support the constants which can be built by "li/lis;rldicl/rldicr":
>    Leverage the APIs defined/analyzed in patches 1 and 2,
>    this patch checks the characters for the mask of "rldicl/rldicr"
>    to support more constants.
> 4. Support the constants which can be built by "li/lis;rldic":
>    The mask of "rldic" is relatively complicated, it is analyzed in this
>    patch to support more constants.
>
> BR,
> Jeff (Jiufu)
Jiufu Guo April 26, 2023, 4:18 a.m. UTC | #2
Hi,

I would like to ping these patches.
[0/4]
https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611286.html
[1/4]
https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611287.html
[2/4]
https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611288.html
[3/4]
https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611289.html
[4/4]
https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611290.html

Any sugguestions for the code functionality/style or to make
it easy for review, please point out, thanks in advance!


BR,
Jeff (Jiufu)

Jiufu Guo via Gcc-patches <gcc-patches@gcc.gnu.org> writes:

> Hi,
>
> Gental ping these patches:
> https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611286.html
>
> BR,
> Jeff (Jiufu)
>
>
> Jiufu Guo <guojiufu@linux.ibm.com> writes:
>
>> Hi,
>>
>> For a given constant, it would be profitable if we can use 2 insns to build.
>> This patch enables more constants building through 2 insns: one is "li or lis",
>> another is 'rldicl, rldicr or rldic'.
>> Through checking and analyzing the characters of the insns "li/lis;rldicX",
>> all the possible constant values are considered by this patch.
>>
>> Previously, a patch is posted, but it is too large.
>> https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601276.html
>> As suggested, I split it into this series.
>>
>> Considering the functionality and size, 4 patches are split as below:
>> 1. Support the constants which can be built by "li;rotldi"
>>    Both positive and negative values from insn "li" are analyzed.
>> 2. Support the constants which can be built by "lis;rotldi"
>>    We only need to analyze the negative value from "lis".
>>    And this patch uses more code to check leading 1s and tailing 0s from "lis".
>> 3. Support the constants which can be built by "li/lis;rldicl/rldicr":
>>    Leverage the APIs defined/analyzed in patches 1 and 2,
>>    this patch checks the characters for the mask of "rldicl/rldicr"
>>    to support more constants.
>> 4. Support the constants which can be built by "li/lis;rldic":
>>    The mask of "rldic" is relatively complicated, it is analyzed in this
>>    patch to support more constants.
>>
>> BR,
>> Jeff (Jiufu)
Jiufu Guo May 31, 2023, 2:55 a.m. UTC | #3
Gentle ping...

Jiufu Guo via Gcc-patches <gcc-patches@gcc.gnu.org> writes:

> Hi,
>
> I would like to ping these patches.
> [0/4]
> https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611286.html
> [1/4]
> https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611287.html
> [2/4]
> https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611288.html
> [3/4]
> https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611289.html
> [4/4]
> https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611290.html
>
> Any sugguestions for the code functionality/style or to make
> it easy for review, please point out, thanks in advance!
>
>
> BR,
> Jeff (Jiufu)
>
> Jiufu Guo via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
>
>> Hi,
>>
>> Gental ping these patches:
>> https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611286.html
>>
>> BR,
>> Jeff (Jiufu)
>>
>>
>> Jiufu Guo <guojiufu@linux.ibm.com> writes:
>>
>>> Hi,
>>>
>>> For a given constant, it would be profitable if we can use 2 insns to build.
>>> This patch enables more constants building through 2 insns: one is "li or lis",
>>> another is 'rldicl, rldicr or rldic'.
>>> Through checking and analyzing the characters of the insns "li/lis;rldicX",
>>> all the possible constant values are considered by this patch.
>>>
>>> Previously, a patch is posted, but it is too large.
>>> https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601276.html
>>> As suggested, I split it into this series.
>>>
>>> Considering the functionality and size, 4 patches are split as below:
>>> 1. Support the constants which can be built by "li;rotldi"
>>>    Both positive and negative values from insn "li" are analyzed.
>>> 2. Support the constants which can be built by "lis;rotldi"
>>>    We only need to analyze the negative value from "lis".
>>>    And this patch uses more code to check leading 1s and tailing 0s from "lis".
>>> 3. Support the constants which can be built by "li/lis;rldicl/rldicr":
>>>    Leverage the APIs defined/analyzed in patches 1 and 2,
>>>    this patch checks the characters for the mask of "rldicl/rldicr"
>>>    to support more constants.
>>> 4. Support the constants which can be built by "li/lis;rldic":
>>>    The mask of "rldic" is relatively complicated, it is analyzed in this
>>>    patch to support more constants.
>>>
>>> BR,
>>> Jeff (Jiufu)