X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Fmacros.lisp;h=be94d71a3ae0d9c55f6cd6a3ac1f0a4d3190d322;hb=5c41b6d95580938db33efd4640c2947b9e51e723;hp=6ec421875126f9018557471dd2f4d82825dc2d16;hpb=ea3a2433c72ee97c5691c29d882a63e4d86f0a32;p=sbcl.git diff --git a/src/compiler/x86-64/macros.lisp b/src/compiler/x86-64/macros.lisp index 6ec4218..be94d71 100644 --- a/src/compiler/x86-64/macros.lisp +++ b/src/compiler/x86-64/macros.lisp @@ -409,6 +409,42 @@ :disp (- (* (+ ,offset index) n-word-bytes) ,lowtag))))))) +(defmacro define-full-reffer+offset (name type offset lowtag scs el-type &optional translate) + `(progn + (define-vop (,name) + ,@(when translate + `((:translate ,translate))) + (:policy :fast-safe) + (:args (object :scs (descriptor-reg)) + (index :scs (any-reg))) + (:info offset) + (:arg-types ,type tagged-num + (:constant (constant-displacement other-pointer-lowtag + n-word-bytes vector-data-offset))) + (:results (value :scs ,scs)) + (:result-types ,el-type) + (:generator 3 ; pw was 5 + (inst mov value (make-ea :qword :base object :index index + :disp (- (* (+ ,offset offset) n-word-bytes) + ,lowtag))))) + (define-vop (,(symbolicate name "-C")) + ,@(when translate + `((:translate ,translate))) + (:policy :fast-safe) + (:args (object :scs (descriptor-reg))) + (:info index offset) + (:arg-types ,type + (:constant (load/store-index ,n-word-bytes ,(eval lowtag) + ,(eval offset))) + (:constant (constant-displacement other-pointer-lowtag + n-word-bytes vector-data-offset))) + (:results (value :scs ,scs)) + (:result-types ,el-type) + (:generator 2 ; pw was 5 + (inst mov value (make-ea :qword :base object + :disp (- (* (+ ,offset index offset) n-word-bytes) + ,lowtag))))))) + (defmacro define-full-setter (name type offset lowtag scs el-type &optional translate) `(progn (define-vop (,name) @@ -446,6 +482,51 @@ value) (move result value))))) +(defmacro define-full-setter+offset (name type offset lowtag scs el-type &optional translate) + `(progn + (define-vop (,name) + ,@(when translate + `((:translate ,translate))) + (:policy :fast-safe) + (:args (object :scs (descriptor-reg)) + (index :scs (any-reg)) + (value :scs ,scs :target result)) + (:info offset) + (:arg-types ,type tagged-num + (:constant (constant-displacement other-pointer-lowtag + n-word-bytes + vector-data-offset)) + ,el-type) + (:results (result :scs ,scs)) + (:result-types ,el-type) + (:generator 4 ; was 5 + (inst mov (make-ea :qword :base object :index index + :disp (- (* (+ ,offset offset) n-word-bytes) ,lowtag)) + value) + (move result value))) + (define-vop (,(symbolicate name "-C")) + ,@(when translate + `((:translate ,translate))) + (:policy :fast-safe) + (:args (object :scs (descriptor-reg)) + (value :scs ,scs :target result)) + (:info index offset) + (:arg-types ,type + (:constant (load/store-index ,n-word-bytes ,(eval lowtag) + ,(eval offset))) + (:constant (constant-displacement other-pointer-lowtag + n-word-bytes + vector-data-offset)) + ,el-type) + (:results (result :scs ,scs)) + (:result-types ,el-type) + (:generator 3 ; was 5 + (inst mov (make-ea :qword :base object + :disp (- (* (+ ,offset index offset) n-word-bytes) + ,lowtag)) + value) + (move result value))))) + ;;; helper for alien stuff. (def!macro with-pinned-objects ((&rest objects) &body body) "Arrange with the garbage collector that the pages occupied by