RFR: 8256318: AArch64: Add support for floating-point absolute difference [v4]

Ningsheng Jian njian at openjdk.java.net
Tue Nov 17 03:51:07 UTC 2020


On Mon, 16 Nov 2020 13:26:23 GMT, Dong Bo <dongbo at openjdk.org> wrote:

>> This supports for floating-point absolute difference instructions, i.e. FABD scalar/vector.
>> 
>> Verified with linux-aarch64-server-release, tier1-3.
>> 
>> Added a JMH micro `test/micro/org/openjdk/bench/vm/compiler/FloatingScalarVectorAbsDiff.java` for performance test.
>> 
>> The FABD (scalar), the performance tests handle registers directly, the average latency reduces to almost half  (~57%) of the original.
>> For FABD (vector), we restrict the data size (~24KB) to be less than L1 data cache size (32KB),
>> so that the memory access can hit in L1, and witness 14.2% (float) and 21.2% (double) improvements.
>> 
>> The JMH results on Kunpeng916:
>> 
>> Benchmark                                            (count)  (seed)  Mode  Cnt     Score    Error  Units
>> 
>> # before, fsub+fabs
>> FloatingScalarVectorAbsDiff.testScalarAbsDiffDouble     1024  316731  avgt   10  6038.333 ± 3.889  ns/op
>> FloatingScalarVectorAbsDiff.testScalarAbsDiffFloat      1024  316731  avgt   10  6005.125 ± 3.025  ns/op
>> FloatingScalarVectorAbsDiff.testVectorAbsDiffDouble     1024  316731  avgt   10   950.340 ± 9.398  ns/op
>> FloatingScalarVectorAbsDiff.testVectorAbsDiffFloat      1024  316731  avgt   10   454.350 ± 1.798  ns/op
>> 
>> # after, fabd
>> FloatingScalarVectorAbsDiff.testScalarAbsDiffDouble     1024  316731  avgt   10  3483.801 ± 1.763  ns/op
>> FloatingScalarVectorAbsDiff.testScalarAbsDiffFloat      1024  316731  avgt   10  3442.412 ± 1.866  ns/op
>> FloatingScalarVectorAbsDiff.testVectorAbsDiffDouble     1024  316731  avgt   10   816.301 ± 4.454  ns/op
>> FloatingScalarVectorAbsDiff.testVectorAbsDiffFloat      1024  316731  avgt   10   354.710 ± 1.001  ns/op
>
> Dong Bo has updated the pull request incrementally with one additional commit since the last revision:
> 
>   move ABS/FABS/FABD neon vector rules into aarch64_neon.ad

src/hotspot/cpu/aarch64/aarch64_neon.ad line 3462:

> 3460: instruct vabs8B(vecD dst, vecD src)
> 3461: %{
> 3462:   predicate(n->as_Vector()->length() == 8);

This is different from original code.

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

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


More information about the hotspot-dev mailing list