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

Marcus G K Williams github.com+168222+mgkwill at openjdk.java.net
Wed Mar 17 00:30:44 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 13 additional commits since the last revision:

 - Merge branch 'master' into int2l_opt
 - Remove redundant predicate
   
   Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
 - Address Vladimir Ivanov Suggestions
   
   Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
 - Refactor BMI2.java based on review
   
   Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
 - Roll up BMITests.bzhiI2L ops into for loop
   
   Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
 - Fix copyright formatting, log description
   
   Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
 - Refactor BMI2 & TestBzhiI2L Tests
   
   Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
 - Clean up Expr.java & assembler_x86.hpp
   
   Remove unneeded bzhi in assembler_x86.hpp
   and unused longExpr's in Expr.java
   
   Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
 - Add BMI2 and BzhiTestI2L tests
   
   Signed-off-by: Marcus G K Williams <marcus.williams at intel.com>
 - Merge branch 'master' into int2l_opt
 - ... and 3 more: https://git.openjdk.java.net/jdk/compare/5ff046f4...f00fbc33

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2590/files
  - new: https://git.openjdk.java.net/jdk/pull/2590/files/705c6001..f00fbc33

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

  Stats: 43111 lines in 1791 files changed: 30575 ins; 7213 del; 5323 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