VirtualBox

Changeset 106099 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Sep 19, 2024 8:18:15 PM (5 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164875
Message:

VMM/IEM: Moved the kIemNativeGstReg_Pc to the end of the enum to optimize IEMLIVENESSBIT_MASK loading on arm, reducing the liveness code by ~80KB (compressed) / 144 KB (extended layout). bugref:10372

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IEMN8veRecompiler.h

    r106090 r106099  
    634634    {                                     /*   bit no */
    635635        uint64_t    bmGprs      : 16;   /**< 0x00 /  0: The 16 general purpose registers. */
    636         uint64_t    fUnusedPc   :  1;   /**< 0x10 / 16: (PC in ) */
    637         uint64_t    fCr0        :  1;   /**< 0x11 / 17: */
     636        uint64_t    fCr0        :  1;   /**< 0x10 / 16: */
     637        uint64_t    fCr4        :  1;   /**< 0x11 / 17: */
    638638        uint64_t    fFcw        :  1;   /**< 0x12 / 18: */
    639639        uint64_t    fFsw        :  1;   /**< 0x13 / 19: */
     
    642642        uint64_t    bmSegLimit  :  6;   /**< 0x20 / 32: */
    643643        uint64_t    bmSegSel    :  6;   /**< 0x26 / 38: */
    644         uint64_t    fCr4        :  1;   /**< 0x2c / 44: */
    645         uint64_t    fXcr0       :  1;   /**< 0x2d / 45: */
    646         uint64_t    fMxCsr      :  1;   /**< 0x2e / 46: */
    647         uint64_t    fEflOther   :  1;   /**< 0x2f / 47: Other EFLAGS bits   (~X86_EFL_STATUS_BITS & X86_EFL_LIVE_MASK). First! */
    648         uint64_t    fEflCf      :  1;   /**< 0x30 / 48: Carry flag          (X86_EFL_CF / 0). */
    649         uint64_t    fEflPf      :  1;   /**< 0x31 / 49: Parity flag         (X86_EFL_PF / 2). */
    650         uint64_t    fEflAf      :  1;   /**< 0x32 / 50: Auxilary carry flag (X86_EFL_AF / 4). */
    651         uint64_t    fEflZf      :  1;   /**< 0x33 / 51: Zero flag           (X86_EFL_ZF / 6). */
    652         uint64_t    fEflSf      :  1;   /**< 0x34 / 52: Signed flag         (X86_EFL_SF / 7). */
    653         uint64_t    fEflOf      :  1;   /**< 0x35 / 53: Overflow flag       (X86_EFL_OF / 12). */
     644        uint64_t    fXcr0       :  1;   /**< 0x2c / 44: */
     645        uint64_t    fMxCsr      :  1;   /**< 0x2d / 45: */
     646        uint64_t    fEflOther   :  1;   /**< 0x2e / 46: Other EFLAGS bits   (~X86_EFL_STATUS_BITS & X86_EFL_LIVE_MASK). First! */
     647        uint64_t    fEflCf      :  1;   /**< 0x2f / 47: Carry flag          (X86_EFL_CF / 0). */
     648        uint64_t    fEflPf      :  1;   /**< 0x30 / 48: Parity flag         (X86_EFL_PF / 2). */
     649        uint64_t    fEflAf      :  1;   /**< 0x31 / 59: Auxilary carry flag (X86_EFL_AF / 4). */
     650        uint64_t    fEflZf      :  1;   /**< 0x32 / 50: Zero flag           (X86_EFL_ZF / 6). */
     651        uint64_t    fEflSf      :  1;   /**< 0x33 / 51: Signed flag         (X86_EFL_SF / 7). */
     652        uint64_t    fEflOf      :  1;   /**< 0x34 / 52: Overflow flag       (X86_EFL_OF / 12). */
     653        uint64_t    fUnusedPc   :  1;   /**< 0x35 / 53: (PC in ) */
    654654        uint64_t    uUnused     : 10;     /* 0x36 / 54 -> 0x40/64 */
    655655    };
     
    714714/** @name 64-bit value masks for IEMLIVENESSENTRY.
    715715 * @{ */                                      /*         0xzzzzyyyyxxxxwwww */
    716 /** @todo Changing this to 0x003ffffffffffffe would reduce the liveness code
    717  * size by 3.2% on arm in extended layout.  That means moving kIemNativeGstReg_Pc
    718  * to zero, which may have other consequences so needs to be tested in full first. */
    719 #define IEMLIVENESSBIT_MASK                     UINT64_C(0x003ffffffffeffff)
     716#define IEMLIVENESSBIT_MASK                     UINT64_C(0x001fffffffffffff)
    720717
    721718#ifndef IEMLIVENESS_EXTENDED_LAYOUT
     
    727724#endif
    728725
    729 #define IEMLIVENESSBIT_ALL_EFL_MASK             UINT64_C(0x003f800000000000)
    730 #define IEMLIVENESSBIT_STATUS_EFL_MASK          UINT64_C(0x003f000000000000)
     726#define IEMLIVENESSBIT_ALL_EFL_MASK             UINT64_C(0x001fc00000000000)
     727#define IEMLIVENESSBIT_STATUS_EFL_MASK          UINT64_C(0x001f800000000000)
    731728
    732729#ifndef IEMLIVENESS_EXTENDED_LAYOUT
     
    10571054    kIemNativeGstReg_GprFirst      = 0,
    10581055    kIemNativeGstReg_GprLast       = kIemNativeGstReg_GprFirst + 15,
    1059     kIemNativeGstReg_Pc,
    10601056    kIemNativeGstReg_Cr0,
     1057    kIemNativeGstReg_Cr4,
    10611058    kIemNativeGstReg_FpuFcw,
    10621059    kIemNativeGstReg_FpuFsw,
     
    10691066    kIemNativeGstReg_SegSelFirst,
    10701067    kIemNativeGstReg_SegSelLast    = kIemNativeGstReg_SegSelFirst + 5,
    1071     kIemNativeGstReg_Cr4,
    10721068    kIemNativeGstReg_Xcr0,
    10731069    kIemNativeGstReg_MxCsr,
    1074     kIemNativeGstReg_EFlags,            /**< 32-bit, includes internal flags - last! */
     1070    kIemNativeGstReg_EFlags,            /**< 32-bit, includes internal flags. */
     1071    /* 6 entry gap for liveness EFlags subdivisions. */
     1072    kIemNativeGstReg_Pc            = kIemNativeGstReg_EFlags + 7,
    10751073    kIemNativeGstReg_End
    10761074} IEMNATIVEGSTREG;
    10771075AssertCompile((int)kIemNativeGstReg_SegLimitFirst == 32);
    10781076AssertCompile((UINT64_C(0x7f) << kIemNativeGstReg_EFlags) == IEMLIVENESSBIT_ALL_EFL_MASK);
     1077AssertCompile(RT_BIT_64(kIemNativeGstReg_Pc) - UINT64_C(1) == IEMLIVENESSBIT_MASK);
    10791078
    10801079/** @name Helpers for converting register numbers to IEMNATIVEGSTREG values.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette