VirtualBox

Changeset 94639 in vbox for trunk/include/iprt/x86.h


Ignore:
Timestamp:
Apr 19, 2022 9:23:29 PM (3 years ago)
Author:
vboxsync
Message:

iprt/x86.h: Some X86_FSW_ macros and defins for assisting with the FPREM and FPREM1 instructions. bugref:9898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/x86.h

    r94505 r94639  
    32613261#define X86_FSW_XCPT_ES_MASK UINT16_C(0x00ff)
    32623262/** Condition code 0. */
    3263 #define X86_FSW_C0          RT_BIT_32(8)
     3263#define X86_FSW_C0          RT_BIT_32(X86_FSW_C0_BIT)
     3264#define X86_FSW_C0_BIT      8
    32643265/** Condition code 1. */
    3265 #define X86_FSW_C1          RT_BIT_32(9)
     3266#define X86_FSW_C1          RT_BIT_32(X86_FSW_C1_BIT)
     3267#define X86_FSW_C1_BIT      9
    32663268/** Condition code 2. */
    3267 #define X86_FSW_C2          RT_BIT_32(10)
     3269#define X86_FSW_C2          RT_BIT_32(X86_FSW_C2_BIT)
     3270#define X86_FSW_C2_BIT      10
    32683271/** Top of the stack mask. */
    32693272#define X86_FSW_TOP_MASK    UINT16_C(0x3800)
     
    32773280#define X86_FSW_TOP_GET_ST(a_uFsw, a_iSt) ((((a_uFsw) >> X86_FSW_TOP_SHIFT) + (a_iSt)) & X86_FSW_TOP_SMASK)
    32783281/** Condition code 3. */
    3279 #define X86_FSW_C3          RT_BIT_32(14)
     3282#define X86_FSW_C3          RT_BIT_32(X86_FSW_C3_BIT)
     3283#define X86_FSW_C3_BIT      14
    32803284/** Mask of exceptions flags, including the summary bit. */
    32813285#define X86_FSW_C_MASK      UINT16_C(0x4700)
    32823286/** FPU busy. */
    32833287#define X86_FSW_B           RT_BIT_32(15)
     3288/** For use with FPREM and FPREM1. */
     3289#define X86_FSW_CX_TO_QUOTIENT(a_fFsw) \
     3290    (  (((a_fFsw) & X86_FSW_C1) >> (X86_FSW_C1_BIT - 0)) \
     3291     | (((a_fFsw) & X86_FSW_C3) >> (X86_FSW_C3_BIT - 1)) \
     3292     | (((a_fFsw) & X86_FSW_C0) >> (X86_FSW_C0_BIT - 2)) )
     3293/** For use with FPREM and FPREM1. */
     3294#define X86_FSW_CX_FROM_QUOTIENT(a_uQuotient) \
     3295    (  ((uint16_t)((a_uQuotient) & 1) << (X86_FSW_C1_BIT - 0)) \
     3296     | ((uint16_t)((a_uQuotient) & 2) << (X86_FSW_C3_BIT - 1)) \
     3297     | ((uint16_t)((a_uQuotient) & 4) << (X86_FSW_C0_BIT - 2)) )
    32843298/** @} */
    32853299
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