VirtualBox

Ignore:
Timestamp:
Apr 11, 2022 1:55:56 PM (3 years ago)
Author:
vboxsync
Message:

VMM/IEM,libs/softfloat: Don't use global variables in SoftFloat, pass in a state pointer to (almost) all functions instead. Started on fsqrt instruction implementation. bugref:9898

Location:
trunk/src/libs/softfloat-3e/source/8086-SSE
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_extF80MToCommonNaN.c

    r94480 r94558  
    4949void
    5050 softfloat_extF80MToCommonNaN(
    51      const struct extFloat80M *aSPtr, struct commonNaN *zPtr )
     51     const struct extFloat80M *aSPtr, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA )
    5252{
    5353
    5454    if ( extF80M_isSignalingNaN( (const extFloat80_t *) aSPtr ) ) {
    55         softfloat_raiseFlags( softfloat_flag_invalid );
     55        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    5656    }
    5757    zPtr->sign = signExtF80UI64( aSPtr->signExp );
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_extF80UIToCommonNaN.c

    r94480 r94558  
    4949void
    5050 softfloat_extF80UIToCommonNaN(
    51      uint_fast16_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr )
     51     uint_fast16_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA )
    5252{
    5353
    5454    if ( softfloat_isSigNaNExtF80UI( uiA64, uiA0 ) ) {
    55         softfloat_raiseFlags( softfloat_flag_invalid );
     55        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    5656    }
    5757    zPtr->sign = uiA64>>15;
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_f128MToCommonNaN.c

    r94480 r94558  
    5050*----------------------------------------------------------------------------*/
    5151void
    52  softfloat_f128MToCommonNaN( const uint32_t *aWPtr, struct commonNaN *zPtr )
     52 softfloat_f128MToCommonNaN( const uint32_t *aWPtr, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA )
    5353{
    5454
    5555    if ( f128M_isSignalingNaN( (const float128_t *) aWPtr ) ) {
    56         softfloat_raiseFlags( softfloat_flag_invalid );
     56        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    5757    }
    5858    zPtr->sign = aWPtr[indexWordHi( 4 )]>>31;
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_f128UIToCommonNaN.c

    r94480 r94558  
    5050void
    5151 softfloat_f128UIToCommonNaN(
    52      uint_fast64_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr )
     52     uint_fast64_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA )
    5353{
    5454    struct uint128 NaNSig;
    5555
    5656    if ( softfloat_isSigNaNF128UI( uiA64, uiA0 ) ) {
    57         softfloat_raiseFlags( softfloat_flag_invalid );
     57        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    5858    }
    5959    NaNSig = softfloat_shortShiftLeft128( uiA64, uiA0, 16 );
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_f16UIToCommonNaN.c

    r94480 r94558  
    4646| exception is raised.
    4747*----------------------------------------------------------------------------*/
    48 void softfloat_f16UIToCommonNaN( uint_fast16_t uiA, struct commonNaN *zPtr )
     48void softfloat_f16UIToCommonNaN( uint_fast16_t uiA, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA )
    4949{
    5050
    5151    if ( softfloat_isSigNaNF16UI( uiA ) ) {
    52         softfloat_raiseFlags( softfloat_flag_invalid );
     52        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    5353    }
    5454    zPtr->sign = uiA>>15;
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_f32UIToCommonNaN.c

    r94480 r94558  
    4646| exception is raised.
    4747*----------------------------------------------------------------------------*/
    48 void softfloat_f32UIToCommonNaN( uint_fast32_t uiA, struct commonNaN *zPtr )
     48void softfloat_f32UIToCommonNaN( uint_fast32_t uiA, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA )
    4949{
    5050
    5151    if ( softfloat_isSigNaNF32UI( uiA ) ) {
    52         softfloat_raiseFlags( softfloat_flag_invalid );
     52        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    5353    }
    5454    zPtr->sign = uiA>>31;
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_f64UIToCommonNaN.c

    r94480 r94558  
    4646| exception is raised.
    4747*----------------------------------------------------------------------------*/
    48 void softfloat_f64UIToCommonNaN( uint_fast64_t uiA, struct commonNaN *zPtr )
     48void softfloat_f64UIToCommonNaN( uint_fast64_t uiA, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA )
    4949{
    5050
    5151    if ( softfloat_isSigNaNF64UI( uiA ) ) {
    52         softfloat_raiseFlags( softfloat_flag_invalid );
     52        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    5353    }
    5454    zPtr->sign = uiA>>63;
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_propagateNaNExtF80M.c

    r94480 r94558  
    5353     const struct extFloat80M *bSPtr,
    5454     struct extFloat80M *zSPtr
     55     SOFTFLOAT_STATE_DECL_COMMA
    5556 )
    5657{
     
    6768    sPtr = aSPtr;
    6869    if ( ! bSPtr ) {
    69         if ( isSigNaNA ) softfloat_raiseFlags( softfloat_flag_invalid );
     70        if ( isSigNaNA ) softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    7071        goto copy;
    7172    }
    7273    isSigNaNB = extF80M_isSignalingNaN( (const extFloat80_t *) bSPtr );
    7374    if ( isSigNaNA | isSigNaNB ) {
    74         softfloat_raiseFlags( softfloat_flag_invalid );
     75        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    7576        if ( isSigNaNA ) {
    7677            uiB64 = bSPtr->signExp;
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_propagateNaNExtF80UI.c

    r94480 r94558  
    5757     uint_fast16_t uiB64,
    5858     uint_fast64_t uiB0
     59     SOFTFLOAT_STATE_DECL_COMMA
    5960 )
    6061{
     
    7677    *------------------------------------------------------------------------*/
    7778    if ( isSigNaNA | isSigNaNB ) {
    78         softfloat_raiseFlags( softfloat_flag_invalid );
     79        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    7980        if ( isSigNaNA ) {
    8081            if ( isSigNaNB ) goto returnLargerMag;
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_propagateNaNF128M.c

    r94480 r94558  
    5252void
    5353 softfloat_propagateNaNF128M(
    54      const uint32_t *aWPtr, const uint32_t *bWPtr, uint32_t *zWPtr )
     54     const uint32_t *aWPtr, const uint32_t *bWPtr, uint32_t *zWPtr SOFTFLOAT_STATE_DECL_COMMA )
    5555{
    5656    bool isSigNaNA;
     
    6363            || (bWPtr && f128M_isSignalingNaN( (const float128_t *) bWPtr ))
    6464    ) {
    65         softfloat_raiseFlags( softfloat_flag_invalid );
     65        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    6666        if ( isSigNaNA ) goto copy;
    6767    }
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_propagateNaNF128UI.c

    r94480 r94558  
    5757     uint_fast64_t uiB64,
    5858     uint_fast64_t uiB0
     59     SOFTFLOAT_STATE_DECL_COMMA
    5960 )
    6061{
     
    6465    isSigNaNA = softfloat_isSigNaNF128UI( uiA64, uiA0 );
    6566    if ( isSigNaNA || softfloat_isSigNaNF128UI( uiB64, uiB0 ) ) {
    66         softfloat_raiseFlags( softfloat_flag_invalid );
     67        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    6768        if ( isSigNaNA ) goto returnNonsigA;
    6869    }
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_propagateNaNF16UI.c

    r94480 r94558  
    4949*----------------------------------------------------------------------------*/
    5050uint_fast16_t
    51  softfloat_propagateNaNF16UI( uint_fast16_t uiA, uint_fast16_t uiB )
     51 softfloat_propagateNaNF16UI( uint_fast16_t uiA, uint_fast16_t uiB SOFTFLOAT_STATE_DECL_COMMA )
    5252{
    5353    bool isSigNaNA;
     
    5555    isSigNaNA = softfloat_isSigNaNF16UI( uiA );
    5656    if ( isSigNaNA || softfloat_isSigNaNF16UI( uiB ) ) {
    57         softfloat_raiseFlags( softfloat_flag_invalid );
     57        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    5858        if ( isSigNaNA ) return uiA | 0x0200;
    5959    }
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_propagateNaNF32UI.c

    r94480 r94558  
    4949*----------------------------------------------------------------------------*/
    5050uint_fast32_t
    51  softfloat_propagateNaNF32UI( uint_fast32_t uiA, uint_fast32_t uiB )
     51 softfloat_propagateNaNF32UI( uint_fast32_t uiA, uint_fast32_t uiB SOFTFLOAT_STATE_DECL_COMMA )
    5252{
    5353    bool isSigNaNA;
     
    5555    isSigNaNA = softfloat_isSigNaNF32UI( uiA );
    5656    if ( isSigNaNA || softfloat_isSigNaNF32UI( uiB ) ) {
    57         softfloat_raiseFlags( softfloat_flag_invalid );
     57        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    5858        if ( isSigNaNA ) return uiA | 0x00400000;
    5959    }
  • trunk/src/libs/softfloat-3e/source/8086-SSE/s_propagateNaNF64UI.c

    r94480 r94558  
    4949*----------------------------------------------------------------------------*/
    5050uint_fast64_t
    51  softfloat_propagateNaNF64UI( uint_fast64_t uiA, uint_fast64_t uiB )
     51 softfloat_propagateNaNF64UI( uint_fast64_t uiA, uint_fast64_t uiB SOFTFLOAT_STATE_DECL_COMMA )
    5252{
    5353    bool isSigNaNA;
     
    5555    isSigNaNA = softfloat_isSigNaNF64UI( uiA );
    5656    if ( isSigNaNA || softfloat_isSigNaNF64UI( uiB ) ) {
    57         softfloat_raiseFlags( softfloat_flag_invalid );
     57        softfloat_raiseFlags( softfloat_flag_invalid SOFTFLOAT_STATE_ARG_COMMA );
    5858        if ( isSigNaNA ) return uiA | UINT64_C( 0x0008000000000000 );
    5959    }
  • trunk/src/libs/softfloat-3e/source/8086-SSE/softfloat_raiseFlags.c

    r94480 r94558  
    4444| should be simply `softfloat_exceptionFlags |= flags;'.
    4545*----------------------------------------------------------------------------*/
    46 void softfloat_raiseFlags( uint_fast8_t flags )
     46void softfloat_raiseFlags( uint_fast8_t flags SOFTFLOAT_STATE_ARG_COMMA )
    4747{
    4848
     49#ifdef VBOX_WITHOUT_SOFTFLOAT_GLOBALS
    4950    softfloat_exceptionFlags |= flags;
     51#else
     52    pState->exceptionFlags   |= flags;
     53#endif
    5054
    5155}
  • trunk/src/libs/softfloat-3e/source/8086-SSE/specialize.h

    r94480 r94558  
    101101| exception is raised.
    102102*----------------------------------------------------------------------------*/
    103 void softfloat_f16UIToCommonNaN( uint_fast16_t uiA, struct commonNaN *zPtr );
     103void softfloat_f16UIToCommonNaN( uint_fast16_t uiA, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA );
    104104
    105105/*----------------------------------------------------------------------------
     
    116116*----------------------------------------------------------------------------*/
    117117uint_fast16_t
    118  softfloat_propagateNaNF16UI( uint_fast16_t uiA, uint_fast16_t uiB );
     118 softfloat_propagateNaNF16UI( uint_fast16_t uiA, uint_fast16_t uiB SOFTFLOAT_STATE_DECL_COMMA );
    119119
    120120/*----------------------------------------------------------------------------
     
    136136| exception is raised.
    137137*----------------------------------------------------------------------------*/
    138 void softfloat_f32UIToCommonNaN( uint_fast32_t uiA, struct commonNaN *zPtr );
     138void softfloat_f32UIToCommonNaN( uint_fast32_t uiA, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA );
    139139
    140140/*----------------------------------------------------------------------------
     
    151151*----------------------------------------------------------------------------*/
    152152uint_fast32_t
    153  softfloat_propagateNaNF32UI( uint_fast32_t uiA, uint_fast32_t uiB );
     153 softfloat_propagateNaNF32UI( uint_fast32_t uiA, uint_fast32_t uiB SOFTFLOAT_STATE_DECL_COMMA );
    154154
    155155/*----------------------------------------------------------------------------
     
    171171| exception is raised.
    172172*----------------------------------------------------------------------------*/
    173 void softfloat_f64UIToCommonNaN( uint_fast64_t uiA, struct commonNaN *zPtr );
     173void softfloat_f64UIToCommonNaN( uint_fast64_t uiA, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA );
    174174
    175175/*----------------------------------------------------------------------------
     
    186186*----------------------------------------------------------------------------*/
    187187uint_fast64_t
    188  softfloat_propagateNaNF64UI( uint_fast64_t uiA, uint_fast64_t uiB );
     188 softfloat_propagateNaNF64UI( uint_fast64_t uiA, uint_fast64_t uiB SOFTFLOAT_STATE_DECL_COMMA );
    189189
    190190/*----------------------------------------------------------------------------
     
    218218void
    219219 softfloat_extF80UIToCommonNaN(
    220      uint_fast16_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr );
     220     uint_fast16_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA );
    221221
    222222/*----------------------------------------------------------------------------
     
    242242     uint_fast16_t uiB64,
    243243     uint_fast64_t uiB0
     244     SOFTFLOAT_STATE_DECL_COMMA
    244245 );
    245246
     
    267268void
    268269 softfloat_f128UIToCommonNaN(
    269      uint_fast64_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr );
     270     uint_fast64_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA );
    270271
    271272/*----------------------------------------------------------------------------
     
    290291     uint_fast64_t uiB64,
    291292     uint_fast64_t uiB0
     293     SOFTFLOAT_STATE_DECL_COMMA
    292294 );
    293295
     
    307309void
    308310 softfloat_extF80MToCommonNaN(
    309      const struct extFloat80M *aSPtr, struct commonNaN *zPtr );
     311     const struct extFloat80M *aSPtr, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA );
    310312
    311313/*----------------------------------------------------------------------------
     
    329331     const struct extFloat80M *bSPtr,
    330332     struct extFloat80M *zSPtr
     333     SOFTFLOAT_STATE_DECL_COMMA
    331334 );
    332335
     
    348351*----------------------------------------------------------------------------*/
    349352void
    350  softfloat_f128MToCommonNaN( const uint32_t *aWPtr, struct commonNaN *zPtr );
     353 softfloat_f128MToCommonNaN( const uint32_t *aWPtr, struct commonNaN *zPtr SOFTFLOAT_STATE_DECL_COMMA );
    351354
    352355/*----------------------------------------------------------------------------
     
    369372void
    370373 softfloat_propagateNaNF128M(
    371      const uint32_t *aWPtr, const uint32_t *bWPtr, uint32_t *zWPtr );
     374     const uint32_t *aWPtr, const uint32_t *bWPtr, uint32_t *zWPtr SOFTFLOAT_STATE_DECL_COMMA );
    372375
    373376#endif
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