Răsfoiți Sursa

* fpc_round added, needed for int64 currency

peter 22 ani în urmă
părinte
comite
a7691d8bb8
5 a modificat fișierele cu 48 adăugiri și 7 ștergeri
  1. 10 1
      rtl/i386/math.inc
  2. 6 1
      rtl/inc/compproc.inc
  3. 11 2
      rtl/inc/genmath.inc
  4. 10 1
      rtl/powerpc/math.inc
  5. 11 2
      rtl/sparc/math.inc

+ 10 - 1
rtl/i386/math.inc

@@ -151,7 +151,13 @@
 
 
     {$define FPC_SYSTEM_HAS_ROUND}
+{$ifdef hascompilerproc}
+    function round(d : extended) : int64;[internconst:in_const_round, external name 'FPC_ROUND'];
+    
+    function fpc_round(d : extended) : int64;assembler;[public, alias:'FPC_ROUND'];{$ifdef hascompilerproc}compilerproc;{$endif hascompilerproc}
+{$else}
     function round(d : extended) : int64;assembler;[internconst:in_const_round];
+{$endif hascompilerproc}
       var
         oldcw,
         newcw : word;
@@ -192,7 +198,10 @@
 
 {
   $Log$
-  Revision 1.13  2003-02-05 19:53:17  carl
+  Revision 1.14  2003-04-23 21:28:21  peter
+    * fpc_round added, needed for int64 currency
+
+  Revision 1.13  2003/02/05 19:53:17  carl
     * round bugfix with -Or switch
 
   Revision 1.12  2003/01/15 00:45:17  peter

+ 6 - 1
rtl/inc/compproc.inc

@@ -197,6 +197,8 @@ function fpc_mod_int64(n,z : int64) : int64; compilerproc;
 function fpc_mul_qword(f1,f2 : qword;checkoverflow : longbool) : qword; compilerproc;
 function fpc_mul_int64(f1,f2 : int64;checkoverflow : longbool) : int64; compilerproc;
 
+function fpc_round(d : Extended) : int64;compilerproc;
+
 function fpc_do_is(aclass : tclass;aobject : tobject) : boolean; compilerproc;
 function fpc_do_as(aclass : tclass;aobject : tobject): tobject; compilerproc;
 procedure fpc_intf_decr_ref(var i: pointer); compilerproc;
@@ -286,7 +288,10 @@ function fpc_qword_to_double(q: qword): double; compilerproc;
 
 {
   $Log$
-  Revision 1.37  2003-04-02 14:07:30  peter
+  Revision 1.38  2003-04-23 21:28:21  peter
+    * fpc_round added, needed for int64 currency
+
+  Revision 1.37  2003/04/02 14:07:30  peter
     * class helpers compilerprocs are not needed yet, changed
       ifndef i386 to ifdef dummy
 

+ 11 - 2
rtl/inc/genmath.inc

@@ -541,7 +541,13 @@ Function float32_to_int32_round_to_zero( a: Float32 ): longint;
 
 
 {$ifndef FPC_SYSTEM_HAS_ROUND}
-    function Round(d: Real): int64;[internconst:in_const_round];
+{$ifdef hascompilerproc}
+    function round(d : Real) : int64;[internconst:in_const_round, external name 'FPC_ROUND'];
+
+    function fpc_round(d : Real) : int64;assembler;[public, alias:'FPC_ROUND'];{$ifdef hascompilerproc}compilerproc;{$endif hascompilerproc}
+{$else}
+    function round(d : Real) : int64;assembler;[internconst:in_const_round];
+{$endif hascompilerproc}
      var
       fr: Real;
       tr: Real;
@@ -1024,7 +1030,10 @@ Function float32_to_int32_round_to_zero( a: Float32 ): longint;
 
 {
   $Log$
-  Revision 1.10  2003-01-15 00:45:17  peter
+  Revision 1.11  2003-04-23 21:28:21  peter
+    * fpc_round added, needed for int64 currency
+
+  Revision 1.10  2003/01/15 00:45:17  peter
     * use generic int64 power
 
   Revision 1.9  2002/10/12 20:28:49  carl

+ 10 - 1
rtl/powerpc/math.inc

@@ -95,7 +95,13 @@
 
 
     {$define FPC_SYSTEM_HAS_ROUND}
+{$ifdef hascompilerproc}
+    function round(d : extended) : int64;[internconst:in_const_round, external name 'FPC_ROUND'];
+
+    function fpc_round(d : extended) : int64;assembler;[public, alias:'FPC_ROUND'];{$ifdef hascompilerproc}compilerproc;{$endif hascompilerproc}
+{$else}
     function round(d : extended) : int64;assembler;[internconst:in_const_round];
+{$endif hascompilerproc}
       { input: d in fr1      }
       { output: result in r3 }
       assembler;
@@ -290,7 +296,10 @@ end ['R0','R3','F0','F1','F2','F3'];
 
 {
   $Log$
-  Revision 1.16  2003-01-16 11:29:11  olle
+  Revision 1.17  2003-04-23 21:28:21  peter
+    * fpc_round added, needed for int64 currency
+
+  Revision 1.16  2003/01/16 11:29:11  olle
     * changed access of globals to be indirect via TOC
 
   Revision 1.15  2003/01/15 01:09:04  florian

+ 11 - 2
rtl/sparc/math.inc

@@ -178,7 +178,13 @@ end{ ['R0','R3','F0','F1','F2','F3']};
 
 
     {$define FPC_SYSTEM_HAS_ROUND}
-    function round(d : extended) : int64;{assembler;}[internconst:in_const_round];
+{$ifdef hascompilerproc}
+    function round(d : extended) : int64;[internconst:in_const_round, external name 'FPC_ROUND'];
+
+    function fpc_round(d : extended) : int64;[public, alias:'FPC_ROUND'];{$ifdef hascompilerproc}compilerproc;{$endif hascompilerproc}
+{$else}
+    function round(d : extended) : int64;[internconst:in_const_round];
+{$endif hascompilerproc}
       { input: d in fr1      }
       { output: result in r3 }
       {assembler;}
@@ -284,7 +290,10 @@ end{ ['R0','R3','F0','F1','F2','F3']};
 
 {
   $Log$
-  Revision 1.3  2003-01-22 20:45:15  mazen
+  Revision 1.4  2003-04-23 21:28:21  peter
+    * fpc_round added, needed for int64 currency
+
+  Revision 1.3  2003/01/22 20:45:15  mazen
   * making math code in RTL compiling.
   *NB : This does NOT mean necessary that it will generate correct code!