* access the Default8087CW global variable directly from within inline asm,

instead of copying it to a local var first, since the concern about PIC code
  (this asm code started out as a copy of the i386 rtl code) doesn't exist on
  the i8086, since there's no such thing as PIC code on the i8086

git-svn-id: trunk@41311 -
This commit is contained in:
nickysn 2019-02-12 16:31:16 +00:00
parent d4e059bd41
commit 4f573b50ad
2 changed files with 11 additions and 26 deletions

View File

@ -1197,33 +1197,21 @@ procedure DetectFPU;
{$ifndef FPC_SYSTEM_HAS_SYSINITFPU}
{$define FPC_SYSTEM_HAS_SYSINITFPU}
Procedure SysInitFPU;
var
{ these locals are so we don't have to hack pic code in the assembler }
localfpucw: word;
begin
localfpucw:=Default8087CW;
asm
fninit
fldcw localfpucw
fwait
end;
Procedure SysInitFPU; assembler;
asm
fninit
fldcw Default8087CW
fwait
end;
{$endif ndef FPC_SYSTEM_HAS_SYSINITFPU}
{$define FPC_SYSTEM_HAS_SYSRESETFPU}
Procedure SysResetFPU;
var
{ these locals are so we don't have to hack pic code in the assembler }
localfpucw: word;
begin
localfpucw:=Default8087CW;
asm
fninit
fwait
fldcw localfpucw
end;
Procedure SysResetFPU; assembler;
asm
fninit
fwait
fldcw Default8087CW
end;
{$I int32p.inc}

View File

@ -168,8 +168,6 @@ Procedure SysInitFPU;
CR0_NE = $20;
CR0_NOT_NE = $FFFF - CR0_NE;
var
{ these locals are so we don't have to hack pic code in the assembler }
localfpucw: word;
prevInt06 : FarPointer;
_newcr0_lw : word;
restore_old_int10 : boolean;
@ -177,10 +175,9 @@ Procedure SysInitFPU;
begin
restore_old_int10:=false;
localfpucw:=Default8087CW;
asm
fninit
fldcw localfpucw
fldcw Default8087CW
fwait
end;
if Test8087 < 3 then { i8087/i80287 do not have "native" exception mode (CR0:NE) }