RFR: 8283694: Improve bit manipulation and boolean to integer conversion operations on x86_64 [v5]

Quan Anh Mai duke at openjdk.java.net
Wed Apr 6 22:43:45 UTC 2022


On Wed, 6 Apr 2022 18:00:06 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   movzx is not elided with same input and output
>
> src/hotspot/cpu/x86/x86_64.ad line 9438:
> 
>> 9436: 
>> 9437: // Arithmetic Shift Right by 8-bit immediate
>> 9438: instruct sarL_mem_imm(memory dst, immI shift, rFlagsReg cr)
> 
> Why this change to type of constant?

For other shift nodes, the `Ideal` method clips the constant shift count to be in the correct range so we can match `immI8` with it. The `RShiftLNode` does not have an `Ideal` method so we have to do that in the backend. Previously, constant shifts that out-of-bounds for 8-bit immediate still match with the variable shift rule, but as I exclude constant shifts from `sarL_rReg_rReg`, this reveals.
Thank you very much.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7968


More information about the hotspot-compiler-dev mailing list