RFR: 8261671: X86 I2L conversion can be skipped for certain masked positive values [v2]

Marcus G K Williams github.com+168222+mgkwill at openjdk.java.net
Tue Feb 16 17:43:08 UTC 2021


> 8261671: 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
> 
> Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>

Marcus G K Williams has updated the pull request incrementally with one additional commit since the last revision:

  Update convI2LAndI_reg_immIbitmask w/ is_Intel
  
  Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2590/files
  - new: https://git.openjdk.java.net/jdk/pull/2590/files/28cbd6cb..5dc976e2

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2590&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2590&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2590.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2590/head:pull/2590

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


More information about the hotspot-compiler-dev mailing list