Index: /branches/working-0711/ccl/compiler/X86/X8664/x8664-vinsns.lisp
===================================================================
--- /branches/working-0711/ccl/compiler/X86/X8664/x8664-vinsns.lisp	(revision 8008)
+++ /branches/working-0711/ccl/compiler/X86/X8664/x8664-vinsns.lisp	(revision 8009)
@@ -309,11 +309,15 @@
 
 (define-x8664-vinsn check-min-nargs (()
-                                       ((n :u16const)))
+                                       ((min :u16const)))
   :resume
-  (rcmpw (:%w x8664::nargs) (:$w (:apply ash n x8664::word-shift)))
-  (jb :bad)
+  ((:pred = min 1)
+   (testw (:%w x8664::nargs) (:%w x8664::nargs))
+   (je :toofew))
+  ((:not (:pred = min 1))
+   (rcmpw (:%w x8664::nargs) (:$w (:apply ash min x8664::word-shift)))
+   (jb :toofew))  
   
   (:anchored-uuo-section :resume)
-  :bad
+  :toofew
   (:anchored-uuo (uuo-error-too-few-args)))
 
@@ -326,4 +330,24 @@
   (:anchored-uuo-section :resume)
   :bad
+  (:anchored-uuo (uuo-error-too-many-args)))
+
+
+(define-x8664-vinsn check-min-max-nargs (()
+                                         ((min :u16const)
+                                          (max :u16)))
+  :resume
+  ((:pred = min 1)
+   (testw (:%w x8664::nargs) (:%w x8664::nargs))
+   (je :toofew))
+  ((:not (:pred = min 1))
+   (rcmpw (:%w x8664::nargs) (:$w (:apply ash min x8664::word-shift)))
+   (jb :toofew))
+  (rcmpw (:%w x8664::nargs) (:$w (:apply ash max x8664::word-shift)))
+  (jg :toomany)
+  
+  (:anchored-uuo-section :resume)
+  :toofew
+  (:anchored-uuo (uuo-error-too-few-args))
+  :toomany
   (:anchored-uuo (uuo-error-too-many-args)))
 
