mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-06 11:27:27 +01:00
Use RTE 207 for FPU_Invalid and FPU_Denormal exceptions on i386/x86_64 beos/haiku/*bsd as for Linux
git-svn-id: trunk@47227 -
This commit is contained in:
parent
13f1fb60b4
commit
8a543dbc8a
@ -43,7 +43,7 @@ begin
|
|||||||
else if (FpuState and FPU_Underflow)<>0 then
|
else if (FpuState and FPU_Underflow)<>0 then
|
||||||
res:=206
|
res:=206
|
||||||
else if (FpuState and FPU_Denormal)<>0 then
|
else if (FpuState and FPU_Denormal)<>0 then
|
||||||
res:=216
|
res:=207
|
||||||
else
|
else
|
||||||
res:=207; {'Coprocessor Error'}
|
res:=207; {'Coprocessor Error'}
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -28,9 +28,9 @@ begin
|
|||||||
FPE_FLTOVF : Res:=205; {Overflow trap}
|
FPE_FLTOVF : Res:=205; {Overflow trap}
|
||||||
FPE_FLTUND : Res:=206; {Stack over/underflow}
|
FPE_FLTUND : Res:=206; {Stack over/underflow}
|
||||||
FPE_FLTRES : Res:=216; {Device not available}
|
FPE_FLTRES : Res:=216; {Device not available}
|
||||||
FPE_FLTINV : Res:=216; {Invalid floating point operation}
|
FPE_FLTINV : Res:=207; {Invalid floating point operation}
|
||||||
Else
|
Else
|
||||||
Res:=208; {coprocessor error}
|
Res:=207; {coprocessor error}
|
||||||
End;
|
End;
|
||||||
sysResetFPU;
|
sysResetFPU;
|
||||||
End;
|
End;
|
||||||
|
|||||||
@ -28,9 +28,9 @@ begin
|
|||||||
FPE_FLTOVF : Res:=205; {Overflow trap}
|
FPE_FLTOVF : Res:=205; {Overflow trap}
|
||||||
FPE_FLTUND : Res:=206; {Stack over/underflow}
|
FPE_FLTUND : Res:=206; {Stack over/underflow}
|
||||||
FPE_FLTRES : Res:=216; {Device not available}
|
FPE_FLTRES : Res:=216; {Device not available}
|
||||||
FPE_FLTINV : Res:=216; {Invalid floating point operation}
|
FPE_FLTINV : Res:=207; {Invalid floating point operation}
|
||||||
Else
|
Else
|
||||||
Res:=208; {coprocessor error}
|
Res:=207; {coprocessor error}
|
||||||
End;
|
End;
|
||||||
sysResetFPU;
|
sysResetFPU;
|
||||||
End;
|
End;
|
||||||
|
|||||||
@ -43,7 +43,7 @@ begin
|
|||||||
else if (FpuState and FPU_Underflow)<>0 then
|
else if (FpuState and FPU_Underflow)<>0 then
|
||||||
res:=206
|
res:=206
|
||||||
else if (FpuState and FPU_Denormal)<>0 then
|
else if (FpuState and FPU_Denormal)<>0 then
|
||||||
res:=216
|
res:=207
|
||||||
else
|
else
|
||||||
res:=207; {'Coprocessor Error'}
|
res:=207; {'Coprocessor Error'}
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -43,7 +43,7 @@ begin
|
|||||||
else if (FpuState and FPU_Underflow)<>0 then
|
else if (FpuState and FPU_Underflow)<>0 then
|
||||||
res:=206
|
res:=206
|
||||||
else if (FpuState and FPU_Denormal)<>0 then
|
else if (FpuState and FPU_Denormal)<>0 then
|
||||||
res:=216
|
res:=207
|
||||||
else
|
else
|
||||||
res:=207; {'Coprocessor Error'}
|
res:=207; {'Coprocessor Error'}
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -76,12 +76,12 @@ begin
|
|||||||
res:=205
|
res:=205
|
||||||
else if FpuState = FPE_FltUnd then
|
else if FpuState = FPE_FltUnd then
|
||||||
res:=206
|
res:=206
|
||||||
{ else if FpuState and FPU_Denormal)<>0 then
|
else if FpuState and FPU_Denormal)<>0 then
|
||||||
res:=216 }
|
res:=207
|
||||||
else if FpuState = FPE_FltSub then
|
else if FpuState = FPE_FltSub then
|
||||||
res:=207
|
res:=207
|
||||||
else if FpuState = FPE_FltInv then
|
else if FpuState = FPE_FltInv then
|
||||||
res:=216
|
res:=207
|
||||||
else
|
else
|
||||||
res:=207; {'Coprocessor Error'}
|
res:=207; {'Coprocessor Error'}
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -79,11 +79,11 @@ begin
|
|||||||
else if (FpuState and FPU_Underflow)<>0 then
|
else if (FpuState and FPU_Underflow)<>0 then
|
||||||
res:=206
|
res:=206
|
||||||
else if (FpuState and FPU_Denormal)<>0 then
|
else if (FpuState and FPU_Denormal)<>0 then
|
||||||
res:=216
|
res:=207
|
||||||
else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 then
|
else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 then
|
||||||
res:=207
|
res:=207
|
||||||
else if (FpuState and FPU_Invalid)<>0 then
|
else if (FpuState and FPU_Invalid)<>0 then
|
||||||
res:=216
|
res:=207
|
||||||
else
|
else
|
||||||
res:=207; {'Coprocessor Error'}
|
res:=207; {'Coprocessor Error'}
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -74,11 +74,11 @@ begin
|
|||||||
else if (FpuState and FPU_Underflow)<>0 then
|
else if (FpuState and FPU_Underflow)<>0 then
|
||||||
res:=206
|
res:=206
|
||||||
else if (FpuState and FPU_Denormal)<>0 then
|
else if (FpuState and FPU_Denormal)<>0 then
|
||||||
res:=216
|
res:=207
|
||||||
else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 then
|
else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 then
|
||||||
res:=207
|
res:=207
|
||||||
else if (FpuState and FPU_Invalid)<>0 then
|
else if (FpuState and FPU_Invalid)<>0 then
|
||||||
res:=216
|
res:=207
|
||||||
else
|
else
|
||||||
res:=207; {'Coprocessor Error'}
|
res:=207; {'Coprocessor Error'}
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
CONST FPU_ALL=$7F;
|
CONST FPU_ALL=$7F;
|
||||||
|
|
||||||
{$ifdef cpui386}
|
{$ifdef cpux86_64}
|
||||||
function getfpustate(sininfo:psiginfo):longint; {inline;}
|
function getfpustate(sininfo:psiginfo):longint; {inline;}
|
||||||
begin
|
begin
|
||||||
if ptruint(sininfo)> high(word) then
|
if ptruint(sininfo)> high(word) then
|
||||||
@ -27,7 +27,7 @@ end;
|
|||||||
function getaltfpustate(sigcontext:psigcontextrec):longint; {inline;}
|
function getaltfpustate(sigcontext:psigcontextrec):longint; {inline;}
|
||||||
begin
|
begin
|
||||||
if assigned(sigcontext) then
|
if assigned(sigcontext) then
|
||||||
getaltfpustate:=sigcontext^.sc_fpustate^.en_sw
|
getaltfpustate:=sigcontext^.sc_fpstate^.fx_fsw
|
||||||
else
|
else
|
||||||
getaltfpustate:=0;
|
getaltfpustate:=0;
|
||||||
end;
|
end;
|
||||||
@ -40,12 +40,12 @@ var
|
|||||||
begin
|
begin
|
||||||
res:=0;
|
res:=0;
|
||||||
{$ifdef BSD}
|
{$ifdef BSD}
|
||||||
{$ifdef cpui386}
|
{$ifdef cpux86_64}
|
||||||
fpustate:=0;
|
fpustate:=0;
|
||||||
asm
|
asm
|
||||||
fnstsw fpustate
|
fnstsw fpustate
|
||||||
end;
|
end;
|
||||||
{$endif cpui386}
|
{$endif cpux86_64}
|
||||||
{$endif BSD}
|
{$endif BSD}
|
||||||
case sig of
|
case sig of
|
||||||
SIGFPE :
|
SIGFPE :
|
||||||
@ -53,7 +53,7 @@ begin
|
|||||||
{ this is not allways necessary but I don't know yet
|
{ this is not allways necessary but I don't know yet
|
||||||
how to tell if it is or not PM }
|
how to tell if it is or not PM }
|
||||||
res:=200;
|
res:=200;
|
||||||
{$ifdef cpui386}
|
{$ifdef cpux86_64}
|
||||||
fpustate:=GetaltFPUState(sigcontext);
|
fpustate:=GetaltFPUState(sigcontext);
|
||||||
{$else}
|
{$else}
|
||||||
fpustate:=0;
|
fpustate:=0;
|
||||||
@ -68,11 +68,11 @@ begin
|
|||||||
else if (FpuState and FPU_Underflow)<>0 then
|
else if (FpuState and FPU_Underflow)<>0 then
|
||||||
res:=206
|
res:=206
|
||||||
else if (FpuState and FPU_Denormal)<>0 then
|
else if (FpuState and FPU_Denormal)<>0 then
|
||||||
res:=216
|
res:=207
|
||||||
else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 then
|
else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 then
|
||||||
res:=207
|
res:=207
|
||||||
else if (FpuState and FPU_Invalid)<>0 then
|
else if (FpuState and FPU_Invalid)<>0 then
|
||||||
res:=216
|
res:=207
|
||||||
else
|
else
|
||||||
res:=207; {'Coprocessor Error'}
|
res:=207; {'Coprocessor Error'}
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user