mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 09:06:02 +02:00
* 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:
parent
21ac5dfb3b
commit
4a3c7f7ef4
@ -17,7 +17,7 @@ label
|
|||||||
FPC_ABSMASK_DOUBLE,
|
FPC_ABSMASK_DOUBLE,
|
||||||
FPC_ABSMASK_SINGLE;
|
FPC_ABSMASK_SINGLE;
|
||||||
|
|
||||||
procedure dummyproc;assembler;
|
procedure dummyproc;assembler;nostackframe;
|
||||||
asm
|
asm
|
||||||
.data
|
.data
|
||||||
.balign 16
|
.balign 16
|
||||||
@ -36,30 +36,25 @@ FPC_ABSMASK_DOUBLE:
|
|||||||
FPU Control word
|
FPU Control word
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
procedure Set8087CW(cw:word);assembler;
|
procedure Set8087CW(cw:word);
|
||||||
asm
|
begin
|
||||||
movw cw,%ax
|
default8087cw:=cw;
|
||||||
{$ifdef FPC_PIC}
|
asm
|
||||||
movq default8087cw@GOTPCREL(%rip),%rdx
|
fnclex
|
||||||
movw %ax,(%rdx)
|
fldcw cw
|
||||||
fnclex
|
end;
|
||||||
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}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function Get8087CW:word;assembler;
|
function Get8087CW:word;assembler;
|
||||||
|
var
|
||||||
|
tmp: word;
|
||||||
asm
|
asm
|
||||||
pushq $0
|
fnstcw tmp
|
||||||
fnstcw (%rsp)
|
movq tmp,%rax
|
||||||
popq %rax
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure SetSSECSR(w : dword);
|
procedure SetSSECSR(w : dword);
|
||||||
begin
|
begin
|
||||||
mxcsr:=w;
|
mxcsr:=w;
|
||||||
@ -67,16 +62,14 @@ FPC_ABSMASK_DOUBLE:
|
|||||||
ldmxcsr w
|
ldmxcsr w
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function GetSSECSR : dword;
|
function GetSSECSR : dword;assembler;
|
||||||
var
|
var
|
||||||
_w : dword;
|
_w : dword;
|
||||||
begin
|
asm
|
||||||
asm
|
stmxcsr _w
|
||||||
stmxcsr _w
|
movl _w,%eax
|
||||||
end;
|
|
||||||
result:=_w;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{****************************************************************************
|
{****************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user