Index: /trunk/ccl/compiler/X86/X8664/x8664-vinsns.lisp
===================================================================
--- /trunk/ccl/compiler/X86/X8664/x8664-vinsns.lisp	(revision 5223)
+++ /trunk/ccl/compiler/X86/X8664/x8664-vinsns.lisp	(revision 5224)
@@ -2559,9 +2559,8 @@
   (movq (:%q object) (:%q tag))
   (shlq (:$ub (- x8664::nbits-in-word (+ 8 x8664::fixnumshift))) (:%q tag))
-  (sarq (:$ub (- x8664::nbits-in-word (+ 8 x8664::fixnumshift))) (:%q tag))
+  (sarq (:$ub (- x8664::nbits-in-word 8)) (:%q tag))
+  (shlq (:$ub x8664::fixnumshift) (:%q tag))
   (cmpq (:%q object) (:%q tag))
-  (jne.pn :bad)
-  (testb (:$b x8664::fixnummask) (:%b object))
-  (je.pt :bad)
+  (je.pt :ok)
   :bad
   (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-signed-byte-8))
@@ -2573,5 +2572,5 @@
 				((tag :u32)))
   :again
-  (movl (:$l (lognot (ash #xff x8664::fixnumshift))) (:%l tag))
+  (movq (:$l (lognot (ash #xff x8664::fixnumshift))) (:%q tag))
   (andq (:% object) (:% tag))
   (je.pt :ok)
@@ -2586,9 +2585,8 @@
   (movq (:%q object) (:%q tag))
   (shlq (:$ub (- x8664::nbits-in-word (+ 16 x8664::fixnumshift))) (:%q tag))
-  (sarq (:$ub (- x8664::nbits-in-word (+ 16 x8664::fixnumshift))) (:%q tag))
+  (sarq (:$ub (- x8664::nbits-in-word 16)) (:%q tag))
+  (shlq (:$ub x8664::fixnumshift) (:%q tag))
   (cmpq (:%q object) (:%q tag))
-  (jne.pn :bad)
-  (testb (:$b x8664::fixnummask) (:%b object))
-  (je.pt :bad)
+  (je.pt :ok)
   :bad
   (uuo-error-reg-not-type (:%q object) (:$ub arch::error-object-not-signed-byte-16))
@@ -2600,5 +2598,5 @@
 				((tag :u32)))
   :again
-  (movl (:$l (lognot (ash #xffff x8664::fixnumshift))) (:%l tag))
+  (movq (:$l (lognot (ash #xffff x8664::fixnumshift))) (:%q tag))
   (andq (:% object) (:% tag))
   (je.pt :ok)
@@ -2613,5 +2611,6 @@
   (movq (:%q object) (:%q tag))
   (shlq (:$ub (- x8664::nbits-in-word (+ 32 x8664::fixnumshift))) (:%q tag))
-  (sarq (:$ub (- x8664::nbits-in-word (+ 32 x8664::fixnumshift))) (:%q tag))
+  (sarq (:$ub (- x8664::nbits-in-word 32)) (:%q tag))
+  (shlq (:$ub x8664::fixnumshift) (:%q tag))
   (cmpq (:%q object) (:%q tag))
   (jne.pn :bad)
@@ -2651,5 +2650,5 @@
   :ok)
 
-(define-x8664-vinsn require-s64 (()
+(define-x8664-vinsn require-u64 (()
 				((object :lisp))
 				((tag :s64)))
@@ -2664,5 +2663,5 @@
   (je :two)
   (cmpq (:$l x8664::three-digit-bignum-header) (:@ x8664::misc-header-offset (:%q object)))
-  (je.pn :bad)
+  (jne.pn :bad)
   (cmpl (:$b 0) (:@ (+ x8664::misc-data-offset 8) (:%q object)))
   (je :ok)
@@ -2674,5 +2673,5 @@
   :ok-if-non-negative
   (testq (:%q tag) (:%q tag))
-  (jl :bad)
+  (js :bad)
   :ok)
 
