diff --git a/OPTIMIZATIONS b/OPTIMIZATIONS index d737e4132..5592a1611 100644 --- a/OPTIMIZATIONS +++ b/OPTIMIZATIONS @@ -195,31 +195,6 @@ To do this, extend ALLOCATE-VECTOR with ALLOW-JUNK argument, and when stack allocating don't zero if it is true -- and probably ALLOW-JUNK iff the vector is a specialized one (cannot have pointers.) -------------------------------------------------------------------------------- -#29 -Python is overly zealous when converting high-level CL functions, such -as MIN/MAX, LOGBITP, and LOGTEST, to low-level CL functions. Reducing -Python's aggressiveness would make it easier to effect changes such as - -x86-64: -* direct MIN/MAX on {SINGLE,DOUBLE}-FLOATs ({MIN,MAX}S{S,D}) - -x86-64: -* direct LOGBITP on word-sized integers and fixnums (BT + JC) - -x86{,-64}/PPC: -* branch-free MIN/MAX on word-sized integers and fixnums (floats could - be handled too, modulo safety considerations on the PPC) - -x86-64: -* efficient LOGTESTs on word-sized integers and fixnums (TEST) - -etc., etc. - -(The framework for this has been implemented as of 0.9.9.18; see the -vm-support-routine COMBINATION-IMPLEMENTATION-STYLE and its use in -src/compiler/ir1opt.lisp, IR1-OPTIMIZE-COMBINATION. The above -optimizations are left as an exercise for the reader.) --------------------------------------------------------------------------------- #31 The typecheck generated for a declaration like (integer 0 45) on x86 looks like: diff --git a/src/cold/exports.lisp b/src/cold/exports.lisp index ef9054be6..eafdfb3d3 100644 --- a/src/cold/exports.lisp +++ b/src/cold/exports.lisp @@ -1448,7 +1448,6 @@ like *STACK-TOP-HINT* and unsupported stuff like *TRACED-FUN-LIST*.") "CHANGE-VOP-FLAGS" "CONDITIONAL-FLAGS-FLAGS" "IMMEDIATE-CONSTANT-SC" "BOXED-IMMEDIATE-SC-P" - "COMBINATION-IMPLEMENTATION-STYLE" "CONVERT-CONDITIONAL-MOVE-P" "LOCATION-PRINT-NAME" "MAKE-CALL-OUT-TNS" diff --git a/src/compiler/arm/vm.lisp b/src/compiler/arm/vm.lisp index 1cd86c563..7614527c5 100644 --- a/src/compiler/arm/vm.lisp +++ b/src/compiler/arm/vm.lisp @@ -285,10 +285,6 @@ (immediate-constant "Immed") (float-registers (format nil "F~D" offset))))) -(defun combination-implementation-style (node) - (declare (ignore node)) - (values :default nil)) - (defun primitive-type-indirect-cell-type (ptype) (declare (ignore ptype)) nil) diff --git a/src/compiler/arm64/vm.lisp b/src/compiler/arm64/vm.lisp index fe7081f63..d05988a6b 100644 --- a/src/compiler/arm64/vm.lisp +++ b/src/compiler/arm64/vm.lisp @@ -314,9 +314,6 @@ ((double-reg complex-single-reg) "D") (complex-double-reg "Q")) offset))))) -(defun combination-implementation-style (node) - (declare (ignore node)) - (values :default nil)) (defun primitive-type-indirect-cell-type (ptype) (declare (ignore ptype)) diff --git a/src/compiler/backend.lisp b/src/compiler/backend.lisp index e69179592..f3fe69587 100644 --- a/src/compiler/backend.lisp +++ b/src/compiler/backend.lisp @@ -93,7 +93,6 @@ ;;; from vm.lisp ;;; immediate-constant-sc ;;; location-print-name -;;; combination-implementation-style ;;; convert-conditional-move-p ;;; boxed-immediate-sc-p diff --git a/src/compiler/ir1opt.lisp b/src/compiler/ir1opt.lisp index 3fa594183..ef9980f8f 100644 --- a/src/compiler/ir1opt.lisp +++ b/src/compiler/ir1opt.lisp @@ -1200,27 +1200,18 @@ (let ((optimizer (fun-info-optimizer info))) (unless (and optimizer (funcall optimizer node)) - ;; First give the VM a peek at the call - (multiple-value-bind (style) - (combination-implementation-style node) - (ecase style - (:direct - ;; The VM knows how to handle this. - ) - ((:default :maybe) - ;; Let transforms have a crack at it. - (dolist (x (fun-info-transforms info)) - (when (eq show :all) - (let* ((lvar (basic-combination-fun node)) - (fname (lvar-fun-name lvar t))) - (format *trace-output* - "~&trying transform ~s for ~s" - (transform-type x) fname))) - (unless (ir1-transform node x show) - (when (eq show :all) - (format *trace-output* - "~&quitting because IR1-TRANSFORM result was NIL")) - (return))))))))))))) + (dolist (x (fun-info-transforms info)) + (when (eq show :all) + (let* ((lvar (basic-combination-fun node)) + (fname (lvar-fun-name lvar t))) + (format *trace-output* + "~&trying transform ~s for ~s" + (transform-type x) fname))) + (unless (ir1-transform node x show) + (when (eq show :all) + (format *trace-output* + "~&quitting because IR1-TRANSFORM result was NIL")) + (return)))))))))) (values)) (defun xep-tail-combination-p (node) diff --git a/src/compiler/mips/vm.lisp b/src/compiler/mips/vm.lisp index 1f3f83ebd..9c2831cd0 100644 --- a/src/compiler/mips/vm.lisp +++ b/src/compiler/mips/vm.lisp @@ -365,10 +365,6 @@ (constant (format nil "Const~D" offset)) (immediate-constant "Immed")))) -(defun combination-implementation-style (node) - (declare (type sb-c::combination node) (ignore node)) - (values :default nil)) - (defun primitive-type-indirect-cell-type (ptype) (declare (ignore ptype)) nil) diff --git a/src/compiler/ppc/arith.lisp b/src/compiler/ppc/arith.lisp index 6e05ae6df..a5bdc2a25 100644 --- a/src/compiler/ppc/arith.lisp +++ b/src/compiler/ppc/arith.lisp @@ -869,9 +869,6 @@ (((constant-arg (mod #.n-word-bits)) word) *)) * :vop t) t) -;;; We only handle the constant cases because those are the only ones -;;; guaranteed to make it past COMBINATION-IMPLEMENTATION-STYLE. -;;; --njf, 06-02-2006 (define-vop (fast-logbitp-c/fixnum fast-conditional-c/fixnum) (:translate logbitp) (:arg-types (:constant (integer 0 29)) tagged-num) diff --git a/src/compiler/ppc/vm.lisp b/src/compiler/ppc/vm.lisp index 406baf56f..adf747c2a 100644 --- a/src/compiler/ppc/vm.lisp +++ b/src/compiler/ppc/vm.lisp @@ -335,10 +335,6 @@ (constant (format nil "Const~D" offset)) (immediate-constant "Immed")))) -(defun combination-implementation-style (node) - (declare (ignore node)) - (values :default nil)) - (defun primitive-type-indirect-cell-type (ptype) (declare (ignore ptype)) nil) diff --git a/src/compiler/ppc64/arith.lisp b/src/compiler/ppc64/arith.lisp index 7ba3b0e50..4b9f1d965 100644 --- a/src/compiler/ppc64/arith.lisp +++ b/src/compiler/ppc64/arith.lisp @@ -696,9 +696,6 @@ (((constant-arg (mod #.n-word-bits)) word) *)) * :vop t) t) -;;; We only handle the constant cases because those are the only ones -;;; guaranteed to make it past COMBINATION-IMPLEMENTATION-STYLE. -;;; --njf, 06-02-2006 #+nil (define-vop (fast-logbitp-c/fixnum fast-conditional-c/fixnum) (:translate logbitp) (:arg-types (:constant (integer 0 29)) tagged-num) diff --git a/src/compiler/ppc64/vm.lisp b/src/compiler/ppc64/vm.lisp index 73d1482a4..19e1723de 100644 --- a/src/compiler/ppc64/vm.lisp +++ b/src/compiler/ppc64/vm.lisp @@ -326,10 +326,6 @@ (constant (format nil "Const~D" offset)) (immediate-constant "Immed")))) -(defun combination-implementation-style (node) - (declare (type sb-c::combination node) (ignore node)) - (values :default nil)) - (defun primitive-type-indirect-cell-type (ptype) (declare (ignore ptype)) nil) diff --git a/src/compiler/riscv/vm.lisp b/src/compiler/riscv/vm.lisp index 62a92e939..f4eac1ca5 100644 --- a/src/compiler/riscv/vm.lisp +++ b/src/compiler/riscv/vm.lisp @@ -298,10 +298,6 @@ (constant (format nil "Const~D" offset)) (immediate-constant "Immed")))) -(defun combination-implementation-style (node) - (declare (type sb-c::combination node) (ignore node)) - (values :default nil)) - (defun primitive-type-indirect-cell-type (ptype) (declare (ignore ptype)) nil) diff --git a/src/compiler/sparc/vm.lisp b/src/compiler/sparc/vm.lisp index 1198f058d..416df4438 100644 --- a/src/compiler/sparc/vm.lisp +++ b/src/compiler/sparc/vm.lisp @@ -360,10 +360,6 @@ (constant (format nil "Const~D" offset)) (immediate-constant "Immed")))) -(defun combination-implementation-style (node) - (declare (type sb-c::combination node) (ignore node)) - (values :default nil)) - (defun primitive-type-indirect-cell-type (ptype) (declare (ignore ptype)) nil) diff --git a/src/compiler/x86-64/arith.lisp b/src/compiler/x86-64/arith.lisp index 7af35d5a1..a2ea27dd5 100644 --- a/src/compiler/x86-64/arith.lisp +++ b/src/compiler/x86-64/arith.lisp @@ -2660,7 +2660,7 @@ (deftransform logbitp ((index integer) (:or ((signed-word signed-word) *) ((word word) *)) * :vop t) - (not (sb-c::logbitp-to-minusp-p index integer))t) + (not (sb-c::logbitp-to-minusp-p index integer))) ;;; TODO: The TEST instruction preceding this JEQ is entirely superfluous ;;; and can be removed with a vop optimizer: diff --git a/src/compiler/x86-64/vm.lisp b/src/compiler/x86-64/vm.lisp index 36b54738a..70f070c2c 100644 --- a/src/compiler/x86-64/vm.lisp +++ b/src/compiler/x86-64/vm.lisp @@ -582,10 +582,6 @@ (defconstant nargs-offset rcx-offset) (defconstant cfp-offset rbp-offset) ; pfw - needed by stuff in /code -(defun combination-implementation-style (node) - (declare (ignore node)) - (values :default nil)) - (defvar *register-names* +qword-register-names+) ;;; See WRITE-FUNINSTANCE-PROLOGUE in x86-64-vm. diff --git a/src/compiler/x86/vm.lisp b/src/compiler/x86/vm.lisp index 043f4ff39..b038f8898 100644 --- a/src/compiler/x86/vm.lisp +++ b/src/compiler/x86/vm.lisp @@ -446,7 +446,3 @@ (constant (format nil "Const~D" offset)) (immediate-constant "Immed") (noise (symbol-name (sc-name sc)))))) - -(defun combination-implementation-style (node) - (declare (ignore node)) - (values :default nil))