[Openmcl-cvs-notifications] r14959 - in /trunk/source: compiler/ARM/arm-vinsns.lisp compiler/ARM/arm2.lisp compiler/PPC/ppc2.lisp compiler/X86/X8632/x8632-vinsns.lisp compiler/X86/X8664/x8664-vinsns.lisp compiler/X86/x862.lisp compiler/reg.lisp lib/x8632env.lisp lib/x8664env.lisp

gb at clozure.com gb at clozure.com
Tue Aug 30 21:50:47 CDT 2011


Author: gb
Date: Tue Aug 30 21:50:47 2011
New Revision: 14959

Log:
%HARD-REGSPEC-VALUE masks its argument by the platform-specific
value of *ENCODED-REG-VALUE-BYTE*; the intent is that this allows
us to be more consistent in referring to things like "the 0th FPR",
regardless of how that's represented on a given platform.

Bind *ENCODED-REG-VALUE-BYTE* in compiler backends.

The temp-fp masks for x8632 and x8664 need to be built with this masking
in mind.

The CHECK-MIN-MAX-NARGS vinsns on x8632 and x8664 erroneously defined
MAX to be a :U16 (register) rather than a :U16CONST (constant).  The
vinsn machinery uses the %HARD-REGSPEC-VALUE of a register argument;
previously, that caused MAX to be treated (MOD 256) and it now causes
it to be (MOD 16) on x8664 and (MOD 8) on x8632, making this bug a
little easier to notice.

in arm-vinsns.lisp: remove a stray ^X character and note that the
SAVE-LISP-CONTEXT-OFFSET vinsn clobbers arm::imm0.

Modified:
    trunk/source/compiler/ARM/arm-vinsns.lisp
    trunk/source/compiler/ARM/arm2.lisp
    trunk/source/compiler/PPC/ppc2.lisp
    trunk/source/compiler/X86/X8632/x8632-vinsns.lisp
    trunk/source/compiler/X86/X8664/x8664-vinsns.lisp
    trunk/source/compiler/X86/x862.lisp
    trunk/source/compiler/reg.lisp
    trunk/source/lib/x8632env.lisp
    trunk/source/lib/x8664env.lisp

Modified: trunk/source/compiler/ARM/arm-vinsns.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/compiler/ARM/arm-vinsns.lisp (original)
+++ trunk/source/compiler/ARM/arm-vinsns.lisp Tue Aug 30 21:50:47 2011
@@ -3252,7 +3252,7 @@
                                          ((min :u16const))
                                          ((preserve (:u32 #.arm::nargs))
                                           (temp :u32)))
-  (movw temp (:$ (:apply ash min 2)))=18
+  (movw temp (:$ (:apply ash min 2)))
   (cmp nargs temp)
   (bhs :ok)
   (uuo-error-wrong-nargs (:? lo))
@@ -3289,7 +3289,8 @@
 =

 (define-arm-vinsn save-lisp-context-offset (()
                                             ((nbytes-vpushed :u16const))
-                                            ((imm (:u32 #.arm::imm1))))
+                                            ((imm (:u32 #.arm::imm1))
+                                             (clobbered (:u32 #.arm::imm0)=
)))
   ((:pred arm::encode-arm-immediate nbytes-vpushed)
    (add imm vsp (:$ nbytes-vpushed)))
   ((:not (:pred arm::encode-arm-immediate nbytes-vpushed))

Modified: trunk/source/compiler/ARM/arm2.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/compiler/ARM/arm2.lisp (original)
+++ trunk/source/compiler/ARM/arm2.lisp Tue Aug 30 21:50:47 2011
@@ -373,6 +373,7 @@
            (*arm-current-context-annotation* nil)
            (*arm2-woi* nil)
            (*next-lcell-id* -1)
+           (*encoded-reg-value-byte* (byte 5 0))           =

            (*arm2-open-code-inline* nil)
            (*arm2-optimize-for-space* nil)
            (*arm2-register-restore-count* nil)

Modified: trunk/source/compiler/PPC/ppc2.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/compiler/PPC/ppc2.lisp (original)
+++ trunk/source/compiler/PPC/ppc2.lisp Tue Aug 30 21:50:47 2011
@@ -382,6 +382,7 @@
            (*ppc-current-context-annotation* nil)
            (*ppc2-woi* nil)
            (*next-lcell-id* -1)
+           (*encoded-reg-value-byte* (byte 5 0))           =

            (*ppc2-open-code-inline* nil)
            (*ppc2-register-restore-count* nil)
            (*ppc2-compiler-register-save-label* nil)
@@ -9297,4 +9298,4 @@
                  (ppc2-copy-register seg rval rboxed)
                  (! fixnum-set-double-float rbase rindex rval))
                (<- rboxed)))))
-    (^)))
+    (^)))

