RFR: 8313372: [JVMCI] Export vmIntrinsics::is_intrinsic_available results to JVMCI compilers. [v2]

Yudi Zheng yzheng at openjdk.org
Thu Aug 3 07:12:31 UTC 2023


On Thu, 3 Aug 2023 07:12:08 GMT, Yudi Zheng <yzheng at openjdk.org> wrote:

>> This PR exports `vmIntrinsic::is_intrinsic_available`, `Compiler::is_intrinsic_supported`, and `C2Compiler::is_intrinsic_supported` results to JVMCI compiler. This allows JVMCI compiler to comply with `-XX:DisableIntrinsic`, `-XX:ControlIntrinsic`, `-XX:-UseXXXIntrinsic`, and is essential for running test that depends on these flags, e.g., `java/lang/Float/Binary16ConversionNaN` that returns different result in the interpreter with `-XX:DisableIntrinsic=_float16ToFloat,_floatToFloat16`.
>> This PR also attempts to fix some of the `is_intrinsic_available` results. Please see the inlined comments.
>
> Yudi Zheng has updated the pull request incrementally with one additional commit since the last revision:
> 
>   update is_intrinsic_supported for _dcopySign,_fcopySign.

src/hotspot/cpu/x86/vm_version_x86.cpp line 3229:

> 3227:   case vmIntrinsics::_electronicCodeBook_encryptAESCrypt:
> 3228:   case vmIntrinsics::_electronicCodeBook_decryptAESCrypt:
> 3229:   case vmIntrinsics::_galoisCounterMode_AESCrypt:

Stubs for these intrinsics are generated with the following CPU features.
See https://github.com/openjdk/jdk/blob/53ca75b18ea419d469758475fac8352bf915b484/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp#L159-L166

src/hotspot/cpu/x86/vm_version_x86.cpp line 3235:

> 3233:     break;
> 3234:   case vmIntrinsics::_bigIntegerRightShiftWorker:
> 3235:   case vmIntrinsics::_bigIntegerLeftShiftWorker:

See https://github.com/openjdk/jdk/blob/53ca75b18ea419d469758475fac8352bf915b484/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp#L4169-L4172

src/hotspot/cpu/x86/vm_version_x86.cpp line 3247:

> 3245:     break;
> 3246:   case vmIntrinsics::_dcopySign:
> 3247:   case vmIntrinsics::_fcopySign:

See https://github.com/openjdk/jdk/blob/53ca75b18ea419d469758475fac8352bf915b484/src/hotspot/cpu/x86/x86.ad#L1601-L1609

src/hotspot/cpu/x86/vm_version_x86.cpp line 3260:

> 3258:   case vmIntrinsics::_minF_strict:
> 3259:   case vmIntrinsics::_maxD_strict:
> 3260:   case vmIntrinsics::_minD_strict:

See https://github.com/openjdk/jdk/blob/53ca75b18ea419d469758475fac8352bf915b484/src/hotspot/cpu/x86/x86.ad#L1534-L1543

src/hotspot/cpu/x86/vm_version_x86.hpp line 689:

> 687:   static bool supports_avxonly()      { return ((supports_avx2() || supports_avx()) && !supports_evex()); }
> 688:   static bool supports_sha()          { return (_features & CPU_SHA) != 0; }
> 689:   static bool supports_fma()          { return (_features & CPU_FMA) != 0 && supports_avx(); }

https://github.com/openjdk/jdk/blob/53ca75b18ea419d469758475fac8352bf915b484/src/hotspot/cpu/x86/vm_version_x86.cpp#L1154-L1158
implies fma intrinsic can be used without AVX

src/hotspot/share/opto/c2compiler.cpp line 237:

> 235:   case vmIntrinsics::_electronicCodeBook_decryptAESCrypt:
> 236:     if (StubRoutines::electronicCodeBook_decryptAESCrypt() == nullptr) return false;
> 237:     break;

These two intrinsics were marked as supported on non-x86 platforms where the underlying stubs are not generated

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15133#discussion_r1282729047
PR Review Comment: https://git.openjdk.org/jdk/pull/15133#discussion_r1282730887
PR Review Comment: https://git.openjdk.org/jdk/pull/15133#discussion_r1282736834
PR Review Comment: https://git.openjdk.org/jdk/pull/15133#discussion_r1282737285
PR Review Comment: https://git.openjdk.org/jdk/pull/15133#discussion_r1282747067
PR Review Comment: https://git.openjdk.org/jdk/pull/15133#discussion_r1282744793


More information about the graal-dev mailing list