X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fmips%2Fsystem.lisp;h=9cd4b39c562412f5c6fb0c1ec2c5bbcd4100a0bf;hb=236acc699ec1b5996e04f3f30d2859803e54e5ea;hp=93ff2a42d873cc7cf6491a3d9738ba81544e529d;hpb=40b6c8b10330df5f1a3cc17e309857a7465ebc3f;p=sbcl.git diff --git a/src/compiler/mips/system.lisp b/src/compiler/mips/system.lisp index 93ff2a4..9cd4b39 100644 --- a/src/compiler/mips/system.lisp +++ b/src/compiler/mips/system.lisp @@ -1,32 +1,15 @@ -(in-package "SB!VM") +;;;; MIPS VM definitions of various system hacking operations - -;;;; Random pointer comparison VOPs - -(define-vop (pointer-compare) - (:args (x :scs (sap-reg)) - (y :scs (sap-reg))) - (:arg-types system-area-pointer system-area-pointer) - (:temporary (:scs (non-descriptor-reg)) temp) - (:conditional) - (:info target not-p) - (:policy :fast-safe) - (:note "inline comparison") - (:variant-vars condition) - (:generator 3 - (three-way-comparison x y condition :unsigned not-p target temp))) - -#+nil -(macrolet ((frob (name cond) - `(progn - (def-primitive-translator ,name (x y) `(,',name ,x ,y)) - (defknown ,name (t t) boolean (movable foldable flushable)) - (define-vop (,name pointer-compare) - (:translate ,name) - (:variant ,cond))))) - (frob pointer< :lt) - (frob pointer> :gt)) +;;;; This software is part of the SBCL system. See the README file for +;;;; more information. +;;;; +;;;; This software is derived from the CMU CL system, which was +;;;; written at Carnegie Mellon University and released into the +;;;; public domain. The software is in the public domain and is +;;;; provided with absolutely no warranty. See the COPYING and CREDITS +;;;; files for more information. +(in-package "SB!VM") ;;;; Type frobbing VOPs @@ -56,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. @@ -139,7 +122,7 @@ (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))) @@ -147,32 +130,17 @@ (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))) -(define-vop (make-other-immediate-type) - (:args (val :scs (any-reg descriptor-reg)) - (type :scs (any-reg descriptor-reg immediate) - :target temp)) - (:results (res :scs (any-reg descriptor-reg))) - (:temporary (:scs (non-descriptor-reg)) temp) - (:generator 2 - (sc-case type - ((immediate) - (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 or res res temp))))) - ;;;; Allocation @@ -261,3 +229,9 @@ (inst nop) (inst addu count 1) (inst sw count count-vector offset)))) + +;;;; Dummy definition for a spin-loop hint VOP +(define-vop (spin-loop-hint) + (:translate spin-loop-hint) + (:policy :fast-safe) + (:generator 0))