JEP 315: Improve Aarch64 Intrinsics

OwnerDmitrij Pochepko
Created2017/10/10 12:40
Updated2017/11/23 16:51
TypeFeature
StatusCandidate
Componenthotspot / compiler
ScopeImplementation
Discussionhotspot dash compiler dash dev at openjdk dot java dot net
EffortL
DurationL
Priority3
Reviewed byMikael Vidstedt, Vladimir Kozlov
Endorsed byVladimir Kozlov
Issue8189104

Summary

Improve the existing string and array intrinsics, and implement new intrinsics for the java.lang.Math trigonometric and power functions, on AArch64 processors.

Non-Goals

Motivation

Specialized CPU architecture-specific code patterns improve the performance of user applications and benchmarks.

Description

Intrinsics are used to leverage CPU architecture-specific assembly code which is executed instead of generic Java code for a given method to improve performance. While most of the intrinsics are already implemented in AArch64 port, optimized intrinsics for the following java.lang.Math methods are still missing:

This JEP is intended to cover this gap by implementing optimized intrinsics for these methods. Also, the java.lang.Math::exp method intrinsic for the AArch64 port doesn't use the SIMD instructions available on AArch64, and may benefit from a SIMD implementation.

At the same time, while most of the intrinsics are already implemented in the AArch64 port, the current implementation of some intrinsics may not be optimal. Specifically, some intrinsics for AArch64 architectures may benefit from software prefetching instructions, memory address alignment, instructions placement for multi-pipeline CPUs, and the replacement of certain instruction patterns with faster ones or with SIMD instructions.

This includes (but is not limited to) such typical operations as String::compareTo, String::indexOf, StringCoding::hasNegatives, Arrays::equals, StringUTF16::compress, StringLatin1::inflate, and various checksum calculations.

Depending on the intrinsic algorithm, the most common intrinsic use case, and CPU specifics, the following changes may be considered:

Testing

Risks and Assumptions