diff --git a/doc/vops.txt b/doc/vops.txt index 9aa64a4961..c6b0770667 100644 --- a/doc/vops.txt +++ b/doc/vops.txt @@ -54,4 +54,5 @@ VOPs: %untag-fixnum shift vop-in-1 to the right by 3 bits, store result in vop-in-1 (which should equal vop-out-1!) - +%type Intrinstic version of type primitive. It outputs an + unboxed value in vop-out-1. diff --git a/library/compiler/ppc/alien.factor b/library/compiler/ppc/alien.factor index e034a75382..cf187b5086 100644 --- a/library/compiler/ppc/alien.factor +++ b/library/compiler/ppc/alien.factor @@ -4,9 +4,6 @@ IN: assembler USING: alien compiler compiler-backend inference kernel kernel-internals lists math memory namespaces words ; -: compile-c-call ( symbol dll -- ) - 2dup 1 1 rel-dlsym dlsym 19 LOAD32 19 MTLR BLRL ; - M: %alien-invoke generate-node ( vop -- ) vop-in-1 uncons load-library compile-c-call ; diff --git a/library/compiler/ppc/assembler.factor b/library/compiler/ppc/assembler.factor index 8350d0e877..cebc93e086 100644 --- a/library/compiler/ppc/assembler.factor +++ b/library/compiler/ppc/assembler.factor @@ -108,6 +108,9 @@ USING: compiler errors kernel math memory words ; : ORC 0 (ORC) ; : ORC. 1 (ORC) ; +: MR over OR ; +: MR. over OR. ; + : (SLW) 24 swap x-form 31 insn ; : SLW 0 (SLW) ; : SLW. 1 (SLW) ; diff --git a/library/compiler/ppc/generator.factor b/library/compiler/ppc/generator.factor index d68381d9e7..a3df52edd2 100644 --- a/library/compiler/ppc/generator.factor +++ b/library/compiler/ppc/generator.factor @@ -1,14 +1,17 @@ ! Copyright (C) 2005 Slava Pestov. ! See http://factor.sf.net/license.txt for BSD license. IN: compiler-backend -USING: assembler compiler inference kernel kernel-internals -lists math memory namespaces words ; +USING: alien assembler compiler inference kernel +kernel-internals lists math memory namespaces words ; ! PowerPC register assignments ! r14 data stack ! r15 call stack ! r16-r30 vregs +: compile-c-call ( symbol dll -- ) + 2dup 1 1 rel-dlsym dlsym 19 LOAD32 19 MTLR BLRL ; + M: integer v>operand tag-bits shift ; M: vreg v>operand vreg-n 17 + ; @@ -96,6 +99,30 @@ M: %dispatch generate-node ( vop -- ) 17 MTLR BLR ; +M: %type generate-node ( vop -- ) + 0 check-src +