1.0.33.20: MORE CONSTANTIFICATION
[sbcl.git] / src / compiler / mips / system.lisp
index b31d80d..e5841e5 100644 (file)
@@ -39,7 +39,7 @@
     (inst beq ndescr function-ptr)
 
     ;; Pick off fixnums.
-    (inst and result object 3)
+    (inst and result object fixnum-tag-mask)
     (inst beq result done)
 
     ;; Pick off structure and list pointers.
     (inst and t1 widetag-mask)
     (sc-case data
       (any-reg
-       (inst sll t2 data (- n-widetag-bits 2))
+       (inst sll t2 data (- n-widetag-bits n-fixnum-tag-bits))
        (inst or t1 t2))
       (immediate
        (inst or t1 (ash (tn-value data) n-widetag-bits)))
     (storew t1 x 0 other-pointer-lowtag)
     (move res x)))
 
-(define-vop (make-fixnum)
+(define-vop (pointer-hash)
+  (:translate pointer-hash)
   (:args (ptr :scs (any-reg descriptor-reg)))
   (:results (res :scs (any-reg descriptor-reg)))
+  (:policy :fast-safe)
   (:generator 1
-    ;;
-    ;; Some code (the hash table code) depends on this returning a
-    ;; positive number so make sure it does.
+    ;; FIXME: It would be better if this would mask the lowtag,
+    ;; and shift the result into a positive fixnum like on x86.
     (inst sll res ptr 3)
     (inst srl res res 1)))
 
        (inst sll temp val n-widetag-bits)
        (inst or res temp (tn-value type)))
       (t
-       (inst sra temp type 2)
-       (inst sll res val (- n-widetag-bits 2))
+       (inst sra temp type n-fixnum-tag-bits)
+       (inst sll res val (- n-widetag-bits n-fixnum-tag-bits))
        (inst or res res temp)))))
 
 \f