RFR: 8261671: X86 I2L conversion can be skipped for certain masked positive values [v3]

Marcus G K Williams github.com+168222+mgkwill at openjdk.java.net
Thu Mar 4 17:57:43 UTC 2021


On Wed, 17 Feb 2021 20:38:45 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>>> Please, add a test which verifies result of generated code for different ranges of mask (especially corner cases). See `compiler//codegen/BMI1.java`
>>> There are also example of verification of generated assembler in `compiler//intrinsics/bmi/`
>> 
>> I'm taking a look at a test to verify generated code like the BMI1 test you suggest above.
>> 
>> There is a current test that verifies operation indirectly (both long to int and int to long): test/hotspot/jtreg/compiler/c2/TestSkipLongToIntCast.java
>> 
>> Do we need both? A number of similar patches have been merged without, https://hg.openjdk.java.net/jdk/jdk/rev/d0f55423e913 for example.
>
>> > Please, add a test which verifies result of generated code for different ranges of mask (especially corner cases). See `compiler//codegen/BMI1.java`
>> > There are also example of verification of generated assembler in `compiler//intrinsics/bmi/`
>> 
>> I'm taking a look at a test to verify generated code like the BMI1 test you suggest above.
>> 
>> There is a current test that verifies operation indirectly (both long to int and int to long): test/hotspot/jtreg/compiler/c2/TestSkipLongToIntCast.java
> 
> It does not cover your case which have `AND` operation.
> But I am fine if you add your case to it (or to other test, like BMI1.java) instead of creating new test file.
> 
>> 
>> Do we need both? A number of similar patches have been merged without, https://hg.openjdk.java.net/jdk/jdk/rev/d0f55423e913 for example.
> 
> Missing tests in previous changes does not mean we should never create one.

Hi @vnkozlov. I've added a BMI2.java and a compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java test as you suggested. I'd appreciate any further review or comments.

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

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


More information about the hotspot-compiler-dev mailing list