]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/cpu/ppc/ppc.factor
FFI rewrite part 5: return value boxing and callback parameter boxing now uses vregs...
[factor.git] / basis / cpu / ppc / ppc.factor
index 233f5eb538db6a4ca248eac1b474663812c68177..0708f7991f33e694492a26a103e0eb6ad414a5ef 100644 (file)
@@ -226,10 +226,10 @@ M: spill-slot float-function-param* [ 1 ] dip n>> spill@ LFD ;
 M: integer float-function-param* FMR ;
 
 : float-function-param ( i src -- )
-    [ float-regs cdecl param-regs nth ] dip float-function-param* ;
+    [ float-regs cdecl param-regs at nth ] dip float-function-param* ;
 
 : float-function-return ( reg -- )
-    float-regs return-reg double-rep %copy ;
+    float-regs return-regs at first double-rep %copy ;
 
 M:: ppc %unary-float-function ( dst src func -- )
     0 src float-function-param
@@ -665,11 +665,11 @@ M: ppc %reload ( dst rep src -- )
 
 M: ppc %loop-entry ;
 
-M: int-regs return-reg drop 3 ;
-
-M: int-regs param-regs 2drop { 3 4 5 6 7 8 9 10 } ;
-
-M: float-regs return-reg drop 1 ;
+M: ppc return-regs
+    {
+        { int-regs { 3 4 5 6 } }
+        { float-regs { 1 } }
+    } ;
 
 M:: ppc %save-param-reg ( stack reg rep -- )
     reg stack local@ rep store-to-frame ;
@@ -697,7 +697,7 @@ M: spill-slot store-param [ 1 ] dip n>> spill@ STW ;
 M:: ppc %unbox ( src n rep func -- )
     src func call-unbox-func
     ! Store the return value on the C stack
-    n [ rep reg-class-of return-reg rep %save-param-reg ] when* ;
+    n [ rep reg-class-of return-regs at first rep %save-param-reg ] when* ;
 
 M:: ppc %unbox-long-long ( src n func -- )
     src func call-unbox-func