Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
17
-
b14
-
x86
Description
X86 I2L conversion can be skipped for certain masked positive values
For the following expression:
(long)(value & mask)
Where value is of int type and mask is constant (power of two – 1), we can directly generate bzhi instruction to zero the upper bits
Instead of doing an andl, followed by movslq
Before:
Benchmark Mode Cnt Score Error Units
SkipIntToLongCast.skipMaskedSmallPositiveCast avgt 15 10.679 ± 1.496 ns/op
After:
Benchmark Mode Cnt Score Error Units
SkipIntToLongCast.skipMaskedSmallPositiveCast avgt 15 7.870 ± 0.067 ns/op
For the following expression:
(long)(value & mask)
Where value is of int type and mask is constant (power of two – 1), we can directly generate bzhi instruction to zero the upper bits
Instead of doing an andl, followed by movslq
Before:
Benchmark Mode Cnt Score Error Units
SkipIntToLongCast.skipMaskedSmallPositiveCast avgt 15 10.679 ± 1.496 ns/op
After:
Benchmark Mode Cnt Score Error Units
SkipIntToLongCast.skipMaskedSmallPositiveCast avgt 15 7.870 ± 0.067 ns/op
Attachments
Issue Links
- relates to
-
JDK-8263753 two new tests from JDK-8261671 fail with "Error. can not find ClassFileInstaller in test directory or libraries"
-
- Resolved
-
-
JDK-8263904 compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails on x86_32
-
- Resolved
-
-
JDK-8268033 compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java fails with "fatal error: Not compilable at tier 3: CodeBuffer overflow"
-
- Resolved
-
-
JDK-8248870 AArch64: I2L/L2I conversions can be skipped for masked positive values
-
- Resolved
-
(1 links to)