mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 04:09:11 +02:00
* more constant expression evals
This commit is contained in:
parent
1db43eef4d
commit
96159c617a
@ -262,7 +262,7 @@
|
|||||||
EXTENDED data type routines
|
EXTENDED data type routines
|
||||||
****************************************************************************}
|
****************************************************************************}
|
||||||
|
|
||||||
function pi : extended;
|
function pi : extended;{$ifdef MORECONST}[internconst:in_const_pi];{$endif}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -272,7 +272,7 @@
|
|||||||
end [];
|
end [];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function abs(d : extended) : extended;{$ifdef INTERNCONST}[internconst:in_const_abs];{$endif}
|
function abs(d : extended) : extended;[internconst:in_const_abs];
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -283,7 +283,7 @@
|
|||||||
end [];
|
end [];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function sqr(d : extended) : extended;{$ifdef INTERNCONST}[internconst:in_const_sqr];{$endif}
|
function sqr(d : extended) : extended;[internconst:in_const_sqr];
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -295,7 +295,7 @@
|
|||||||
end [];
|
end [];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function sqrt(d : extended) : extended;
|
function sqrt(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_sqrt];{$endif}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -306,7 +306,7 @@
|
|||||||
end [];
|
end [];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function arctan(d : extended) : extended;
|
function arctan(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_arctan];{$endif}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -318,7 +318,7 @@
|
|||||||
end [];
|
end [];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cos(d : extended) : extended;
|
function cos(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_cos];{$endif}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -339,7 +339,7 @@
|
|||||||
end ['EAX'];
|
end ['EAX'];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function exp(d : extended) : extended;
|
function exp(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_exp];{$endif}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -376,7 +376,7 @@
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function frac(d : extended) : extended;{$ifdef INTERNCONST}[internconst:in_const_frac];{$endif}
|
function frac(d : extended) : extended;[internconst:in_const_frac];
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -400,7 +400,7 @@
|
|||||||
end ['ECX'];
|
end ['ECX'];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function int(d : extended) : extended;{$ifdef INTERNCONST}[internconst:in_const_int];{$endif}
|
function int(d : extended) : extended;[internconst:in_const_int];
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -421,7 +421,7 @@
|
|||||||
end ['ECX'];
|
end ['ECX'];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function trunc(d : extended) : longint;{$ifdef INTERNCONST}[internconst:in_const_trunc];{$endif}
|
function trunc(d : extended) : longint;[internconst:in_const_trunc];
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -442,7 +442,7 @@
|
|||||||
end ['EAX','ECX'];
|
end ['EAX','ECX'];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function round(d : extended) : longint;{$ifdef INTERNCONST}[internconst:in_const_round];{$endif}
|
function round(d : extended) : longint;[internconst:in_const_round];
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -461,7 +461,7 @@
|
|||||||
end ['EAX','ECX'];
|
end ['EAX','ECX'];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ln(d : extended) : extended;
|
function ln(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_ln];{$endif}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -473,7 +473,7 @@
|
|||||||
end [];
|
end [];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function sin(d : extended) : extended;
|
function sin(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_sin];{$endif}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
@ -634,7 +634,10 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.9 1998-09-11 17:38:49 pierre
|
Revision 1.10 1998-10-02 09:25:29 peter
|
||||||
|
* more constant expression evals
|
||||||
|
|
||||||
|
Revision 1.9 1998/09/11 17:38:49 pierre
|
||||||
merge for fixes branch
|
merge for fixes branch
|
||||||
|
|
||||||
Revision 1.8.2.1 1998/09/11 17:37:25 pierre
|
Revision 1.8.2.1 1998/09/11 17:37:25 pierre
|
||||||
|
@ -63,10 +63,19 @@ const
|
|||||||
in_const_ptr = 107;
|
in_const_ptr = 107;
|
||||||
in_const_swap_word = 108;
|
in_const_swap_word = 108;
|
||||||
in_const_swap_long = 109;
|
in_const_swap_long = 109;
|
||||||
|
in_const_pi = 110;
|
||||||
|
in_const_sqrt = 111;
|
||||||
|
in_const_arctan = 112;
|
||||||
|
in_const_cos = 113;
|
||||||
|
in_const_exp = 114;
|
||||||
|
in_const_ln = 115;
|
||||||
|
in_const_sin = 116;
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.4 1998-09-14 10:48:17 peter
|
Revision 1.5 1998-10-02 09:25:09 peter
|
||||||
|
* more constant expression evals
|
||||||
|
|
||||||
|
Revision 1.4 1998/09/14 10:48:17 peter
|
||||||
* FPC_ names
|
* FPC_ names
|
||||||
* Heap manager is now system independent
|
* Heap manager is now system independent
|
||||||
|
|
||||||
|
@ -139,22 +139,22 @@ begin
|
|||||||
Lo := b and $0f
|
Lo := b and $0f
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Function swap (X : Word) : Word;{$ifdef INTERNCONST}[internconst:in_const_swap_word];{$endif}
|
Function swap (X : Word) : Word;[internconst:in_const_swap_word];
|
||||||
Begin
|
Begin
|
||||||
swap:=(X and $ff) shl 8 + (X shr 8)
|
swap:=(X and $ff) shl 8 + (X shr 8)
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function Swap (X : Integer) : Integer;{$ifdef INTERNCONST}[internconst:in_const_swap_word];{$endif}
|
Function Swap (X : Integer) : Integer;[internconst:in_const_swap_word];
|
||||||
Begin
|
Begin
|
||||||
Swap:=Integer(Swap(Word(X)));
|
Swap:=Integer(Swap(Word(X)));
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function swap (X : Longint) : Longint;{$ifdef INTERNCONST}[internconst:in_const_swap_long];{$endif}
|
Function swap (X : Longint) : Longint;[internconst:in_const_swap_long];
|
||||||
Begin
|
Begin
|
||||||
Swap:=(X and $ffff) shl 16 + (X shr 16)
|
Swap:=(X and $ffff) shl 16 + (X shr 16)
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function Swap (X : Cardinal) : Cardinal;{$ifdef INTERNCONST}[internconst:in_const_swap_long];{$endif}
|
Function Swap (X : Cardinal) : Cardinal;[internconst:in_const_swap_long];
|
||||||
Begin
|
Begin
|
||||||
Swap:=Swap(Longint(X));
|
Swap:=Swap(Longint(X));
|
||||||
End;
|
End;
|
||||||
@ -240,7 +240,7 @@ end;
|
|||||||
|
|
||||||
{$ifndef RTLLITE}
|
{$ifndef RTLLITE}
|
||||||
|
|
||||||
Function Ptr(sel,off : Longint) : pointer;{$ifdef INTERNCONST}[internconst:in_const_ptr];{$endif}
|
Function Ptr(sel,off : Longint) : pointer;[internconst:in_const_ptr];
|
||||||
Begin
|
Begin
|
||||||
sel:=0;
|
sel:=0;
|
||||||
ptr:=pointer(off);
|
ptr:=pointer(off);
|
||||||
@ -465,7 +465,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.34 1998-09-22 15:30:54 peter
|
Revision 1.35 1998-10-02 09:25:11 peter
|
||||||
|
* more constant expression evals
|
||||||
|
|
||||||
|
Revision 1.34 1998/09/22 15:30:54 peter
|
||||||
* shortstring=string type added
|
* shortstring=string type added
|
||||||
|
|
||||||
Revision 1.33 1998/09/16 13:08:03 michael
|
Revision 1.33 1998/09/16 13:08:03 michael
|
||||||
|
Loading…
Reference in New Issue
Block a user