diff --git a/src/compiler/x86/cell.lisp b/src/compiler/x86/cell.lisp index 9283a78512d056a3750b5aa65c6d3812af412c90..aeb18cdff73efe8793fe1dce74840e597209de1d 100644 --- a/src/compiler/x86/cell.lisp +++ b/src/compiler/x86/cell.lisp @@ -198,7 +198,7 @@ (:args (function :scs (descriptor-reg) :target result) (fdefn :scs (descriptor-reg))) (:temporary (:sc unsigned-reg) raw) - (:temporary (:sc byte-reg) type) + (:temporary (:sc unsigned-reg) type) (:results (result :scs (descriptor-reg))) (:generator 38 (load-type type function (- function-pointer-type)) diff --git a/src/compiler/x86/macros.lisp b/src/compiler/x86/macros.lisp index d4659c2ada9d5d0535e18d4120505e38b35cafe5..bbd5ef5cf05af146165d1a41b587aed82810eaae 100644 --- a/src/compiler/x86/macros.lisp +++ b/src/compiler/x86/macros.lisp @@ -110,10 +110,10 @@ (n-offset offset)) (ecase (backend-byte-order *target-backend*) (:little-endian - `(inst mov ,n-target + `(inst movzx ,n-target (make-ea :byte :base ,n-source :disp ,n-offset))) (:big-endian - `(inst mov ,n-target + `(inst movzx ,n-target (make-ea :byte :base ,n-source :disp (+ ,n-offset 3))))))) (defmacro load-foreign-data-symbol (reg name ) diff --git a/src/compiler/x86/system.lisp b/src/compiler/x86/system.lisp index 71f7bb257d5332fdb9407e4809802e292b0aa7e0..683d9e2d2ee8180cd4ee30b71c84984977210d10 100644 --- a/src/compiler/x86/system.lisp +++ b/src/compiler/x86/system.lisp @@ -39,50 +39,48 @@ (define-vop (get-type) (:translate get-type) (:policy :fast-safe) - (:args (object :scs (descriptor-reg))) - (:temporary (:sc unsigned-reg :offset eax-offset :to (:result 0)) eax) - (:results (result :scs (unsigned-reg))) + (:args (object :scs (descriptor-reg) :to (:eval 1))) + (:results (result :scs (unsigned-reg) :from (:eval 0))) (:result-types positive-fixnum) (:generator 6 - (inst mov eax object) - (inst and al-tn lowtag-mask) - (inst cmp al-tn other-pointer-type) + ;; Pick off objects with headers. + (inst mov result object) + (inst and result lowtag-mask) + (inst cmp result other-pointer-type) (inst jmp :e other-ptr) - (inst cmp al-tn function-pointer-type) + (inst cmp result function-pointer-type) (inst jmp :e function-ptr) - ;; pick off structures and list pointers - (inst test al-tn 1) - (inst jmp :ne done) + ;; Pick off structure and list pointers. + (inst test result 1) + (inst jmp :nz done) - ;; pick off fixnums - (inst and al-tn 3) - (inst jmp :e done) + ;; Pick off fixnums. + (inst and result 3) + (inst jmp :z done) - ;; must be an other immediate - (inst mov eax object) + ;; Must be an other immediate. + (inst mov result object) + (inst and result type-mask) (inst jmp done) - + FUNCTION-PTR - (load-type al-tn object (- vm:function-pointer-type)) + (load-type result object (- vm:function-pointer-type)) (inst jmp done) - + OTHER-PTR - (load-type al-tn object (- vm:other-pointer-type)) - - DONE - (inst movzx result al-tn))) + (load-type result object (- vm:other-pointer-type)) + + DONE)) (define-vop (function-subtype) (:translate function-subtype) (:policy :fast-safe) (:args (function :scs (descriptor-reg))) - (:temporary (:sc byte-reg :from (:eval 0) :to (:eval 1)) temp) (:results (result :scs (unsigned-reg))) (:result-types positive-fixnum) (:generator 6 - (load-type temp function (- vm:function-pointer-type)) - (inst movzx result temp))) + (load-type result function (- vm:function-pointer-type)))) (define-vop (set-function-subtype) (:translate (setf function-subtype)) diff --git a/src/compiler/x86/values.lisp b/src/compiler/x86/values.lisp index 765c04503d0fceef53fc73949714e6a1bfb6f6b8..7a06496bb33f860d26f9a22405d225d0d679f65c 100644 --- a/src/compiler/x86/values.lisp +++ b/src/compiler/x86/values.lisp @@ -58,23 +58,21 @@ (:results (start :scs (any-reg)) (count :scs (any-reg))) (:temporary (:sc descriptor-reg :from (:argument 0) :to (:result 1)) list) - (:temporary (:sc descriptor-reg :to (:result 1)) nil-temp) - (:temporary (:sc unsigned-reg :offset eax-offset :to (:result 1)) eax) + (:temporary (:sc unsigned-reg :to (:result 1)) temp) (:vop-var vop) (:save-p :compute-only) (:generator 0 (move list arg) (move start esp-tn) ; WARN pointing 1 below - (inst mov nil-temp nil-value) LOOP - (inst cmp list nil-temp) + (inst cmp list nil-value) (inst jmp :e done) (pushw list cons-car-slot list-pointer-type) (loadw list list cons-cdr-slot list-pointer-type) - (inst mov eax list) - (inst and al-tn lowtag-mask) - (inst cmp al-tn list-pointer-type) + (inst mov temp list) + (inst and temp lowtag-mask) + (inst cmp temp list-pointer-type) (inst jmp :e loop) (error-call vop bogus-argument-to-values-list-error list)