RFR: 8303415: Add VM_Version::is_intrinsic_supported(id)
David Holmes
dholmes at openjdk.org
Thu Mar 9 02:37:07 UTC 2023
The message from this sender included one or more files
which could not be scanned for virus detection; do not
open these files unless you are certain of the sender's intent.
----------------------------------------------------------------------
On Fri, 3 Mar 2023 16:16:08 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
> Currently we check VM flags, directives and JIT compiler support when we generate intrinsics.
> We have *product* VM flags for most intrinsics and set them in VM based on HW support.
> But not all intrinsics have such flags and it is not scalable to add new *product* flag for each new intrinsic.
> Also we have `-XX:DisableIntrinsic=<id>` and `-XX:ControlIntrinsic=<id>` flags to control intrinsics from command line. We don't need specific flags for that.
>
> I propose to add new `VM_Version::is_intrinsic_supported(id)` method to check platform support for intrinsic without adding new flag. I used it for `_floatToFloat16` intrinsic for my work on [JDK-8302976](https://bugs.openjdk.org/browse/JDK-8302976).
>
> Additional fixes:
> Fixed Interpreter to skip intrinsics if they are disabled with flag.
> Moved Interpreter's `InlineIntrinsics` flag check into one place in shared code.
> Added separate interpreter id for `_dsqrt_strict` so it could be disabled separately from regular `_dsqrt`.
> Added missing `native` mark to `_currentThread`.
> Removed unused `AbstractInterpreter::in_native_entry()`.
> Cleanup C2 intrinsic checks code.
>
> Tested tier1-4,xcomp,stress. Also ran tier1-3,xcomp with `-XX:-InlineIntrinsics`.
Just a couple of drive-by comments. I'm a bit confused about the core issue of "
Add VM_Version::is_intrinsic_supported(id)" because AFAICS this was only added for x86 ??
src/hotspot/cpu/x86/vm_version_x86.cpp line 3230:
> 3228: case vmIntrinsics::_floatToFloat16:
> 3229: case vmIntrinsics::_float16ToFloat:
> 3230: if (!supports_f16c() && !supports_avx512vl()) return false;
Please put the return on a new line - it is too easy to just see the break.
-------------
PR: https://git.openjdk.org/jdk/pull/12858
More information about the hotspot-runtime-dev
mailing list