mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 17:29:21 +02:00
- Eliminated separate extractFloat32* routines, they are used only once and manually inlining them does not harm to readability.
git-svn-id: trunk@25983 -
This commit is contained in:
parent
68caeb93c1
commit
441e37b8b4
@ -287,30 +287,6 @@ invalid:
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_ExtractFloat32Frac}
|
|
||||||
Function ExtractFloat32Frac(a : Float32) : longint;
|
|
||||||
Begin
|
|
||||||
ExtractFloat32Frac := A AND $007FFFFF;
|
|
||||||
End;
|
|
||||||
{$endif not FPC_SYSTEM_HAS_ExtractFloat32Frac}
|
|
||||||
|
|
||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_extractFloat32Exp}
|
|
||||||
Function extractFloat32Exp( a: float32 ): smallint;
|
|
||||||
Begin
|
|
||||||
extractFloat32Exp := (a shr 23) AND $FF;
|
|
||||||
End;
|
|
||||||
{$endif not FPC_SYSTEM_HAS_extractFloat32Exp}
|
|
||||||
|
|
||||||
|
|
||||||
{$ifndef FPC_SYSTEM_HAS_extractFloat32Sign}
|
|
||||||
Function extractFloat32Sign( a: float32 ): Flag;
|
|
||||||
Begin
|
|
||||||
extractFloat32Sign := a shr 31;
|
|
||||||
End;
|
|
||||||
{$endif not FPC_SYSTEM_HAS_extractFloat32Sign}
|
|
||||||
|
|
||||||
|
|
||||||
Function float32_to_int32_round_to_zero( a: Float32 ): longint;
|
Function float32_to_int32_round_to_zero( a: Float32 ): longint;
|
||||||
Var
|
Var
|
||||||
aSign : flag;
|
aSign : flag;
|
||||||
@ -318,9 +294,9 @@ invalid:
|
|||||||
aSig : longint;
|
aSig : longint;
|
||||||
z : longint;
|
z : longint;
|
||||||
Begin
|
Begin
|
||||||
aSig := extractFloat32Frac( a );
|
aSig := a and $007FFFFF;
|
||||||
aExp := extractFloat32Exp( a );
|
aExp := (a shr 23) and $FF;
|
||||||
aSign := extractFloat32Sign( a );
|
aSign := a shr 31;
|
||||||
shiftCount := aExp - $9E;
|
shiftCount := aExp - $9E;
|
||||||
if ( 0 <= shiftCount ) then
|
if ( 0 <= shiftCount ) then
|
||||||
Begin
|
Begin
|
||||||
|
Loading…
Reference in New Issue
Block a user