RFR: 8263904: compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails on x86_32

Marcus G K Williams github.com+168222+mgkwill at openjdk.java.net
Mon Mar 22 18:13:43 UTC 2021


On Mon, 22 Mar 2021 17:46:57 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> Thanks! Looks good to me.
>
> The test already does some platform sensing itself (in `BmiIntrinsicBase::test()`), so mixing it with `@requires` doesn't look pretty.
> 
> What about something like the following?
> diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
> index 47adc9e98fb..be605108caa 100644
> --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
> +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java
> @@ -63,6 +63,10 @@ public class BmiIntrinsicBase extends CompilerWhiteBoxTest {
>              return;
>          }
>  
> +        if ((bmiTestCase instanceof BmiTestCase_x64Only) && !Platform.isX64()) {
> +            System.out.println("Unsupported platform, test SKIPPED");
> +        }
> +
>          if (!Platform.isServer()) {
>              throw new Error("TESTBUG: Not server VM");
>          }
> @@ -227,4 +231,10 @@ public class BmiIntrinsicBase extends CompilerWhiteBoxTest {
>              return cnt;
>          }
>      }
> +
> +    abstract static class BmiTestCase_x64Only extends BmiTestCase_x64 {
> +        protected BmiTestCase_x64Only(Method method) {
> +            super(method);
> +        }
> +    }
>  }
> diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java
> index 8a55a236f51..531e9077dbf 100644
> --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java
> +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java
> @@ -41,7 +41,7 @@ import compiler.intrinsics.bmi.TestBzhiI2L;
>  
>  import java.lang.reflect.Method;
>  
> -public class BzhiTestI2L extends BmiIntrinsicBase.BmiTestCase_x64 {
> +public class BzhiTestI2L extends BmiIntrinsicBase.BmiTestCase_x64Only {
>  
>      protected BzhiTestI2L(Method method) {
>          super(method);

Hi @iwanowww, currently a child of BmiIntrinsicBase.BmiTestCase_x64 has both, instrMask, instrPattern and instrMask_x64, instrPattern_x64. Theoretically you could test both x86_32 and x86_64 using the same test code if `Platform.isX86()` or `Platform.isX64()` are used to differentiate. See https://github.com/openjdk/jdk/pull/3128 as a possible fix to BmiIntrinsicBase.BmiTestCase_x64 question and extra platform check to insure BzhiTestI2L does not run on x86 for now.

I don't mind overlapping `@requires vm.simpleArch == "x64"`, what's done here, with the changes I've proposed.

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

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


More information about the hotspot-compiler-dev mailing list