Updating PowerPC backend

db4
Slava Pestov 2008-07-14 03:06:20 -05:00
parent 3cea135fae
commit 6ab000cc52
2 changed files with 19 additions and 15 deletions

View File

@ -135,7 +135,6 @@ big-endian on
3 ds-reg 0 STW 3 ds-reg 0 STW
] f f f \ slot define-sub-primitive ] f f f \ slot define-sub-primitive
! Shufflers ! Shufflers
[ [
ds-reg dup 4 SUBI ds-reg dup 4 SUBI
@ -248,7 +247,7 @@ big-endian on
] f f f \ >r define-sub-primitive ] f f f \ >r define-sub-primitive
[ [
3 rs-reg 0 STW 3 rs-reg 0 LWZ
rs-reg dup 4 SUBI rs-reg dup 4 SUBI
3 ds-reg 4 STWU 3 ds-reg 4 STWU
] f f f \ r> define-sub-primitive ] f f f \ r> define-sub-primitive
@ -261,11 +260,11 @@ big-endian on
5 ds-reg -4 LWZU 5 ds-reg -4 LWZU
5 0 4 CMP 5 0 4 CMP
2 swap execute ! magic number 2 swap execute ! magic number
3 \ f tag-number LI \ f tag-number 3 LI
3 ds-reg 0 STW ; 3 ds-reg 0 STW ;
: define-jit-compare ( insn word -- ) : define-jit-compare ( insn word -- )
[ [ jit-compare ] curry rc-absolute-ppc-2/2 rt-literal 0 ] dip [ [ jit-compare ] curry rc-absolute-ppc-2/2 rt-literal 1 ] dip
define-sub-primitive ; define-sub-primitive ;
\ BEQ \ eq? define-jit-compare \ BEQ \ eq? define-jit-compare
@ -285,7 +284,13 @@ big-endian on
[ \ SUBF jit-math ] f f f \ fixnum-fast define-sub-primitive [ \ SUBF jit-math ] f f f \ fixnum-fast define-sub-primitive
[ \ MULLW jit-math ] f f f \ fixnum*fast define-sub-primitive [
3 ds-reg 0 LWZ
4 ds-reg -4 LWZU
4 4 tag-bits get SRAWI
5 3 4 MULLW
5 ds-reg 0 STW
] f f f \ fixnum*fast define-sub-primitive
[ \ AND jit-math ] f f f \ fixnum-bitand define-sub-primitive [ \ AND jit-math ] f f f \ fixnum-bitand define-sub-primitive

View File

@ -1,14 +1,13 @@
! Copyright (C) 2005, 2008 Slava Pestov. ! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.accessors alien.c-types arrays cpu.ppc.assembler USING: accessors alien alien.accessors alien.c-types arrays
cpu.ppc.architecture cpu.ppc.allot cpu.architecture kernel cpu.ppc.assembler cpu.ppc.architecture cpu.ppc.allot
kernel.private math math.private namespaces sequences words cpu.architecture kernel kernel.private math math.private
generic quotations byte-arrays hashtables hashtables.private namespaces sequences words generic quotations byte-arrays
generator generator.registers generator.fixup sequences.private hashtables hashtables.private generator generator.registers
sbufs vectors system layouts math.floats.private generator.fixup sequences.private sbufs vectors system layouts
classes classes.tuple classes.tuple.private sbufs.private math.floats.private classes slots.private combinators
vectors.private strings.private slots.private combinators compiler.constants optimizer.allot ;
compiler.constants ;
IN: cpu.ppc.intrinsics IN: cpu.ppc.intrinsics
: %slot-literal-known-tag : %slot-literal-known-tag
@ -445,7 +444,7 @@ IN: cpu.ppc.intrinsics
! Store tagged ptr in reg ! Store tagged ptr in reg
"tuple" get tuple %store-tagged "tuple" get tuple %store-tagged
] H{ ] H{
{ +input+ { { [ tuple-layout? ] "layout" } } } { +input+ { { [ ] "layout" } } }
{ +scratch+ { { f "tuple" } } } { +scratch+ { { f "tuple" } } }
{ +output+ { "tuple" } } { +output+ { "tuple" } }
} define-intrinsic } define-intrinsic