]> gitweb.factorcode.org Git - factor.git/commitdiff
fix bug in 16/16 reloc
authorSlava Pestov <slava@factorcode.org>
Tue, 7 Jun 2005 08:33:24 +0000 (08:33 +0000)
committerSlava Pestov <slava@factorcode.org>
Tue, 7 Jun 2005 08:33:24 +0000 (08:33 +0000)
library/compiler/ppc/assembler.factor
library/compiler/ppc/generator.factor
native/relocate.h

index 52cd0954679081fa66bf89427a47bd38b3d7dcba..9f500b5ed23ef7c596101745043374616492a54b 100644 (file)
@@ -195,7 +195,7 @@ USING: compiler errors kernel math memory words ;
 
 G: (B) ( dest aa lk -- ) [ pick ] [ type ] ;
 M: integer (B) i-form 18 insn ;
-M: word (B) 0 swap (B) relative-24 ;
+M: word (B) 0 (B) relative-24 ;
 
 : B 0 0 (B) ; : BA 1 0 (B) ; : BL 0 1 (B) ; : BLA 1 1 (B) ;
 
index 034d8983da3a91ab75d73dd430cc5ad3fb506a2e..56a4b3739d986c9d8d4c3e7c9afc601a5c8d55c0 100644 (file)
@@ -40,7 +40,7 @@ M: %call-label generate-node ( vop -- )
     B ;
 
 : word-addr ( word -- )
-    dup 0 1 rel-primitive word-xt 19 LOAD32 ;
+    dup word-xt 19 LOAD32  0 1 rel-word ;
 
 : compile-call ( label -- )
     #! Far C call for primitives, near C call for compiled defs.
index e35f51358ded052d52c067f021549e6708eea806..0a16b3e7d34890b0dbd892107b8c628264ec3ef8 100644 (file)
@@ -50,11 +50,11 @@ void relocate_code();
 given address */
 INLINE CELL reloc_get_16_16(CELL cell)
 {
-       return ((get(cell) & 0xffff) << 16) | (get(cell + 1) & 0xffff);
+       return ((get(cell - CELLS) & 0xffff) << 16) | (get(cell) & 0xffff);
 }
 
 INLINE void reloc_set_16_16(CELL cell, CELL value)
 {
-       put(cell,((get(cell) & ~0xffff) | ((value >> 16) & 0xffff)));
-       put(cell + 1,((get(cell + 1) & ~0xffff) | (value & 0xffff)));
+       put(cell - CELLS,((get(cell - CELLS) & ~0xffff) | ((value >> 16) & 0xffff)));
+       put(cell,((get(cell) & ~0xffff) | (value & 0xffff)));
 }