RFR: 8256438: AArch64: Implement match rules with ROR shift register value
Eric Liu
eric.c.liu at arm.com
Mon Feb 1 07:21:52 UTC 2021
Hi Andrew,
Thanks for your feedback.
I refined those benchmarks and on two platforms could have a better performance.
One can get about 100% gain, and 30% for another one. Other platforms were hard to
see any performance changes.
Before:
Benchmark Mode Cnt Score Error Units
Rotation.andRotateRight avgt 15 3860.994 ± 3.409 ns/op
Rotation.bicRotateRight avgt 15 3861.247 ± 3.321 ns/op
Rotation.eonRotateRight avgt 15 3860.865 ± 3.003 ns/op
Rotation.ornRotateRight avgt 15 3860.884 ± 3.260 ns/op
Rotation.xorRotateRight avgt 15 3860.886 ± 2.728 ns/op
After:
Benchmark Mode Cnt Score Error Units
Rotation.andRotateRight avgt 15 1933.495 ± 0.263 ns/op
Rotation.bicRotateRight avgt 15 1933.436 ± 0.244 ns/op
Rotation.eonRotateRight avgt 15 1933.459 ± 0.255 ns/op
Rotation.ornRotateRight avgt 15 1933.559 ± 0.316 ns/op
Rotation.xorRotateRight avgt 15 1933.467 ± 0.245 ns/op
I would update my patch with the benchmark tests after finishing the whole tests.
--Eric
-----Original Message-----
From: hotspot-compiler-dev <hotspot-compiler-dev-retn at openjdk.java.net> On Behalf Of Andrew Haley
Sent: Saturday, January 30, 2021 12:30 AM
To: hotspot-compiler-dev at openjdk.java.net
Subject: Re: RFR: 8256438: AArch64: Implement match rules with ROR shift register value
On 29/01/2021 10:11, Andrew Haley wrote:
> On 1/29/21 8:35 AM, Eric Liu wrote:
>> I benchmarked on 7 platforms with jmh test[1], most of them were hard to see any performance changes. On one platform the performance become bad, and seems a little unstable.
Your benchmark did not work for me. It did not generate the correct instructions.
Please try with this or similar:
@Benchmark
public void xorRotateRight(MyState s, Blackhole blackhole) {
int x = s.xi;
int y = s.yi;
for (int i = 0; i < COUNT; i++) {
y = x ^ ((y >>> 5) | (y << -5));
x = y ^ ((x >>> 5) | (x << -5));
}
blackhole.consume(x);
}
I get:
Benchmark Mode Cnt Score Error Units
Rotation.xorRotateRight (before) avgt 3 6142.575 ± 15.940 ns/op
Rotation.xorRotateRight (after) avgt 3 4081.587 ± 33.904 ns/op
Please integrate the corrected benchmark into your patch.
--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com> https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the hotspot-compiler-dev
mailing list