mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 04:29:20 +02:00
* float_raise: Reduce amount of threadvar accesses, gains a bit more compact code. Functionality is not changed.
git-svn-id: trunk@19846 -
This commit is contained in:
parent
3fcf1f0050
commit
2642403d5b
@ -100,21 +100,27 @@ should be simply `softfloat_exception_flags |= flags;'.
|
|||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
*}
|
*}
|
||||||
procedure float_raise(i: shortint);
|
procedure float_raise(i: shortint);
|
||||||
|
var
|
||||||
|
pflags: pbyte;
|
||||||
|
unmasked_flags: byte;
|
||||||
Begin
|
Begin
|
||||||
softfloat_exception_flags := softfloat_exception_flags or i;
|
{ taking address of threadvar produces somewhat more compact code }
|
||||||
if ((softfloat_exception_flags and not(softfloat_exception_mask)) and float_flag_invalid) <> 0 then
|
pflags := @softfloat_exception_flags;
|
||||||
|
pflags^ := pflags^ or i;
|
||||||
|
unmasked_flags := pflags^ and (not softfloat_exception_mask);
|
||||||
|
if (unmasked_flags and float_flag_invalid) <> 0 then
|
||||||
HandleError(207)
|
HandleError(207)
|
||||||
else
|
else
|
||||||
if ((softfloat_exception_flags and not(softfloat_exception_mask)) and float_flag_divbyzero) <> 0 then
|
if (unmasked_flags and float_flag_divbyzero) <> 0 then
|
||||||
HandleError(200)
|
HandleError(200)
|
||||||
else
|
else
|
||||||
if ((softfloat_exception_flags and not(softfloat_exception_mask)) and float_flag_overflow) <> 0 then
|
if (unmasked_flags and float_flag_overflow) <> 0 then
|
||||||
HandleError(205)
|
HandleError(205)
|
||||||
else
|
else
|
||||||
if ((softfloat_exception_flags and not(softfloat_exception_mask)) and float_flag_underflow) <> 0 then
|
if (unmasked_flags and float_flag_underflow) <> 0 then
|
||||||
HandleError(206)
|
HandleError(206)
|
||||||
else
|
else
|
||||||
if ((softfloat_exception_flags and not(softfloat_exception_mask)) and float_flag_inexact) <> 0 then
|
if (unmasked_flags and float_flag_inexact) <> 0 then
|
||||||
HandleError(207);
|
HandleError(207);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user