minor 387 fenv optimizations
authorRich Felker <dalias@aerifal.cx>
Sat, 17 Mar 2012 21:49:10 +0000 (17:49 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 17 Mar 2012 21:49:10 +0000 (17:49 -0400)
src/fenv/i386/fenv.s

index ee2eae6..647b796 100644 (file)
@@ -31,22 +31,21 @@ feraiseexcept:
 .type fesetround,@function
 fesetround:
        mov 4(%esp),%ecx
 .type fesetround,@function
 fesetround:
        mov 4(%esp),%ecx
+       push %eax
        xor %eax,%eax
        xor %eax,%eax
-       sub $4,%esp
        fnstcw (%esp)
        andb $0xf3,1(%esp)
        fnstcw (%esp)
        andb $0xf3,1(%esp)
-       or %cx,(%esp)
+       or %ch,1(%esp)
        fldcw (%esp)
        fldcw (%esp)
-       add $4,%esp
+       pop %ecx
        ret
 
 .global fegetround
 .type fegetround,@function
 fegetround:
        ret
 
 .global fegetround
 .type fegetround,@function
 fegetround:
-       sub $4,%esp
+       push %eax
        fnstcw (%esp)
        fnstcw (%esp)
-       mov (%esp),%ax
-       add $4,%esp
+       pop %eax
        and $0xc00,%eax
        ret
 
        and $0xc00,%eax
        ret