AArch64: use MOVI instead of FMOV to zero FP register

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 17
    • Affects Version/s: 17
    • Component/s: hotspot
    • b17
    • aarch64

      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.

            Assignee:
            Nick Gasson
            Reporter:
            Nick Gasson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: