* more constant expression evals

This commit is contained in:
peter 1998-10-02 09:25:09 +00:00
parent 1db43eef4d
commit 96159c617a
3 changed files with 37 additions and 22 deletions

View File

@ -262,7 +262,7 @@
EXTENDED data type routines
****************************************************************************}
function pi : extended;
function pi : extended;{$ifdef MORECONST}[internconst:in_const_pi];{$endif}
begin
asm
@ -272,7 +272,7 @@
end [];
end;
function abs(d : extended) : extended;{$ifdef INTERNCONST}[internconst:in_const_abs];{$endif}
function abs(d : extended) : extended;[internconst:in_const_abs];
begin
asm
@ -283,7 +283,7 @@
end [];
end;
function sqr(d : extended) : extended;{$ifdef INTERNCONST}[internconst:in_const_sqr];{$endif}
function sqr(d : extended) : extended;[internconst:in_const_sqr];
begin
asm
@ -295,7 +295,7 @@
end [];
end;
function sqrt(d : extended) : extended;
function sqrt(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_sqrt];{$endif}
begin
asm
@ -306,7 +306,7 @@
end [];
end;
function arctan(d : extended) : extended;
function arctan(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_arctan];{$endif}
begin
asm
@ -318,7 +318,7 @@
end [];
end;
function cos(d : extended) : extended;
function cos(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_cos];{$endif}
begin
asm
@ -339,7 +339,7 @@
end ['EAX'];
end;
function exp(d : extended) : extended;
function exp(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_exp];{$endif}
begin
asm
@ -376,7 +376,7 @@
end;
end;
function frac(d : extended) : extended;{$ifdef INTERNCONST}[internconst:in_const_frac];{$endif}
function frac(d : extended) : extended;[internconst:in_const_frac];
begin
asm
@ -400,7 +400,7 @@
end ['ECX'];
end;
function int(d : extended) : extended;{$ifdef INTERNCONST}[internconst:in_const_int];{$endif}
function int(d : extended) : extended;[internconst:in_const_int];
begin
asm
@ -421,7 +421,7 @@
end ['ECX'];
end;
function trunc(d : extended) : longint;{$ifdef INTERNCONST}[internconst:in_const_trunc];{$endif}
function trunc(d : extended) : longint;[internconst:in_const_trunc];
begin
asm
@ -442,7 +442,7 @@
end ['EAX','ECX'];
end;
function round(d : extended) : longint;{$ifdef INTERNCONST}[internconst:in_const_round];{$endif}
function round(d : extended) : longint;[internconst:in_const_round];
begin
asm
@ -461,7 +461,7 @@
end ['EAX','ECX'];
end;
function ln(d : extended) : extended;
function ln(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_ln];{$endif}
begin
asm
@ -473,7 +473,7 @@
end [];
end;
function sin(d : extended) : extended;
function sin(d : extended) : extended;{$ifdef MORECONST}[internconst:in_const_sin];{$endif}
begin
asm
@ -634,7 +634,10 @@
{
$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
Revision 1.8.2.1 1998/09/11 17:37:25 pierre

View File

@ -63,10 +63,19 @@ const
in_const_ptr = 107;
in_const_swap_word = 108;
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$
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
* Heap manager is now system independent

View File

@ -139,22 +139,22 @@ begin
Lo := b and $0f
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
swap:=(X and $ff) shl 8 + (X shr 8)
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
Swap:=Integer(Swap(Word(X)));
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
Swap:=(X and $ffff) shl 16 + (X shr 16)
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
Swap:=Swap(Longint(X));
End;
@ -240,7 +240,7 @@ end;
{$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
sel:=0;
ptr:=pointer(off);
@ -465,7 +465,10 @@ end;
{
$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
Revision 1.33 1998/09/16 13:08:03 michael