mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 20:49:09 +02:00
Avoid float_raise call in FPC_SOFT_FPUX80 code
(cherry picked from commit 5cedecbe25
)
This commit is contained in:
parent
0b5af8a53f
commit
59ad47503b
@ -1054,6 +1054,8 @@ Implementation
|
|||||||
eextended: extended;
|
eextended: extended;
|
||||||
{$else}
|
{$else}
|
||||||
{$ifdef FPC_SOFT_FPUX80}
|
{$ifdef FPC_SOFT_FPUX80}
|
||||||
|
f32 : float32;
|
||||||
|
f64 : float64;
|
||||||
eextended: floatx80;
|
eextended: floatx80;
|
||||||
{$endif}
|
{$endif}
|
||||||
{$endif cpuextended}
|
{$endif cpuextended}
|
||||||
@ -1118,9 +1120,24 @@ Implementation
|
|||||||
aitrealconst_s80bit:
|
aitrealconst_s80bit:
|
||||||
begin
|
begin
|
||||||
if sizeof(tai_realconst(hp).value.s80val) = sizeof(double) then
|
if sizeof(tai_realconst(hp).value.s80val) = sizeof(double) then
|
||||||
eextended:=float64_to_floatx80(float64(double(tai_realconst(hp).value.s80val)))
|
begin
|
||||||
|
f64:=float64(double(tai_realconst(hp).value.s80val));
|
||||||
|
if float64_is_signaling_nan(f64)<>0 then
|
||||||
|
begin
|
||||||
|
f64.low := 0;
|
||||||
|
f64.high := longword($fff80000);
|
||||||
|
end;
|
||||||
|
eextended:=float64_to_floatx80(f64);
|
||||||
|
end
|
||||||
else if sizeof(tai_realconst(hp).value.s80val) = sizeof(single) then
|
else if sizeof(tai_realconst(hp).value.s80val) = sizeof(single) then
|
||||||
eextended:=float32_to_floatx80(float32(single(tai_realconst(hp).value.s80val)))
|
begin
|
||||||
|
f32:=float32(single(tai_realconst(hp).value.s80val));
|
||||||
|
if float32_is_signaling_nan(f32)<>0 then
|
||||||
|
begin
|
||||||
|
f32 := longword($ffc00000);
|
||||||
|
end;
|
||||||
|
eextended:=float32_to_floatx80(f32);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
internalerror(2017091901);
|
internalerror(2017091901);
|
||||||
pdata:=@eextended;
|
pdata:=@eextended;
|
||||||
@ -1842,6 +1859,8 @@ Implementation
|
|||||||
eextended : extended;
|
eextended : extended;
|
||||||
{$else}
|
{$else}
|
||||||
{$ifdef FPC_SOFT_FPUX80}
|
{$ifdef FPC_SOFT_FPUX80}
|
||||||
|
f32 : float32;
|
||||||
|
f64 : float64;
|
||||||
eextended : floatx80;
|
eextended : floatx80;
|
||||||
{$endif}
|
{$endif}
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -1920,11 +1939,26 @@ Implementation
|
|||||||
aitrealconst_s80bit:
|
aitrealconst_s80bit:
|
||||||
begin
|
begin
|
||||||
if sizeof(tai_realconst(hp).value.s80val) = sizeof(double) then
|
if sizeof(tai_realconst(hp).value.s80val) = sizeof(double) then
|
||||||
eextended:=float64_to_floatx80(float64(double(tai_realconst(hp).value.s80val)))
|
begin
|
||||||
|
f64:=float64(double(tai_realconst(hp).value.s80val));
|
||||||
|
if float64_is_signaling_nan(f64)<>0 then
|
||||||
|
begin
|
||||||
|
f64.low := 0;
|
||||||
|
f64.high := longword($fff80000);
|
||||||
|
end;
|
||||||
|
eextended:=float64_to_floatx80(f64);
|
||||||
|
end
|
||||||
else if sizeof(tai_realconst(hp).value.s80val) = sizeof(single) then
|
else if sizeof(tai_realconst(hp).value.s80val) = sizeof(single) then
|
||||||
eextended:=float32_to_floatx80(float32(single(tai_realconst(hp).value.s80val)))
|
begin
|
||||||
|
f32:=float32(single(tai_realconst(hp).value.s80val));
|
||||||
|
if float32_is_signaling_nan(f32)<>0 then
|
||||||
|
begin
|
||||||
|
f32 := longword($ffc00000);
|
||||||
|
end;
|
||||||
|
eextended:=float32_to_floatx80(f32);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
internalerror(2017091901);
|
internalerror(2017091903);
|
||||||
pdata:=@eextended;
|
pdata:=@eextended;
|
||||||
end;
|
end;
|
||||||
{$pop}
|
{$pop}
|
||||||
|
Loading…
Reference in New Issue
Block a user