Browse Source

* removed stackframe for fpc_round_real() and fpc_trunc_real()
+ additional fpc_int_real() assembly method

git-svn-id: trunk@3728 -

tom_at_work 19 years ago
parent
commit
b74142460f
1 changed files with 13 additions and 10 deletions
  1. 13 10
      rtl/powerpc64/math.inc

+ 13 - 10
rtl/powerpc64/math.inc

@@ -43,28 +43,31 @@ begin
 end;
 
 {$define FPC_SYSTEM_HAS_TRUNC}
-function fpc_trunc_real(d : valreal) : int64;compilerproc; assembler;
+function fpc_trunc_real(d : valreal) : int64;compilerproc; assembler; nostackframe;
 { input: d in fr1      }
 { output: result in r3 }
-var
-  temp : int64;
 asm
   fctidz f1, f1
-  stfd f1, temp
-  ld r3, temp
+  stfd f1, -8(r1)
+  ld r3, -8(r1)
+end;
+
+{$define FPC_SYSTEM_HAS_INT}
+function fpc_int_real(d : valreal) : valreal;compilerproc; assembler; nostackframe;
+asm
+  fctidz f2, f1
+  fcfid f1, f2
 end;
 
 {$define FPC_SYSTEM_HAS_ROUND}
-function fpc_round_real(d : valreal) : int64; compilerproc;assembler;
+function fpc_round_real(d : valreal) : int64; compilerproc;assembler; nostackframe;
 { exactly the same as trunc, except that one fctiwz has become fctiw }
 { input: d in fr1      }
 { output: result in r3 }
-var
-  temp: int64;
 asm
   fctid f1, f1
-  stfd  f1, temp
-  ld r3, temp
+  stfd  f1, -8(r1)
+  ld r3, -8(r1)
 end;
 
 {****************************************************************************