|
@@ -37,25 +37,88 @@
|
|
|
EXTENDED data type routines
|
|
|
****************************************************************************}
|
|
|
|
|
|
+{$ifdef INTERNCONSTINTF}
|
|
|
{$define FPC_SYSTEM_HAS_PI}
|
|
|
- function pi : extended;[internproc:fpc_in_pi];
|
|
|
+ function fpc_pi_real : ValReal;compilerproc;
|
|
|
+ begin
|
|
|
+ { Function is handled internal in the compiler }
|
|
|
+ runerror(207);
|
|
|
+ result:=0;
|
|
|
+ end;
|
|
|
+ {$define FPC_SYSTEM_HAS_ABS}
|
|
|
+ function fpc_abs_real(d : ValReal) : ValReal;compilerproc;
|
|
|
+ begin
|
|
|
+ { Function is handled internal in the compiler }
|
|
|
+ runerror(207);
|
|
|
+ result:=0;
|
|
|
+ end;
|
|
|
+ {$define FPC_SYSTEM_HAS_SQR}
|
|
|
+ function fpc_sqr_real(d : ValReal) : ValReal;compilerproc;
|
|
|
+ begin
|
|
|
+ { Function is handled internal in the compiler }
|
|
|
+ runerror(207);
|
|
|
+ result:=0;
|
|
|
+ end;
|
|
|
+ {$define FPC_SYSTEM_HAS_SQRT}
|
|
|
+ function fpc_sqrt_real(d : ValReal) : ValReal;compilerproc;
|
|
|
+ begin
|
|
|
+ { Function is handled internal in the compiler }
|
|
|
+ runerror(207);
|
|
|
+ result:=0;
|
|
|
+ end;
|
|
|
+ {$define FPC_SYSTEM_HAS_ARCTAN}
|
|
|
+ function fpc_arctan_real(d : ValReal) : ValReal;compilerproc;
|
|
|
+ begin
|
|
|
+ { Function is handled internal in the compiler }
|
|
|
+ runerror(207);
|
|
|
+ result:=0;
|
|
|
+ end;
|
|
|
+ {$define FPC_SYSTEM_HAS_LN}
|
|
|
+ function fpc_ln_real(d : ValReal) : ValReal;compilerproc;
|
|
|
+ begin
|
|
|
+ { Function is handled internal in the compiler }
|
|
|
+ runerror(207);
|
|
|
+ result:=0;
|
|
|
+ end;
|
|
|
+ {$define FPC_SYSTEM_HAS_SIN}
|
|
|
+ function fpc_sin_real(d : ValReal) : ValReal;compilerproc;
|
|
|
+ begin
|
|
|
+ { Function is handled internal in the compiler }
|
|
|
+ runerror(207);
|
|
|
+ result:=0;
|
|
|
+ end;
|
|
|
+ {$define FPC_SYSTEM_HAS_COS}
|
|
|
+ function fpc_cos_real(d : ValReal) : ValReal;compilerproc;
|
|
|
+ begin
|
|
|
+ { Function is handled internal in the compiler }
|
|
|
+ runerror(207);
|
|
|
+ result:=0;
|
|
|
+ end;
|
|
|
+{$else}
|
|
|
+ {$define FPC_SYSTEM_HAS_PI}
|
|
|
+ function pi : ValReal;[internproc:fpc_in_pi];
|
|
|
{$define FPC_SYSTEM_HAS_ABS}
|
|
|
- function abs(d : extended) : extended;[internproc:fpc_in_abs_real];
|
|
|
+ function abs(d : ValReal) : ValReal;[internproc:fpc_in_abs_real];
|
|
|
{$define FPC_SYSTEM_HAS_SQR}
|
|
|
- function sqr(d : extended) : extended;[internproc:fpc_in_sqr_real];
|
|
|
+ function sqr(d : ValReal) : ValReal;[internproc:fpc_in_sqr_real];
|
|
|
{$define FPC_SYSTEM_HAS_SQRT}
|
|
|
- function sqrt(d : extended) : extended;[internproc:fpc_in_sqrt_real];
|
|
|
+ function sqrt(d : ValReal) : ValReal;[internproc:fpc_in_sqrt_real];
|
|
|
{$define FPC_SYSTEM_HAS_ARCTAN}
|
|
|
- function arctan(d : extended) : extended;[internproc:fpc_in_arctan_real];
|
|
|
+ function arctan(d : ValReal) : ValReal;[internproc:fpc_in_arctan_real];
|
|
|
{$define FPC_SYSTEM_HAS_LN}
|
|
|
- function ln(d : extended) : extended;[internproc:fpc_in_ln_real];
|
|
|
+ function ln(d : ValReal) : ValReal;[internproc:fpc_in_ln_real];
|
|
|
{$define FPC_SYSTEM_HAS_SIN}
|
|
|
- function sin(d : extended) : extended;[internproc:fpc_in_sin_real];
|
|
|
+ function sin(d : ValReal) : ValReal;[internproc:fpc_in_sin_real];
|
|
|
{$define FPC_SYSTEM_HAS_COS}
|
|
|
- function cos(d : extended) : extended;[internproc:fpc_in_cos_real];
|
|
|
+ function cos(d : ValReal) : ValReal;[internproc:fpc_in_cos_real];
|
|
|
+{$endif}
|
|
|
|
|
|
{$define FPC_SYSTEM_HAS_EXP}
|
|
|
- function exp(d : extended) : extended;assembler;[internconst:fpc_in_const_exp];
|
|
|
+ {$ifdef INTERNCONSTINTF}
|
|
|
+ function fpc_exp_real(d : ValReal) : ValReal;assembler;compilerproc;
|
|
|
+ {$else}
|
|
|
+ function exp(d : ValReal) : ValReal;assembler;[internconst:fpc_in_const_exp];
|
|
|
+ {$endif}
|
|
|
asm
|
|
|
// comes from DJ GPP
|
|
|
fldt d
|
|
@@ -89,7 +152,11 @@
|
|
|
|
|
|
|
|
|
{$define FPC_SYSTEM_HAS_FRAC}
|
|
|
- function frac(d : extended) : extended;assembler;[internconst:fpc_in_const_frac];
|
|
|
+ {$ifdef INTERNCONSTINTF}
|
|
|
+ function fpc_frac_real(d : ValReal) : ValReal;assembler;compilerproc;
|
|
|
+ {$else}
|
|
|
+ function frac(d : ValReal) : ValReal;assembler;[internconst:fpc_in_const_frac];
|
|
|
+ {$endif}
|
|
|
asm
|
|
|
subq $16,%rsp
|
|
|
fnstcw -4(%rbp)
|
|
@@ -110,7 +177,11 @@
|
|
|
|
|
|
|
|
|
{$define FPC_SYSTEM_HAS_INT}
|
|
|
- function int(d : extended) : extended;assembler;[internconst:fpc_in_const_int];
|
|
|
+ {$ifdef INTERNCONSTINTF}
|
|
|
+ function fpc_int_real(d : ValReal) : ValReal;assembler;compilerproc;
|
|
|
+ {$else}
|
|
|
+ function int(d : ValReal) : ValReal;assembler;[internconst:fpc_in_const_int];
|
|
|
+ {$endif}
|
|
|
asm
|
|
|
subq $16,%rsp
|
|
|
fnstcw -4(%rbp)
|
|
@@ -129,7 +200,11 @@
|
|
|
|
|
|
|
|
|
{$define FPC_SYSTEM_HAS_TRUNC}
|
|
|
- function trunc(d : extended) : int64;assembler;[internconst:fpc_in_const_trunc];
|
|
|
+ {$ifdef INTERNCONSTINTF}
|
|
|
+ function fpc_trunc_real(d : ValReal) : int64;assembler;compilerproc;
|
|
|
+ {$else}
|
|
|
+ function trunc(d : ValReal) : int64;assembler;[internconst:fpc_in_const_trunc];
|
|
|
+ {$endif}
|
|
|
var
|
|
|
oldcw,
|
|
|
newcw : word;
|
|
@@ -150,13 +225,17 @@
|
|
|
|
|
|
|
|
|
{$define FPC_SYSTEM_HAS_ROUND}
|
|
|
-{$ifdef hascompilerproc}
|
|
|
+{$ifdef internconstintf}
|
|
|
+ function fpc_round_real(d : ValReal) : int64;assembler;compilerproc;
|
|
|
+{$else}
|
|
|
+ {$ifdef hascompilerproc}
|
|
|
function round(d : extended) : int64;[internconst:fpc_in_const_round, external name 'FPC_ROUND'];
|
|
|
|
|
|
function fpc_round(d : extended) : int64;assembler;[public, alias:'FPC_ROUND'];{$ifdef hascompilerproc}compilerproc;{$endif hascompilerproc}
|
|
|
-{$else}
|
|
|
+ {$else}
|
|
|
function round(d : extended) : int64;assembler;[internconst:fpc_in_const_round];
|
|
|
-{$endif hascompilerproc}
|
|
|
+ {$endif hascompilerproc}
|
|
|
+{$endif}
|
|
|
var
|
|
|
oldcw,
|
|
|
newcw : word;
|
|
@@ -196,7 +275,10 @@
|
|
|
|
|
|
{
|
|
|
$Log$
|
|
|
- Revision 1.5 2004-12-12 12:41:46 peter
|
|
|
+ Revision 1.6 2004-12-12 14:30:27 peter
|
|
|
+ * x86_64 updates
|
|
|
+
|
|
|
+ Revision 1.5 2004/12/12 12:41:46 peter
|
|
|
* updated for latest rtl changes
|
|
|
|
|
|
Revision 1.4 2004/04/24 18:31:25 florian
|