Changes between Version 1 and Version 2 of Ticket #222, comment 5
- Timestamp:
- Jun 16, 2011, 11:03:32 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #222, comment 5
v1 v2 6 6 {{{ 7 7 8 inline USHORT__fstcw(void)8 inline unsigned __fstcw(void) 9 9 { 10 USHORTout;11 asm ( "fstcw %0\n\t" : "=m" (out) : :);10 unsigned out; 11 asm volatile ( "fstcw %0\n\t" : "=m" (out) ); 12 12 return out; 13 13 } 14 14 15 inline void __fldcw( USHORTin)15 inline void __fldcw(unsigned in) 16 16 { 17 asm ( "fldcw %0\n\t" : : "m" (in) :);17 asm volatile ( "fldcw %0\n\t" : : "m" (in) ); 18 18 } 19 19 20 #define __FPU_CW_SAVE USHORTfcwState = __fstcw();20 #define __FPU_CW_SAVE unsigned fcwState = __fstcw(); 21 21 #define __FPU_CW_RESTORE __fldcw(fcwState); 22 22 … … 38 38 IMHO, this generates the most efficient code. GCC's inline assembler is always fun... 39 39 40 Update: I had to change the code a bit to make it work correctly with GCC335. However, GCC4 produces better output.