84 lines
1.0 KiB
Plaintext
84 lines
1.0 KiB
Plaintext
|
/* Set 80387 floating point hardware rounding precision */
|
||
|
|
||
|
.file "setprec.387"
|
||
|
.version "01.01"
|
||
|
.text
|
||
|
.align 16
|
||
|
|
||
|
.globl sprec
|
||
|
sprec:
|
||
|
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
|
||
|
.Lfe1:
|
||
|
.size sprec,.Lfe1-sprec
|
||
|
.align 16
|
||
|
|
||
|
.globl dprec
|
||
|
dprec:
|
||
|
pushl %ebp
|
||
|
movl %esp,%ebp
|
||
|
pushl %eax
|
||
|
subl $4,%esp
|
||
|
fstcw (%esp)
|
||
|
fwait
|
||
|
movl (%esp),%eax
|
||
|
andl $0xfcff,%eax
|
||
|
/* trap on overflow */
|
||
|
/* andl $0xfcf7,%eax */
|
||
|
orl $0x200,%eax
|
||
|
movl %eax,(%esp)
|
||
|
fldcw (%esp)
|
||
|
popl %eax
|
||
|
popl %eax
|
||
|
leave
|
||
|
ret
|
||
|
.Lfe2:
|
||
|
.size dprec,.Lfe2-dprec
|
||
|
.align 16
|
||
|
|
||
|
.globl ldprec
|
||
|
ldprec:
|
||
|
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
|
||
|
.Lfe3:
|
||
|
.size ldprec,.Lfe3-ldprec
|
||
|
|
||
|
.align 16
|
||
|
.globl getprec
|
||
|
getprec:
|
||
|
pushl %ebp
|
||
|
movl %esp,%ebp
|
||
|
subl $4,%esp
|
||
|
fstcw (%esp)
|
||
|
fwait
|
||
|
movl (%esp),%eax
|
||
|
leave
|
||
|
ret
|
||
|
.Lfe4:
|
||
|
.size getprec,.Lfe4-getprec
|
||
|
|