X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fvm.lisp;h=8ae051d226227fb3f6064175c14d88241ae5b293;hb=3fc4b561752c5ad4519b882a3b9bdfe7a8207532;hp=833dd739f00fd23a928d1bbd1acd522f0d997462;hpb=0d871fd7a98fc4af92a8b942a1154761466ad8c9;p=sbcl.git diff --git a/src/compiler/x86/vm.lisp b/src/compiler/x86/vm.lisp index 833dd73..8ae051d 100644 --- a/src/compiler/x86/vm.lisp +++ b/src/compiler/x86/vm.lisp @@ -449,3 +449,34 @@ (immediate-constant "Immed") (noise (symbol-name (sc-name sc)))))) ;;; FIXME: Could this, and everything that uses it, be made #!+SB-SHOW? + +(!def-vm-support-routine combination-implementation-style (node) + (declare (type sb!c::combination node)) + (flet ((valid-funtype (args result) + (sb!c::valid-fun-use node + (sb!c::specifier-type + `(function ,args ,result))))) + (case (sb!c::combination-fun-source-name node) + (logtest + (cond + ((valid-funtype '(fixnum fixnum) '*) + (values :direct nil)) + ((valid-funtype '((signed-byte 32) (signed-byte 32)) '*) + (values :direct nil)) + ((valid-funtype '((unsigned-byte 32) (unsigned-byte 32)) '*) + (values :direct nil)) + (t (values :default nil)))) + (logbitp + (cond + ((and (valid-funtype '((integer 0 29) fixnum) '*) + (sb!c::constant-lvar-p (first (sb!c::basic-combination-args node)))) + (values :transform '(lambda (index integer) + (%logbitp integer index)))) + ((valid-funtype '((integer 0 31) (signed-byte 32)) '*) + (values :transform '(lambda (index integer) + (%logbitp integer index)))) + ((valid-funtype '((integer 0 31) (unsigned-byte 32)) '*) + (values :transform '(lambda (index integer) + (%logbitp integer index)))) + (t (values :default nil)))) + (t (values :default nil)))))