RFR: 8264564: AArch64: use MOVI instead of FMOV to zero FP register
Andrew Haley
aph at openjdk.java.net
Fri Apr 2 10:17:22 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.
Marked as reviewed by aph (Reviewer).
-------------
PR: https://git.openjdk.java.net/jdk/pull/3322
More information about the hotspot-dev
mailing list