VirtualBox

Ignore:
Timestamp:
Feb 2, 2012 6:17:20 PM (13 years ago)
Author:
vboxsync
Message:

REM: Don't pollute the FPU state with random garbage (from the stack).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/target-i386/op_helper.c

    r37702 r39966  
    59475947static inline CPU86_LDouble helper_fldt_raw(uint8_t *ptr)
    59485948{
     5949#ifdef USE_X86LDOUBLE
     5950    CPU86_LDoubleU tmp;
     5951    tmp.l.lower = *(uint64_t const *)ptr;
     5952    tmp.l.upper = *(uint16_t const *)(ptr + 8);
     5953    return tmp.d;
     5954#else
     5955# error "Busted FPU saving/restoring!"
    59495956    return *(CPU86_LDouble *)ptr;
     5957#endif
    59505958}
    59515959
    59525960static inline void helper_fstt_raw(CPU86_LDouble f, uint8_t *ptr)
    59535961{
     5962#ifdef USE_X86LDOUBLE
     5963    CPU86_LDoubleU tmp;
     5964    tmp.d = f;
     5965    *(uint64_t *)(ptr +  0) = tmp.l.lower;
     5966    *(uint16_t *)(ptr +  8) = tmp.l.upper;
     5967    *(uint16_t *)(ptr + 10) = 0;
     5968    *(uint32_t *)(ptr + 12) = 0;
     5969#else
     5970# error "Busted FPU saving/restoring!"
    59545971    *(CPU86_LDouble *)ptr = f;
     5972#endif
    59555973}
    59565974
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