From: Alexey D. <ade...@us...> - 2004-12-13 10:28:34
|
Update of /cvsroot/sbcl/sbcl/src/compiler/x86 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7260/src/compiler/x86 Modified Files: Tag: sbcl-0-8-17-28-signed-modular arith.lisp Log Message: 0.8.17.28-signed-modular-arithmetic.3: * Type derivation for unsigned modular functions. * Fixnum versions of most xxx-MOD32 functions on X86. Nathan Froyd's test from <200...@bl...> (2004-12-03) is compiled without notes. Index: arith.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86/arith.lisp,v retrieving revision 1.33.2.1 retrieving revision 1.33.2.2 diff -u -d -r1.33.2.1 -r1.33.2.2 --- arith.lisp 12 Dec 2004 06:46:28 -0000 1.33.2.1 +++ arith.lisp 13 Dec 2004 10:28:24 -0000 1.33.2.2 @@ -1194,23 +1194,26 @@ (macrolet ((def (name -c-p) (let ((fun32 (intern (format nil "~S-MOD32" name))) - (vop32 (intern (format nil "FAST-~S-MOD32/UNSIGNED=>UNSIGNED" name))) - (vop (intern (format nil "FAST-~S/UNSIGNED=>UNSIGNED" name))) - (vop32c (intern (format nil "FAST-~S-MOD32-C/UNSIGNED=>UNSIGNED" name))) - (vopc (intern (format nil "FAST-~S-C/UNSIGNED=>UNSIGNED" name))) + (vopu (intern (format nil "FAST-~S/UNSIGNED=>UNSIGNED" name))) + (vopcu (intern (format nil "FAST-~S-C/UNSIGNED=>UNSIGNED" name))) + (vopf (intern (format nil "FAST-~S/FIXNUM=>FIXNUM" name))) + (vopcf (intern (format nil "FAST-~S-C/FIXNUM=>FIXNUM" name))) + (vop32u (intern (format nil "FAST-~S-MOD32/UNSIGNED=>UNSIGNED" name))) + (vop32f (intern (format nil "FAST-~S-MOD32/FIXNUM=>FIXNUM" name))) + (vop32cu (intern (format nil "FAST-~S-MOD32-C/UNSIGNED=>UNSIGNED" name))) + (vop32cf (intern (format nil "FAST-~S-MOD32-C/FIXNUM=>FIXNUM" name))) (sfun30 (intern (format nil "~S-SMOD30" name))) - (svop30 (intern (format nil "FAST-~S-SMOD30/FIXNUM=>FIXNUM" name))) - (svop (intern (format nil "FAST-~S/FIXNUM=>FIXNUM" name))) - (svop30c (intern (format nil "FAST-~S-SMOD30-C/FIXNUM=>FIXNUM" name))) - (svopc (intern (format nil "FAST-~S-C/FIXNUM=>FIXNUM" name)))) - `(progn - (define-modular-fun ,fun32 (x y) ,name :unsigned 32) - (define-modular-fun ,sfun30 (x y) ,name :signed 30) - (define-vop (,vop32 ,vop) (:translate ,fun32)) - (define-vop (,svop30 ,svop) (:translate ,sfun30)) - ,@(when -c-p - `((define-vop (,vop32c ,vopc) (:translate ,fun32)) - (define-vop (,svop30c ,svopc) (:translate ,sfun30)))))))) + (svop30f (intern (format nil "FAST-~S-SMOD30/FIXNUM=>FIXNUM" name))) + (svop30cf (intern (format nil "FAST-~S-SMOD30-C/FIXNUM=>FIXNUM" name)))) + `(progn + (define-modular-fun ,fun32 (x y) ,name :unsigned 32) + (define-modular-fun ,sfun30 (x y) ,name :signed 30) + (define-vop (,vop32u ,vopu) (:translate ,fun32)) + (define-vop (,vop32f ,vopf) (:translate ,fun32)) + (define-vop (,svop30f ,vopf) (:translate ,sfun30)) + ,@(when -c-p + `((define-vop (,vop32cu ,vopcu) (:translate ,fun32)) + (define-vop (,svop30cf ,vopcf) (:translate ,sfun30)))))))) (def + t) (def - t) ;; (no -C variant as x86 MUL instruction doesn't take an immediate) @@ -1321,6 +1324,12 @@ (define-vop (fast-logxor-mod32-c/unsigned=>unsigned fast-logxor-c/unsigned=>unsigned) (:translate logxor-mod32)) +(define-vop (fast-logxor-mod32/fixnum=>fixnum + fast-logxor/fixnum=>fixnum) + (:translate logxor-mod32)) +(define-vop (fast-logxor-mod32-c/fixnum=>fixnum + fast-logxor-c/fixnum=>fixnum) + (:translate logxor-mod32)) (define-source-transform logeqv (&rest args) (if (oddp (length args)) |