Integrated: 8264564: AArch64: use MOVI instead of FMOV to zero FP register

Nick Gasson ngasson at openjdk.java.net
Tue Apr 6 02:47:27 UTC 2021


On Fri, 2 Apr 2021 09:02:36 GMT, Nick Gasson <ngasson at openjdk.org> wrote:

> HotSpot generates an FMOV from ZR to zero a floating point register:
> 
>    fmov d0, xzr
> 
> This used to be recommended by the Arm ARM, but that advice was removed
> in revision A.j and subsequent revisions (section C.5.3).
> 
> Integer->FP moves may be slow on some cores. Instead the preferred
> instruction is MOVI with immediate zero:
> 
>    movi d0, #0x0
> 
> Some micro-architectures special-case FMOV from ZR, and on those cores
> this change will have no effect, but in any case FMOV won't be faster
> than MOVI.
> 
> GCC made this change back in 2016:
>   https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=523d72071960
> 
> Tested tier1 on AArch64. I don't expect this to have any visible effect
> on benchmarks.

This pull request has now been integrated.

Changeset: 43d4a6f6
Author:    Nick Gasson <ngasson at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/43d4a6f6
Stats:     5 lines in 3 files changed: 0 ins; 0 del; 5 mod

8264564: AArch64: use MOVI instead of FMOV to zero FP register

Reviewed-by: aph

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

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


More information about the hotspot-dev mailing list