* 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:
sergei 2011-12-13 20:21:22 +00:00
parent 3fcf1f0050
commit 2642403d5b

View File

@ -100,21 +100,27 @@ should be simply `softfloat_exception_flags |= flags;'.
-------------------------------------------------------------------------------
*}
procedure float_raise(i: shortint);
var
pflags: pbyte;
unmasked_flags: byte;
Begin
softfloat_exception_flags := softfloat_exception_flags or i;
if ((softfloat_exception_flags and not(softfloat_exception_mask)) and float_flag_invalid) <> 0 then
{ taking address of threadvar produces somewhat more compact code }
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)
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)
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)
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)
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);
end;