Modified: trunk/source/compiler/X86/X8632/x8632-vinsns.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/compiler/X86/X8632/x8632-vinsns.lisp (original)
+++ trunk/source/compiler/X86/X8632/x8632-vinsns.lisp Tue Aug 30 21:50:47 2=
011
@@ -301,7 +301,7 @@
 =

 (define-x8632-vinsn check-min-max-nargs (()
                                          ((min :u16const)
-                                          (max :u16)))
+                                          (max :u16const)))
   :resume
   ((:pred =3D min 1)
    (testl (:%l x8632::nargs) (:%l x8632::nargs))

Modified: trunk/source/compiler/X86/X8664/x8664-vinsns.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/compiler/X86/X8664/x8664-vinsns.lisp (original)
+++ trunk/source/compiler/X86/X8664/x8664-vinsns.lisp Tue Aug 30 21:50:47 2=
011
@@ -350,7 +350,7 @@
 =

 (define-x8664-vinsn check-min-max-nargs (()
                                          ((min :u16const)
-                                          (max :u16)))
+                                          (max :u16const)))
   :resume
   ((:pred =3D min 1)
    (testl (:%l x8664::nargs) (:%l x8664::nargs))

Modified: trunk/source/compiler/X86/x862.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/compiler/X86/x862.lisp (original)
+++ trunk/source/compiler/X86/x862.lisp Tue Aug 30 21:50:47 2011
@@ -499,6 +499,9 @@
            (*x86-current-context-annotation* nil)
            (*x862-woi* nil)
            (*next-lcell-id* -1)
+           (*encoded-reg-value-byte* (target-arch-case
+                                      (:x8632 (byte 3 0))
+                                      (:x8664 (byte 4 0))))
            (*x862-open-code-inline* nil)
            (*x862-register-restore-count* nil)
            (*x862-compiler-register-save-label* nil)

Modified: trunk/source/compiler/reg.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/compiler/reg.lisp (original)
+++ trunk/source/compiler/reg.lisp Tue Aug 30 21:50:47 2011
@@ -154,13 +154,18 @@
       (lreg-class regspec)
       (error "bad regspec: ~s" regspec))))
 =

+(defparameter *encoded-reg-value-byte*
+  #+x8664-target (byte 4 0)
+  #+x8632-target (byte 3 0)
+  #+(or arm-target ppc-target) (byte 5 0))
+
 ; Return physical regspec's value:
 (defmacro hard-regspec-value (regspec)
   `(%hard-regspec-value ,regspec))
 =

 (defun %hard-regspec-value (regspec)
   (if (typep regspec 'fixnum)
-    (the fixnum (ldb regspec-hard-reg-type-value-byte (the fixnum regspec)=
))
+    (the fixnum (ldb *encoded-reg-value-byte* (the fixnum regspec)))
     (if (typep regspec 'lreg)
       (lreg-value regspec)
       (error "bad regspec: ~s" regspec))))

Modified: trunk/source/lib/x8632env.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lib/x8632env.lisp (original)
+++ trunk/source/lib/x8632env.lisp Tue Aug 30 21:50:47 2011
@@ -51,14 +51,14 @@
                              x8632::imm0))
 =

 ;;; Fine if we assume SSE support;  not so hot when using x87
-(defconstant x8632-temp-fp-regs (make-mask x8632::fp0
-                                           x8632::fp1
-                                           x8632::fp2
-                                           x8632::fp3
-                                           x8632::fp4
-                                           x8632::fp5
-                                           x8632::fp6
-                                           x8632::fp7))
+(defconstant x8632-temp-fp-regs (make-mask (logand x8632::fp0 7)
+                                           (logand x8632::fp1 7)
+                                           (logand x8632::fp2 7)
+                                           (logand x8632::fp3 7)
+                                           (logand x8632::fp4 7)
+                                           (logand x8632::fp5 7)
+                                           (logand x8632::fp6 7)
+                                           (logand x8632::fp7 7)))
                                =

 =

 =


Modified: trunk/source/lib/x8664env.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lib/x8664env.lisp (original)
+++ trunk/source/lib/x8664env.lisp Tue Aug 30 21:50:47 2011
@@ -65,14 +65,14 @@
                              x8664::imm1
                              x8664::imm2))
 =

-(defconstant x8664-temp-fp-regs (make-mask x8664::fp0
-                                           x8664::fp1
-                                           x8664::fp2
-                                           x8664::fp3
-                                           x8664::fp4
-                                           x8664::fp5
-                                           x8664::fp6
-                                           x8664::fp7))
+(defconstant x8664-temp-fp-regs (make-mask (logand x8664::fp0 15)
+                                           (logand x8664::fp1 15)
+                                           (logand x8664::fp2 15)
+                                           (logand x8664::fp3 15)
+                                           (logand x8664::fp4 15)
+                                           (logand x8664::fp5 15)
+                                           (logand x8664::fp6 15)
+                                           (logand x8664::fp7 15)))
                                =

 =

 =




More information about the Openmcl-cvs-notifications mailing list