*sigh*, I'm having a real problem this morning :P

This commit is contained in:
Bill Currie 2002-06-07 15:11:59 +00:00
parent c0888ae8e4
commit 3de07df3d2

View file

@ -74,99 +74,12 @@ C(name):
.text
F_BEGIN(MaskExceptions)
F_BEGIN(Sys_MaskExceptions)
got_base(1)
fnstenv got_var(fpenv)
orl $0x3F,got_var(fpenv)
fldenv got_var(fpenv)
ret
F_END(MaskExceptions)
#if 0
F_BEGIN(unmaskexceptions)
got_base(2)
fnstenv got_var(fpenv)
andl $0xFFFFFFE0,got_var(fpenv)
fldenv got_var(fpenv)
ret
F_END(unmaskexceptions)
#endif
.data
.align 4
.globl ceil_cw, single_cw, full_cw, cw, pushed_cw
ceil_cw: .long 0
single_cw: .long 0
full_cw: .long 0
cw: .long 0
pushed_cw: .long 0
#ifdef PIC
.type ceil_cw,@object
.type single_cw,@object
.type full_cw,@object
.type cw,@object
.type pushed_cw,@object
.size ceil_cw,4
.size single_cw,4
.size full_cw,4
.size cw,4
.size pushed_cw,4
#endif
.text
F_BEGIN(R_LowFPPrecision)
got_base(3)
fldcw got_var(single_cw)
ret
F_END(R_LowFPPrecision)
F_BEGIN(R_HighFPPrecision)
got_base(4)
fldcw got_var(full_cw)
ret
F_END(R_HighFPPrecision)
F_BEGIN(R_PushFPCW_SetHigh)
got_base(5)
fnstcw got_var(pushed_cw)
fldcw got_var(full_cw)
ret
F_END(R_PushFPCW_SetHigh)
F_BEGIN(R_PopFPCW)
got_base(6)
fldcw got_var(pushed_cw)
ret
F_END(R_PopFPCW)
F_BEGIN(R_SetFPCW)
got_base(7)
fnstcw got_var(cw)
movl got_var(cw),%eax
andb $0xF0,%ah
orb $0x03,%ah // round mode, 64-bit precision
movl %eax,got_var(full_cw)
andb $0xF0,%ah
orb $0x0C,%ah // chop mode, single precision
movl %eax,got_var(single_cw)
andb $0xF0,%ah
orb $0x08,%ah // ceil mode, single precision
movl %eax,got_var(ceil_cw)
ret
F_END(R_SetFPCW)
F_END(Sys_MaskExceptions)
#endif /* USE_INTEL_ASM */