Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3192

Show
Ignore:
Timestamp:
02/15/08 14:43:40 (5 months ago)
Author:
larsivi
Message:

Workaround for gdc function calling mess. thanks Don! refs #463

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/math/IEEE.d

    r3189 r3192  
    247247        // a struct containing only a int is returned in EAX. 
    248248       version(D_InlineAsm_X86) { 
    249            asm { 
    250               fstsw AX; 
    251               // NOTE: If compiler supports SSE2, need to OR the result with 
    252               // the SSE2 status register. 
    253               // Clear all irrelevant bits 
    254               and EAX, 0x03D; 
     249           version(GNU) { 
     250             IeeeFlags tmp1; 
     251             asm { 
     252                 fstsw AX; 
     253                 // NOTE: If compiler supports SSE2, need to OR the result with 
     254                 // the SSE2 status register. 
     255                 // Clear all irrelevant bits 
     256                 and EAX, 0x03D; 
     257                 mov tmp1, EAX; 
     258             } 
     259             return tmp1; 
     260           } 
     261           else { // DMD 
     262             // In this case, we 
     263             // take advantage of the fact that for DMD 
     264             // a struct containing only a int is returned in EAX. 
     265             asm { 
     266                 fstsw AX; 
     267                 // NOTE: If compiler supports SSE2, need to OR the result with 
     268                 // the SSE2 status register. 
     269                 // Clear all irrelevant bits 
     270                 and EAX, 0x03D; 
     271             } 
    255272           } 
    256273       } else {