RFR: 8261671: X86 I2L conversion can be skipped for certain masked positive values [v7]
Marcus G K Williams
github.com+168222+mgkwill at openjdk.java.net
Mon Mar 8 22:08:08 UTC 2021
On Mon, 8 Mar 2021 21:09:33 GMT, Nils Eliasson <neliasso at openjdk.org> wrote:
>> Marcus G K Williams has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix copyright formatting, log description
>>
>> Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
>
> test/hotspot/jtreg/compiler/codegen/BMI2.java line 56:
>
>> 54: z = BMITests.bzhiI2L(ix, i);
>> 55:
>> 56: for (int i2 = 0; i2 < ITERATIONS; i2++) {
>
> Why are these manually unrolled? They are the same but with different index?
>
> I mean something like:
>
> for (int i = 0; i <= 15; i++) {
> z = BMITests.bzhiI2L(ix, i);
>
> for (int i2 = 0; i2 < ITERATIONS; i2++) {
> long ii = BMITests.bzhiI2L(ix, i);
> if (ii != z) {
> throw new Error(returnBzhiI2LErrMessage (z, ii));
> }
> }
> }
I wasn't able to get the above to C2 compile separately. I wrote essentially the same but could not verify the compilation. I then unrolled from the for loop and could verify the bzhi instructions were generated. Repetition felt like a reasonable compromise for completeness. I'll take another look and see if I can verify in a for loop. Perhaps one of the options I was using prevented it from working.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2590
More information about the hotspot-compiler-dev
mailing list