From: Alexey D. <ade...@us...> - 2003-08-12 20:10:42
|
Update of /cvsroot/sbcl/sbcl/src/compiler/x86 In directory sc8-pr-cvs1:/tmp/cvs-serv16526/src/compiler/x86 Modified Files: arith.lisp Log Message: 0.8.2.25: Initial implementation of modular functions: * new macro: SB!C:DEFINE-MODULAR-FUNCTION; * optimization of LOGAND: try to cut arguments to the needed number of bits; * implemented + with 32 bit width for x86. Index: arith.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86/arith.lisp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- arith.lisp 15 Apr 2003 08:29:05 -0000 1.10 +++ arith.lisp 12 Aug 2003 17:42:58 -0000 1.11 @@ -1389,3 +1389,29 @@ (inst mov tmp y) (inst shr tmp 18) (inst xor y tmp))) + +;;; Modular functions +(define-modular-fun +-mod32 + 32) + +(define-vop (fast-+-mod32/unsigned=>unsigned fast-safe-arith-op) + (:translate +-mod32) + (:args (x :scs (unsigned-reg) :target r + :load-if (not (and (sc-is x unsigned-stack) + (sc-is y unsigned-reg) + (sc-is r unsigned-stack) + (location= x r)))) + (y :scs (unsigned-reg unsigned-stack))) + (:arg-types unsigned-num unsigned-num) + (:results (r :scs (unsigned-reg) :from (:argument 0) + :load-if (not (and (sc-is x unsigned-stack) + (sc-is y unsigned-reg) + (location= x r))))) + (:result-types unsigned-num) + (:note "inline (unsigned-byte 32) arithmetic") + (:generator 5 + (cond ((and (sc-is x unsigned-reg) (sc-is y unsigned-reg) (sc-is r unsigned-reg) + (not (location= x r))) + (inst lea r (make-ea :dword :base x :index y :scale 1))) + (t + (move r x) + (inst add r y))))) |