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:
pierre 2020-10-27 23:09:32 +00:00
parent 13f1fb60b4
commit 8a543dbc8a
9 changed files with 21 additions and 21 deletions

View File

@ -43,7 +43,7 @@ begin
else if (FpuState and FPU_Underflow)<>0 then
res:=206
else if (FpuState and FPU_Denormal)<>0 then
res:=216
res:=207
else
res:=207; {'Coprocessor Error'}
end;

View File

@ -28,9 +28,9 @@ begin
FPE_FLTOVF : Res:=205; {Overflow trap}
FPE_FLTUND : Res:=206; {Stack over/underflow}
FPE_FLTRES : Res:=216; {Device not available}
FPE_FLTINV : Res:=216; {Invalid floating point operation}
FPE_FLTINV : Res:=207; {Invalid floating point operation}
Else
Res:=208; {coprocessor error}
Res:=207; {coprocessor error}
End;
sysResetFPU;
End;

View File

@ -28,9 +28,9 @@ begin
FPE_FLTOVF : Res:=205; {Overflow trap}
FPE_FLTUND : Res:=206; {Stack over/underflow}
FPE_FLTRES : Res:=216; {Device not available}
FPE_FLTINV : Res:=216; {Invalid floating point operation}
FPE_FLTINV : Res:=207; {Invalid floating point operation}
Else
Res:=208; {coprocessor error}
Res:=207; {coprocessor error}
End;
sysResetFPU;
End;

View File

@ -43,7 +43,7 @@ begin
else if (FpuState and FPU_Underflow)<>0 then
res:=206
else if (FpuState and FPU_Denormal)<>0 then
res:=216
res:=207
else
res:=207; {'Coprocessor Error'}
end;

View File

@ -43,7 +43,7 @@ begin
else if (FpuState and FPU_Underflow)<>0 then
res:=206
else if (FpuState and FPU_Denormal)<>0 then
res:=216
res:=207
else
res:=207; {'Coprocessor Error'}
end;

View File

@ -76,12 +76,12 @@ begin
res:=205
else if FpuState = FPE_FltUnd then
res:=206
{ else if FpuState and FPU_Denormal)<>0 then
res:=216 }
else if FpuState and FPU_Denormal)<>0 then
res:=207
else if FpuState = FPE_FltSub then
res:=207
else if FpuState = FPE_FltInv then
res:=216
res:=207
else
res:=207; {'Coprocessor Error'}
end;

View File

@ -79,11 +79,11 @@ begin
else if (FpuState and FPU_Underflow)<>0 then
res:=206
else if (FpuState and FPU_Denormal)<>0 then
res:=216
res:=207
else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 then
res:=207
else if (FpuState and FPU_Invalid)<>0 then
res:=216
res:=207
else
res:=207; {'Coprocessor Error'}
end;

View File

@ -74,11 +74,11 @@ begin
else if (FpuState and FPU_Underflow)<>0 then
res:=206
else if (FpuState and FPU_Denormal)<>0 then
res:=216
res:=207
else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 then
res:=207
else if (FpuState and FPU_Invalid)<>0 then
res:=216
res:=207
else
res:=207; {'Coprocessor Error'}
end;

View File

@ -15,7 +15,7 @@
CONST FPU_ALL=$7F;
{$ifdef cpui386}
{$ifdef cpux86_64}
function getfpustate(sininfo:psiginfo):longint; {inline;}
begin
if ptruint(sininfo)> high(word) then
@ -27,7 +27,7 @@ end;
function getaltfpustate(sigcontext:psigcontextrec):longint; {inline;}
begin
if assigned(sigcontext) then
getaltfpustate:=sigcontext^.sc_fpustate^.en_sw
getaltfpustate:=sigcontext^.sc_fpstate^.fx_fsw
else
getaltfpustate:=0;
end;
@ -40,12 +40,12 @@ var
begin
res:=0;
{$ifdef BSD}
{$ifdef cpui386}
{$ifdef cpux86_64}
fpustate:=0;
asm
fnstsw fpustate
end;
{$endif cpui386}
{$endif cpux86_64}
{$endif BSD}
case sig of
SIGFPE :
@ -53,7 +53,7 @@ begin
{ this is not allways necessary but I don't know yet
how to tell if it is or not PM }
res:=200;
{$ifdef cpui386}
{$ifdef cpux86_64}
fpustate:=GetaltFPUState(sigcontext);
{$else}
fpustate:=0;
@ -68,11 +68,11 @@ begin
else if (FpuState and FPU_Underflow)<>0 then
res:=206
else if (FpuState and FPU_Denormal)<>0 then
res:=216
res:=207
else if (FpuState and (FPU_StackOverflow or FPU_StackUnderflow))<>0 then
res:=207
else if (FpuState and FPU_Invalid)<>0 then
res:=216
res:=207
else
res:=207; {'Coprocessor Error'}
end;