Loading src/compiler/srctran.lisp +2 −2 Original line number Diff line number Diff line Loading @@ -183,8 +183,8 @@ (define-source-transform 1+ (x) `(+ ,x 1)) (define-source-transform 1- (x) `(- ,x 1)) (define-source-transform oddp (x) `(not (zerop (logand ,x 1)))) (define-source-transform evenp (x) `(zerop (logand ,x 1))) (define-source-transform oddp (x) `(logtest ,x 1)) (define-source-transform evenp (x) `(not (logtest ,x 1))) ;;; Note that all the integer division functions are available for ;;; inline expansion. Loading src/compiler/x86/arith.lisp +4 −3 Original line number Diff line number Diff line Loading @@ -1060,9 +1060,10 @@ ,(symbolicate "FAST-CONDITIONAL" suffix)) (:translate logtest) (:generator ,cost (inst test x ,(if (eq suffix '-c/fixnum) '(fixnumize y) 'y)) (emit-optimized-test-inst x ,(if (eq suffix '-c/fixnum) '(fixnumize y) 'y)) (inst jmp (if not-p :e :ne) target))))))) (define-logtest-vops)) Loading src/compiler/x86/insts.lisp +24 −0 Original line number Diff line number Diff line Loading @@ -1533,6 +1533,30 @@ (t (error "bogus operands for TEST: ~S and ~S" this that))))))) ;;; Emit the most compact form of the test immediate instruction, ;;; using an 8 bit test when the immediate is only 8 bits and the ;;; value is one of the four low registers (eax, ebx, ecx, edx) or the ;;; control stack. (defun emit-optimized-test-inst (x y) (typecase y ((unsigned-byte 7) (let ((offset (tn-offset x))) (cond ((and (sc-is x any-reg descriptor-reg) (or (= offset eax-offset) (= offset ebx-offset) (= offset ecx-offset) (= offset edx-offset))) (inst test (make-random-tn :kind :normal :sc (sc-or-lose 'byte-reg) :offset offset) y)) ((sc-is x control-stack) (inst test (make-ea :byte :base ebp-tn :disp (- (* (1+ offset) n-word-bytes))) y)) (t (inst test x y))))) (t (inst test x y)))) (define-instruction or (segment dst src) (:printer-list (arith-inst-printer-list #b001)) Loading src/compiler/x86/type-vops.lisp +1 −18 Original line number Diff line number Diff line Loading @@ -13,25 +13,8 @@ ;;;; test generation utilities ;;; Emit the most compact form of the test immediate instruction, ;;; using an 8 bit test when the immediate is only 8 bits and the ;;; value is one of the four low registers (eax, ebx, ecx, edx) or the ;;; control stack. (defun generate-fixnum-test (value) (let ((offset (tn-offset value))) (cond ((and (sc-is value any-reg descriptor-reg) (or (= offset eax-offset) (= offset ebx-offset) (= offset ecx-offset) (= offset edx-offset))) (inst test (make-random-tn :kind :normal :sc (sc-or-lose 'byte-reg) :offset offset) 3)) ((sc-is value control-stack) (inst test (make-ea :byte :base ebp-tn :disp (- (* (1+ offset) n-word-bytes))) 3)) (t (inst test value 3))))) (emit-optimized-test-inst value 3)) (defun %test-fixnum (value target not-p) (generate-fixnum-test value) Loading version.lisp-expr +1 −1 Original line number Diff line number Diff line Loading @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) "0.9.16.33" "0.9.16.34" Loading
src/compiler/srctran.lisp +2 −2 Original line number Diff line number Diff line Loading @@ -183,8 +183,8 @@ (define-source-transform 1+ (x) `(+ ,x 1)) (define-source-transform 1- (x) `(- ,x 1)) (define-source-transform oddp (x) `(not (zerop (logand ,x 1)))) (define-source-transform evenp (x) `(zerop (logand ,x 1))) (define-source-transform oddp (x) `(logtest ,x 1)) (define-source-transform evenp (x) `(not (logtest ,x 1))) ;;; Note that all the integer division functions are available for ;;; inline expansion. Loading
src/compiler/x86/arith.lisp +4 −3 Original line number Diff line number Diff line Loading @@ -1060,9 +1060,10 @@ ,(symbolicate "FAST-CONDITIONAL" suffix)) (:translate logtest) (:generator ,cost (inst test x ,(if (eq suffix '-c/fixnum) '(fixnumize y) 'y)) (emit-optimized-test-inst x ,(if (eq suffix '-c/fixnum) '(fixnumize y) 'y)) (inst jmp (if not-p :e :ne) target))))))) (define-logtest-vops)) Loading
src/compiler/x86/insts.lisp +24 −0 Original line number Diff line number Diff line Loading @@ -1533,6 +1533,30 @@ (t (error "bogus operands for TEST: ~S and ~S" this that))))))) ;;; Emit the most compact form of the test immediate instruction, ;;; using an 8 bit test when the immediate is only 8 bits and the ;;; value is one of the four low registers (eax, ebx, ecx, edx) or the ;;; control stack. (defun emit-optimized-test-inst (x y) (typecase y ((unsigned-byte 7) (let ((offset (tn-offset x))) (cond ((and (sc-is x any-reg descriptor-reg) (or (= offset eax-offset) (= offset ebx-offset) (= offset ecx-offset) (= offset edx-offset))) (inst test (make-random-tn :kind :normal :sc (sc-or-lose 'byte-reg) :offset offset) y)) ((sc-is x control-stack) (inst test (make-ea :byte :base ebp-tn :disp (- (* (1+ offset) n-word-bytes))) y)) (t (inst test x y))))) (t (inst test x y)))) (define-instruction or (segment dst src) (:printer-list (arith-inst-printer-list #b001)) Loading
src/compiler/x86/type-vops.lisp +1 −18 Original line number Diff line number Diff line Loading @@ -13,25 +13,8 @@ ;;;; test generation utilities ;;; Emit the most compact form of the test immediate instruction, ;;; using an 8 bit test when the immediate is only 8 bits and the ;;; value is one of the four low registers (eax, ebx, ecx, edx) or the ;;; control stack. (defun generate-fixnum-test (value) (let ((offset (tn-offset value))) (cond ((and (sc-is value any-reg descriptor-reg) (or (= offset eax-offset) (= offset ebx-offset) (= offset ecx-offset) (= offset edx-offset))) (inst test (make-random-tn :kind :normal :sc (sc-or-lose 'byte-reg) :offset offset) 3)) ((sc-is value control-stack) (inst test (make-ea :byte :base ebp-tn :disp (- (* (1+ offset) n-word-bytes))) 3)) (t (inst test value 3))))) (emit-optimized-test-inst value 3)) (defun %test-fixnum (value target not-p) (generate-fixnum-test value) Loading
version.lisp-expr +1 −1 Original line number Diff line number Diff line Loading @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) "0.9.16.33" "0.9.16.34"