Remove combination-implementation-style.

This commit is contained in:
Stas Boukarev 2024-03-06 17:38:23 +03:00
parent 9ed74fa10a
commit 564aef8890
16 changed files with 13 additions and 90 deletions

View file

@ -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:

View file

@ -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"

View file

@ -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)

View file

@ -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))

View file

@ -93,7 +93,6 @@
;;; from vm.lisp
;;; immediate-constant-sc
;;; location-print-name
;;; combination-implementation-style
;;; convert-conditional-move-p
;;; boxed-immediate-sc-p

View file

@ -1200,15 +1200,6 @@
(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))
@ -1220,7 +1211,7 @@
(when (eq show :all)
(format *trace-output*
"~&quitting because IR1-TRANSFORM result was NIL"))
(return)))))))))))))
(return))))))))))
(values))
(defun xep-tail-combination-p (node)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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:

View file

@ -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.

View file

@ -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))