* Get8087CW: use fixed stack.

* Set8087CW: updated to i386 version, eliminates need of PIC code in assembler.
* GetSSECSR: updated similar to Get8087CW, it is somewhat shorter that way.

git-svn-id: trunk@19463 -
This commit is contained in:
sergei 2011-10-11 09:08:09 +00:00
parent 21ac5dfb3b
commit 4a3c7f7ef4

View File

@ -17,7 +17,7 @@ label
FPC_ABSMASK_DOUBLE,
FPC_ABSMASK_SINGLE;
procedure dummyproc;assembler;
procedure dummyproc;assembler;nostackframe;
asm
.data
.balign 16
@ -36,30 +36,25 @@ FPC_ABSMASK_DOUBLE:
FPU Control word
****************************************************************************}
procedure Set8087CW(cw:word);assembler;
asm
movw cw,%ax
{$ifdef FPC_PIC}
movq default8087cw@GOTPCREL(%rip),%rdx
movw %ax,(%rdx)
fnclex
fldcw (%rdx)
{$else FPC_PIC}
movw %ax,default8087cw{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
fnclex
fldcw default8087cw{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
{$endif FPC_PIC}
procedure Set8087CW(cw:word);
begin
default8087cw:=cw;
asm
fnclex
fldcw cw
end;
end;
function Get8087CW:word;assembler;
var
tmp: word;
asm
pushq $0
fnstcw (%rsp)
popq %rax
fnstcw tmp
movq tmp,%rax
end;
procedure SetSSECSR(w : dword);
begin
mxcsr:=w;
@ -67,16 +62,14 @@ FPC_ABSMASK_DOUBLE:
ldmxcsr w
end;
end;
function GetSSECSR : dword;
function GetSSECSR : dword;assembler;
var
_w : dword;
begin
asm
stmxcsr _w
end;
result:=_w;
asm
stmxcsr _w
movl _w,%eax
end;
{****************************************************************************