finish making sys_ia32.S PIC friendly

This commit is contained in:
Bill Currie 2002-06-03 04:06:25 +00:00
parent e1d66fdfb8
commit 07c7c05f64

View file

@ -52,33 +52,45 @@ fpenv:
addl $C(_GLOBAL_OFFSET_TABLE_)+[.-.Lpic##n],%edx addl $C(_GLOBAL_OFFSET_TABLE_)+[.-.Lpic##n],%edx
#define got_var(v) v@GOT(%edx) #define got_var(v) v@GOT(%edx)
#define F_BEGIN(name) \
.globl C(name) ;\
.type C(name),@function ;\
C(name):
#define F_END(name) .size C(name),.-C(name)
#else #else
#define got_base(n) #define got_base(n)
#define got_var(v) v #define got_var(v) v
#define F_BEGIN(name) \
.globl C(name) ;\
C(name):
#define F_END(name)
#endif #endif
.text .text
.globl C(MaskExceptions) F_BEGIN(MaskExceptions)
#ifdef PIC
.type C(MaskExceptions),@function
#endif
C(MaskExceptions):
got_base(1) got_base(1)
fnstenv got_var(fpenv) fnstenv got_var(fpenv)
orl $0x3F,got_var(fpenv) orl $0x3F,got_var(fpenv)
fldenv got_var(fpenv) fldenv got_var(fpenv)
ret ret
F_END(MaskExceptions)
#if 0 #if 0
.globl C(unmaskexceptions) F_BEGIN(unmaskexceptions)
C(unmaskexceptions):
fnstenv got_var(fpenv) fnstenv got_var(fpenv)
andl $0xFFFFFFE0,got_var(fpenv) andl $0xFFFFFFE0,got_var(fpenv)
fldenv got_var(fpenv) fldenv got_var(fpenv)
ret ret
F_END(unmaskexceptions)
#endif #endif
.data .data
@ -93,33 +105,32 @@ pushed_cw: .long 0
.text .text
.globl C(Sys_LowFPPrecision) F_BEGIN(Sys_LowFPPrecision)
C(Sys_LowFPPrecision):
fldcw got_var(single_cw) fldcw got_var(single_cw)
ret ret
F_END(Sys_LowFPPrecision)
.globl C(Sys_HighFPPrecision) F_BEGIN(Sys_HighFPPrecision)
C(Sys_HighFPPrecision):
fldcw got_var(full_cw) fldcw got_var(full_cw)
ret ret
F_END(Sys_HighFPPrecision)
.globl C(Sys_PushFPCW_SetHigh) F_BEGIN(Sys_PushFPCW_SetHigh)
C(Sys_PushFPCW_SetHigh):
fnstcw got_var(pushed_cw) fnstcw got_var(pushed_cw)
fldcw got_var(full_cw) fldcw got_var(full_cw)
ret ret
F_END(Sys_PushFPCW_SetHigh)
.globl C(Sys_PopFPCW) F_BEGIN(Sys_PopFPCW)
C(Sys_PopFPCW):
fldcw got_var(pushed_cw) fldcw got_var(pushed_cw)
ret ret
F_END(Sys_PopFPCW)
.globl C(Sys_SetFPCW) F_BEGIN(Sys_SetFPCW)
C(Sys_SetFPCW):
fnstcw got_var(cw) fnstcw got_var(cw)
movl got_var(cw),%eax movl got_var(cw),%eax
andb $0xF0,%ah andb $0xF0,%ah
@ -135,4 +146,5 @@ C(Sys_SetFPCW):
movl %eax,got_var(ceil_cw) movl %eax,got_var(ceil_cw)
ret ret
F_END(Sys_SetFPCW)
#endif /* USE_INTEL_ASM */ #endif /* USE_INTEL_ASM */