/* Set 80387 floating point hardware rounding precision */ .file "setprecf.387" .text .align 2 .globl _sprecf _sprecf: pushl %ebp movl %esp,%ebp pushl %eax subl $4,%esp fstcw (%esp) fwait movl (%esp),%eax andl $0xfcff,%eax movl %eax,(%esp) fldcw (%esp) popl %eax popl %eax leave ret .align 2 .globl _dprecf _dprecf: pushl %ebp movl %esp,%ebp pushl %eax subl $4,%esp fstcw (%esp) fwait movl (%esp),%eax /* andl $0xfcff,%eax */ /* exception on overflow */ andl $0xfcf7,%eax orl $0x200,%eax movl %eax,(%esp) fldcw (%esp) popl %eax popl %eax leave ret .align 2 .globl _ldprecf _ldprecf: pushl %ebp movl %esp,%ebp pushl %eax subl $4,%esp fstcw (%esp) fwait movl (%esp),%eax orl $0x300,%eax movl %eax,(%esp) fldcw (%esp) popl %eax popl %eax leave ret .globl _getprec _getprec: pushl %ebp movl %esp,%ebp subl $4,%esp fstcw (%esp) fwait movl (%esp),%eax leave ret