Index: /trunk/ccl/compiler/X86/X8664/x8664-vinsns.lisp
===================================================================
--- /trunk/ccl/compiler/X86/X8664/x8664-vinsns.lisp	(revision 5342)
+++ /trunk/ccl/compiler/X86/X8664/x8664-vinsns.lisp	(revision 5343)
@@ -634,8 +634,8 @@
 				       (v :lisp))
 				      ((temp :u64)))
-  (movq (:@ x8664::misc-header-offset (:%q v)) (:%q temp))
-  (shrq (:$ub x8664::num-subtag-bits) (:%q temp))
-  (shlq (:$ub x8664::word-shift) (:%q temp))
-  (rcmpq (:%q idx) (:%q temp))
+  (movq (:%q idx) (:%q temp))
+  (shlq (:$ub (- x8664::num-subtag-bits x8664::fixnumshift)) (:%q temp))
+  (decb (:%b temp))
+  (rcmpq (:%q temp) (:@ x8664::misc-header-offset (:%q v)))
   (jb.pt :ok)
   (uuo-error-vector-bounds (:%q idx) (:%q v))
@@ -3988,4 +3988,9 @@
 
 
+(define-x8664-vinsn xchg-registers (()
+                                    ((a t)
+                                     (b t)))
+  (xchgq (:%q a) (:%q b)))
+
 (queue-fixup
  (fixup-x86-vinsn-templates
