[Openmcl-cvs-notifications] r11208 - /trunk/source/compiler/X86/x862.lisp

gb at clozure.com gb at clozure.com
Thu Oct 23 06:09:39 EDT 2008


Author: gb
Date: Thu Oct 23 06:09:39 2008
New Revision: 11208

Log:
In X862-INTEGER-CONSTANT-P (which is only used to recognize constant
arguments to foreign function calls), be more lenient (than we've been
lately) about signedness.  C will quietly coerce (for instance) a
constant of approprite width but the wrong signedness, so the constant
-1 when used as a parameter of type (UNSIGNED-BYTE 8) will be treated
the same way that #xff would have been.  Windows is generally pretty
sloppy about this; be equally sloppy (but don't allow things with
more significant bits than we want ...)

Modified:
    trunk/source/compiler/X86/x862.lisp

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 Thu Oct 23 06:09:39 2008
@@ -2982,7 +2982,18 @@
                   (setq form (%cadr form))
                   (if (typep form 'integer)
                     form)))))
-    (and val (%typep val (mode-specifier-type mode)) val)))
+    (when val
+      (let* ((type (mode-specifier-type mode))
+             (high (numeric-ctype-high type))
+             (low (numeric-ctype-low type)))
+        (if (and (>=3D val low)
+                 (<=3D val high))
+          val
+          (if (<=3D (integer-length val) (integer-length (- high low)))
+            (if (eql 0 low)             ; type is unsigned, value is negat=
ive
+              (logand high val)
+              (- val (1+ (- high low))))))))))
+
          =

 =

 =




More information about the Openmcl-cvs-notifications mailing list