Integrated: 8261671: X86 I2L conversion can be skipped for certain masked positive values
Marcus G K Williams
github.com+168222+mgkwill at openjdk.java.net
Wed Mar 17 16:21:51 UTC 2021
On Tue, 16 Feb 2021 16:13:48 GMT, Marcus G K Williams <github.com+168222+mgkwill at openjdk.org> wrote:
> 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>
This pull request has now been integrated.
Changeset: 4f4ca0e7
Author: Marcus G K Williams <marcus.williams at intel.com>
Committer: Sandhya Viswanathan <sviswanathan at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/4f4ca0e7
Stats: 370 lines in 7 files changed: 365 ins; 0 del; 5 mod
8261671: X86 I2L conversion can be skipped for certain masked positive values
Reviewed-by: kvn, neliasso, vlivanov
-------------
PR: https://git.openjdk.java.net/jdk/pull/2590
More information about the hotspot-compiler-dev
mailing list