sb-simd patch version 1.3
authorD Herring <dherring@at.tentpost.dot.com>
Sat, 26 Jan 2008 02:30:22 +0000 (25 21:30 -0500)
committerD Herring <dherring@at.tentpost.dot.com>
Thu, 31 Jan 2008 21:53:31 +0000 (31 16:53 -0500)
src/compiler/x86/float.lisp
src/compiler/x86/insts.lisp
src/compiler/x86/vm.lisp

index fd69f80..202bdc1 100644 (file)
   (:note "inline dummy FP register bias")
   (:ignore x)
   (:generator 0))
+
+
+;; XMM Moves
+
+
+(defun ea-for-xmm-desc (tn)
+  (make-ea :xmmword :base tn 
+          :disp (- (* xmm-value-slot n-word-bytes) other-pointer-lowtag)))
+
+(defun ea-for-xmm-stack (tn)
+  (make-ea :xmmword :base ebp-tn 
+          :disp (- (* (+ (tn-offset tn)
+                         4)
+                      n-word-bytes))))
+
+(define-move-fun (load-xmm 2) (vop x y)
+  ((xmm-stack) (xmm-reg))
+  (inst movdqu y (ea-for-xmm-stack x)))
+
+(define-move-fun (store-xmm 2) (vop x y)
+  ((xmm-reg) (xmm-stack))
+  (inst movdqu (ea-for-xmm-stack y) x))
+
+(define-move-fun (load-xmm-single 2) (vop x y)
+  ((single-stack) (xmm-reg))
+  (inst movss y (ea-for-sf-stack x)))
+
+(define-move-fun (store-xmm-single 2) (vop x y)
+  ((xmm-reg) (single-stack))
+  (inst movss (ea-for-sf-stack y) x))
+
+
+(define-vop (%load-xmm-from-array/single-float)
+    (:policy :fast-safe)
+    (:args (src :scs (descriptor-reg))
+          (index :scs (unsigned-reg)))
+    (:ARG-TYPES SIMPLE-ARRAY-SINGLE-FLOAT fixnum)
+    (:results (dest :scs (xmm-reg)))
+    (:result-types xmm)
+    (:generator 1
+               (inst shl index 2)
+               (inst movdqu dest (make-ea :xmmword :base src :index index
+                                          :disp (- (* VECTOR-DATA-OFFSET N-WORD-BYTES) OTHER-POINTER-LOWTAG)))))
+
+    
+(define-vop (%store-xmm-to-array/single-float)
+    (:policy :fast-safe)
+    (:args (dest :scs (descriptor-reg))
+          (index :scs (unsigned-reg))
+          (src :scs (xmm-reg)))
+    (:ARG-TYPES SIMPLE-ARRAY-SINGLE-FLOAT fixnum XMM)
+    (:generator 1
+               (inst shl index 2)
+               (inst movdqu (make-ea :xmmword :base dest :index index 
+                                     :disp (- (* VECTOR-DATA-OFFSET N-WORD-BYTES) OTHER-POINTER-LOWTAG))
+                     src)))
+
+    
+(define-vop (xmm-move)
+  (:args (x :scs (xmm-reg) :target y :load-if (not (location= x y))))
+  (:results (y :scs (xmm-reg) :load-if (not (location= x y))))
+  (:note "xmm move")
+  (:generator 0
+             (unless (location= x y)
+               (inst movdqa y x))))
+
+(define-move-vop xmm-move :move (xmm-reg) (xmm-reg))
+
+(define-vop (move-from-xmm)
+  (:args (x :scs (xmm-reg) :to :save))
+  (:results (y :scs (descriptor-reg)))
+  (:node-var node)
+  (:note "xmm to pointer coercion")
+  (:generator 13
+     (with-fixed-allocation (y
+                             xmm-widetag
+                             xmm-size node)
+       (inst movdqu (ea-for-xmm-desc y) x))))
+
+(define-move-vop move-from-xmm :move (xmm-reg) (descriptor-reg))
+
+(define-vop (move-to-xmm)
+  (:args (x :scs (descriptor-reg)))
+  (:results (y :scs (xmm-reg)))
+  (:note "pointer to xmm coercion")
+  (:generator 2
+             (inst movdqu y (ea-for-xmm-desc x))))
+
+(define-move-vop move-to-xmm :move (descriptor-reg) (xmm-reg))
+
+
+(define-vop (move-xmm-arg)
+    (:args (x :scs (xmm-reg) :target y)
+          (fp :scs (any-reg)
+              :load-if (not (sc-is y xmm-reg))))
+  (:results (y))
+  (:note "xmm argument move")
+  (:generator 6
+             (sc-case y
+                      (xmm-reg
+                       (unless (location= x y)
+                         (inst movdqa y x)))
+
+                      (xmm-stack
+                       (if (= (tn-offset fp) esp-offset)
+                           (let* ((offset (* (tn-offset y) n-word-bytes))
+                                  (ea (make-ea :xmmword :base fp :disp offset)))
+                             (inst movdqu ea x))
+
+                           (let ((ea (make-ea :xmmword :base fp
+                                              :disp (- (* (+ (tn-offset y) 4)
+                                                          n-word-bytes)))))
+                             (inst movdqu ea x)))))))
+
+(define-move-vop move-xmm-arg :move-arg (xmm-reg descriptor-reg) (xmm-reg))
+
+(define-move-vop move-arg :move-arg (xmm-reg) (descriptor-reg))
+
+
index ce271e6..287e1f0 100644 (file)
   #(ax cx dx bx sp bp si di))
 (defparameter *dword-reg-names*
   #(eax ecx edx ebx esp ebp esi edi))
+(defparameter *xmmword-reg-names*
+  #(xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7))
 
 (defun print-reg-with-width (value width stream dstate)
   (declare (ignore dstate))
   (princ (aref (ecase width
                  (:byte *byte-reg-names*)
                  (:word *word-reg-names*)
-                 (:dword *dword-reg-names*))
+                 (:dword *dword-reg-names*)
+                 (:xmmword *xmmword-reg-names*))
                value)
          stream)
   ;; XXX plus should do some source-var notes
     (:byte 8)
     (:word 16)
     (:dword 32)
+    (:qword 64)
+    (:xmmword 128)
     (:float 32)
     (:double 64)))
 
 
 (defun reg-tn-encoding (tn)
   (declare (type tn tn))
-  (aver (eq (sb-name (sc-sb (tn-sc tn))) 'registers))
+;  (aver (eq (sb-name (sc-sb (tn-sc tn))) 'registers))
   (let ((offset (tn-offset tn)))
     (logior (ash (logand offset 1) 2)
             (ash offset -1))))
 
 (defstruct (ea (:constructor make-ea (size &key base index scale disp))
                (:copier nil))
-  (size nil :type (member :byte :word :dword))
+  (size nil :type (member :byte :word :dword :xmmword))
   (base nil :type (or tn null))
   (index nil :type (or tn null))
   (scale 1 :type (member 1 2 4 8))
      (ecase (sb-name (sc-sb (tn-sc thing)))
        (registers
         (emit-mod-reg-r/m-byte segment #b11 reg (reg-tn-encoding thing)))
+       (xmm-registers
+        (emit-mod-reg-r/m-byte segment #b11 reg (reg-tn-encoding thing)))
        (stack
         ;; Convert stack tns into an index off of EBP.
         (let ((disp (frame-byte-offset (tn-offset thing))))
   (and (tn-p thing)
        (eq (sb-name (sc-sb (tn-sc thing))) 'registers)))
 
+(defun xmm-register-p (thing)
+  (and (tn-p thing)
+       (eq (sb-name (sc-sb (tn-sc thing))) 'xmm-registers)
+       (member (sc-name (tn-sc thing)) *xmmword-sc-names*)
+       t))
+
+(defun xmm-ea-p (thing)
+  (typecase thing
+    (ea (eq (ea-size thing) :xmmword))
+    (tn
+     (and (member (sc-name (tn-sc thing)) *xmmword-sc-names*) t))
+    (t nil)))
+
 (defun accumulator-p (thing)
   (and (register-p thing)
        (= (tn-offset thing) 0)))
         :float)
        (#.*double-sc-names*
         :double)
+       (#.*xmmword-sc-names*
+        :xmmword)
        (t
         (error "can't tell the size of ~S ~S" thing (sc-name (tn-sc thing))))))
     (ea
   (:emitter
    (emit-header-data segment return-pc-header-widetag)))
 \f
+
+;;;; SSE instructions
+;;;; 
+;;;; Automatically generated
+
+
+(DEFINE-INSTRUCTION ADDPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 88)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION ADDSUBPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 208)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION ANDNPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 85)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION ANDPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 84)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION DIVPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 94)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION HADDPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 124)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION HSUBPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 125)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MAXPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 95)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MINPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 93)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MULPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 89)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION ORPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 86)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION RCPPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 83)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION RSQRTPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 82)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION SQRTPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 81)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION SUBPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 92)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION UNPCKHPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 21)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION UNPCKLPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 20)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION XORPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 87)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION ADDPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 88)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION ADDSUBPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 208)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION ANDNPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 85)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION ANDPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 84)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION DIVPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 94)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION HADDPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 124)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION HSUBPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 125)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MAXPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 95)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MINPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 93)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MULPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 89)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION ORPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 86)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION SQRTPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 81)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION SUBPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 92)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION UNPCKHPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 21)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION UNPCKLPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 20)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION XORPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 87)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION ADDSD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 88)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION COMISD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 47)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION DIVSD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 94)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MAXSD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 95)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MINSD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 93)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MULSD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 89)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION SQRTSD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 81)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION SUBSD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 92)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION UCOMISD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 46)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION ADDSS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 88)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION COMISS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 47)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION DIVSS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 94)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MAXSS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 95)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MINSS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 93)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MULSS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 89)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION RCPSS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 83)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION RSQRTSS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 82)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION SQRTSS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 81)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION SUBSS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 92)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION UCOMISS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 46)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PACKSSDW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 107)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PACKSSWB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 99)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PACKUSWB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 103)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PADDB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 252)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PADDD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 254)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PADDQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 212)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PADDSB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 236)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PADDSW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 237)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PADDUSB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 220)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PADDUSW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 221)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PADDW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 253)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PAND
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 219)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PANDN
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 223)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PAVGB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 224)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PAVGW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 227)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PCMPEQB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 116)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PCMPEQD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 118)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PCMPEQW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 117)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PCMPGTB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 100)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PCMPGTD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 102)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PCMPGTW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 101)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PMADDWD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 245)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PMAXSW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 238)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PMAXUB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 222)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PMINSW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 234)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PMINUB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 218)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PMOVMSKB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 215)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PMULHUW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 228)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PMULHW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 229)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PMULLW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 213)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PMULUDQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 244)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION POR
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 235)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSADBW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 246)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSSLD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 242)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSLLQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 243)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSLLW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 241)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSRAD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 226)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSRAW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 226)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSRLD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 210)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSRLQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 211)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSRLW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 209)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSUBB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 248)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSUBD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 250)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSUBQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 251)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSUBSB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 232)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSUBSW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 233)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSUBUSB
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 216)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSUBUSW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 217)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PSUBW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 249)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PUNPCKHBW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 104)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PUNPCKHDQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 106)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PUNPCKHQDQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 109)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PUNPCKHWD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 105)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PUNPCKLBW
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 96)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PUNPCKLDQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 98)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PUNPCKLQDQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 108)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PUNPCKLWD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 97)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PXOR
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 239)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTDQ2PD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 230)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTDQ2PS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 91)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTPD2DQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 230)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTPD2PI
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 45)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTPD2PS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 90)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTPI2PD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 42)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTPI2PS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 42)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTPS2DQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 91)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTPS2PD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 90)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTPS2PI
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 45)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTSD2SI
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 45)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTSD2SS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 90)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTSI2SD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 42)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTSI2SS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 42)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTSS2SD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 90)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTSS2SI
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 45)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTTPD2DQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 230)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTTPD2PI
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 44)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTTPS2DQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 91)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTTPS2PI
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 44)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTTSD2SI
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 44)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION CVTTSS2SI
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 44)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION LDDQU
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 240)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MASKMOVDQU
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 247)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MOVDDUP
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 18)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MOVHLPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 18)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MOVLHPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 22)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MOVMSKPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 80)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MOVMSKPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 80)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MOVNTDQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 231)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MOVNTPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 43)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MOVNTPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 43)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MOVSHDUP
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 22)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION MOVSLDUP
+                    (SEGMENT DST SRC)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 18)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))))
+
+(DEFINE-INSTRUCTION PEXTRW
+                    (SEGMENT DST SRC BYTE)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 197)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))
+                              (EMIT-SIZED-IMMEDIATE SEGMENT :BYTE BYTE)))
+
+(DEFINE-INSTRUCTION PINSRW
+                    (SEGMENT DST SRC BYTE)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 196)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))
+                              (EMIT-SIZED-IMMEDIATE SEGMENT :BYTE BYTE)))
+
+(DEFINE-INSTRUCTION PSHUFD
+                    (SEGMENT DST SRC BYTE)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 112)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))
+                              (EMIT-SIZED-IMMEDIATE SEGMENT :BYTE BYTE)))
+
+(DEFINE-INSTRUCTION PSHUFHW
+                    (SEGMENT DST SRC BYTE)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 112)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))
+                              (EMIT-SIZED-IMMEDIATE SEGMENT :BYTE BYTE)))
+
+(DEFINE-INSTRUCTION PSHUFLW
+                    (SEGMENT DST SRC BYTE)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 112)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))
+                              (EMIT-SIZED-IMMEDIATE SEGMENT :BYTE BYTE)))
+
+(DEFINE-INSTRUCTION SHUFPD
+                    (SEGMENT DST SRC BYTE)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 198)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))
+                              (EMIT-SIZED-IMMEDIATE SEGMENT :BYTE BYTE)))
+
+(DEFINE-INSTRUCTION SHUFPS
+                    (SEGMENT DST SRC BYTE)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 198)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))
+                              (EMIT-SIZED-IMMEDIATE SEGMENT :BYTE BYTE)))
+
+(DEFINE-INSTRUCTION CMPPD
+                    (SEGMENT DST SRC COND)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 194)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))
+                              (EMIT-SIZED-IMMEDIATE SEGMENT
+                                                    :BYTE
+                                                    (CDR
+                                                     (ASSOC COND
+                                                            '((:EQ . 0)
+                                                              (:E . 0) (:Z . 0)
+                                                              (:L . 1)
+                                                              (:NGE . 1)
+                                                              (:LE . 2)
+                                                              (:NG . 2)
+                                                              (:UNORD . 3)
+                                                              (:NE . 4)
+                                                              (:NZ . 4)
+                                                              (:NL . 5)
+                                                              (:GE . 5)
+                                                              (:NLE . 6)
+                                                              (:G . 6)
+                                                              (:ORD . 7)))))))
+
+(DEFINE-INSTRUCTION CMPPS
+                    (SEGMENT DST SRC COND)
+                    (:EMITTER (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 194)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))
+                              (EMIT-SIZED-IMMEDIATE SEGMENT
+                                                    :BYTE
+                                                    (CDR
+                                                     (ASSOC COND
+                                                            '((:EQ . 0)
+                                                              (:E . 0) (:Z . 0)
+                                                              (:L . 1)
+                                                              (:NGE . 1)
+                                                              (:LE . 2)
+                                                              (:NG . 2)
+                                                              (:UNORD . 3)
+                                                              (:NE . 4)
+                                                              (:NZ . 4)
+                                                              (:NL . 5)
+                                                              (:GE . 5)
+                                                              (:NLE . 6)
+                                                              (:G . 6)
+                                                              (:ORD . 7)))))))
+
+(DEFINE-INSTRUCTION CMPSD
+                    (SEGMENT DST SRC COND)
+                    (:EMITTER (EMIT-BYTE SEGMENT 242)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 194)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))
+                              (EMIT-SIZED-IMMEDIATE SEGMENT
+                                                    :BYTE
+                                                    (CDR
+                                                     (ASSOC COND
+                                                            '((:EQ . 0)
+                                                              (:E . 0) (:Z . 0)
+                                                              (:L . 1)
+                                                              (:NGE . 1)
+                                                              (:LE . 2)
+                                                              (:NG . 2)
+                                                              (:UNORD . 3)
+                                                              (:NE . 4)
+                                                              (:NZ . 4)
+                                                              (:NL . 5)
+                                                              (:GE . 5)
+                                                              (:NLE . 6)
+                                                              (:G . 6)
+                                                              (:ORD . 7)))))))
+
+(DEFINE-INSTRUCTION CMPSS
+                    (SEGMENT DST SRC COND)
+                    (:EMITTER (EMIT-BYTE SEGMENT 243)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 194)
+                              (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST))
+                              (EMIT-SIZED-IMMEDIATE SEGMENT
+                                                    :BYTE
+                                                    (CDR
+                                                     (ASSOC COND
+                                                            '((:EQ . 0)
+                                                              (:E . 0) (:Z . 0)
+                                                              (:L . 1)
+                                                              (:NGE . 1)
+                                                              (:LE . 2)
+                                                              (:NG . 2)
+                                                              (:UNORD . 3)
+                                                              (:NE . 4)
+                                                              (:NZ . 4)
+                                                              (:NL . 5)
+                                                              (:GE . 5)
+                                                              (:NLE . 6)
+                                                              (:G . 6)
+                                                              (:ORD . 7)))))))
+
+(DEFINE-INSTRUCTION MOVAPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 102)
+                       (EMIT-BYTE SEGMENT 15) (EMIT-BYTE SEGMENT 40)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 102)
+                         (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 41)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVAPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 15)
+                       (EMIT-BYTE SEGMENT 40)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 41)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVD
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 102)
+                       (EMIT-BYTE SEGMENT 15) (EMIT-BYTE SEGMENT 110)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 102)
+                         (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 126)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVDQA
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 102)
+                       (EMIT-BYTE SEGMENT 15) (EMIT-BYTE SEGMENT 111)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 102)
+                         (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 127)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVDQU
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 243)
+                       (EMIT-BYTE SEGMENT 15) (EMIT-BYTE SEGMENT 111)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 243)
+                         (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 127)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVHPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 102)
+                       (EMIT-BYTE SEGMENT 15) (EMIT-BYTE SEGMENT 22)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 102)
+                         (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 23)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVHPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 15)
+                       (EMIT-BYTE SEGMENT 22)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 23)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVLPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 102)
+                       (EMIT-BYTE SEGMENT 15) (EMIT-BYTE SEGMENT 18)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 102)
+                         (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 19)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVLPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 15)
+                       (EMIT-BYTE SEGMENT 18)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 19)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVQ
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 243)
+                       (EMIT-BYTE SEGMENT 15) (EMIT-BYTE SEGMENT 126)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 102)
+                         (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 214)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVSD
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 242)
+                       (EMIT-BYTE SEGMENT 15) (EMIT-BYTE SEGMENT 16)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 242)
+                         (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 17)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVSS
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 243)
+                       (EMIT-BYTE SEGMENT 15) (EMIT-BYTE SEGMENT 16)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 243)
+                         (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 17)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVUPD
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 102)
+                       (EMIT-BYTE SEGMENT 15) (EMIT-BYTE SEGMENT 16)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 102)
+                         (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 17)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION MOVUPS
+                    (SEGMENT DST SRC)
+                    (:EMITTER
+                     (COND
+                      ((XMM-REGISTER-P DST) (EMIT-BYTE SEGMENT 15)
+                       (EMIT-BYTE SEGMENT 16)
+                       (EMIT-EA SEGMENT SRC (REG-TN-ENCODING DST)))
+                      (T (EMIT-BYTE SEGMENT 15)
+                         (EMIT-BYTE SEGMENT 17)
+                         (EMIT-EA SEGMENT DST (REG-TN-ENCODING SRC))))))
+
+(DEFINE-INSTRUCTION PSLLD-IB
+                    (SEGMENT DST AMOUNT)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 114)
+                              (EMIT-EA SEGMENT DST 6)
+                              (EMIT-BYTE SEGMENT AMOUNT)))
+
+(DEFINE-INSTRUCTION PSLLDQ-IB
+                    (SEGMENT DST AMOUNT)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 115)
+                              (EMIT-EA SEGMENT DST 7)
+                              (EMIT-BYTE SEGMENT AMOUNT)))
+
+(DEFINE-INSTRUCTION PSLLQ-IB
+                    (SEGMENT DST AMOUNT)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 115)
+                              (EMIT-EA SEGMENT DST 6)
+                              (EMIT-BYTE SEGMENT AMOUNT)))
+
+(DEFINE-INSTRUCTION PSLLW-IB
+                    (SEGMENT DST AMOUNT)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 113)
+                              (EMIT-EA SEGMENT DST 6)
+                              (EMIT-BYTE SEGMENT AMOUNT)))
+
+(DEFINE-INSTRUCTION PSRAD-IB
+                    (SEGMENT DST AMOUNT)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 114)
+                              (EMIT-EA SEGMENT DST 4)
+                              (EMIT-BYTE SEGMENT AMOUNT)))
+
+(DEFINE-INSTRUCTION PSRAW-IB
+                    (SEGMENT DST AMOUNT)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 113)
+                              (EMIT-EA SEGMENT DST 4)
+                              (EMIT-BYTE SEGMENT AMOUNT)))
+
+(DEFINE-INSTRUCTION PSRLD-IB
+                    (SEGMENT DST AMOUNT)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 114)
+                              (EMIT-EA SEGMENT DST 2)
+                              (EMIT-BYTE SEGMENT AMOUNT)))
+
+(DEFINE-INSTRUCTION PSRLDQ-IB
+                    (SEGMENT DST AMOUNT)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 115)
+                              (EMIT-EA SEGMENT DST 3)
+                              (EMIT-BYTE SEGMENT AMOUNT)))
+
+(DEFINE-INSTRUCTION PSRLQ-IB
+                    (SEGMENT DST AMOUNT)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 115)
+                              (EMIT-EA SEGMENT DST 2)
+                              (EMIT-BYTE SEGMENT AMOUNT)))
+
+(DEFINE-INSTRUCTION PSRLW-IB
+                    (SEGMENT DST AMOUNT)
+                    (:EMITTER (EMIT-BYTE SEGMENT 102)
+                              (EMIT-BYTE SEGMENT 15)
+                              (EMIT-BYTE SEGMENT 113)
+                              (EMIT-EA SEGMENT DST 2)
+                              (EMIT-BYTE SEGMENT AMOUNT)))
+
+
+
+;;; CPUID
+
+
+(define-instruction cpuid (segment)
+  (:emitter
+   (emit-byte segment #x0F)
+   (emit-byte segment #xA2)))
+
+
+
+
 ;;;; fp instructions
 ;;;;
 ;;;; FIXME: This section said "added by jrd", which should end up in CREDITS.
index 3af49f2..61a762c 100644 (file)
@@ -21,7 +21,8 @@
   (defvar *byte-register-names* (make-array 8 :initial-element nil))
   (defvar *word-register-names* (make-array 16 :initial-element nil))
   (defvar *dword-register-names* (make-array 16 :initial-element nil))
-  (defvar *float-register-names* (make-array 8 :initial-element nil)))
+  (defvar *float-register-names* (make-array 8 :initial-element nil))
+  (defvar *xmmword-register-names* (make-array 8 :initial-element nil)))
 
 (macrolet ((defreg (name offset size)
              (let ((offset-sym (symbolicate name "-OFFSET"))
   (defreg fr7 7 :float)
   (defregset *float-regs* fr0 fr1 fr2 fr3 fr4 fr5 fr6 fr7)
 
+  ;; sse registers
+  (defreg xmm0 0 :xmmword)
+  (defreg xmm1 1 :xmmword)
+  (defreg xmm2 2 :xmmword)
+  (defreg xmm3 3 :xmmword)
+  (defreg xmm4 4 :xmmword)
+  (defreg xmm5 5 :xmmword)
+  (defreg xmm6 6 :xmmword)
+  (defreg xmm7 7 :xmmword)
+  (defregset *xmm-regs* xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7)
+  
   ;; registers used to pass arguments
   ;;
   ;; the number of arguments/return values passed in registers
 ;;; the new way:
 (define-storage-base float-registers :finite :size 8)
 
+(define-storage-base xmm-registers :finite :size 8)
+
 (define-storage-base stack :unbounded :size 8)
 (define-storage-base constant :non-packed)
 (define-storage-base immediate-constant :non-packed)
   (sap-stack stack)                     ; System area pointers.
   (single-stack stack)                  ; single-floats
   (double-stack stack :element-size 2)  ; double-floats.
+  (xmm-stack stack :element-size 4)  ; xmm
   #!+long-float
   (long-stack stack :element-size 3)    ; long-floats.
   (complex-single-stack stack :element-size 2)  ; complex-single-floats
               :save-p t
               :alternate-scs (double-stack))
 
+  ;; non-descriptor XMMs
+  (xmm-reg xmm-registers
+          :locations #.*xmm-regs*
+          :save-p t
+          :alternate-scs (xmm-stack))
+
   ;; non-descriptor LONG-FLOATs
   #!+long-float
   (long-reg float-registers
 ;;; These are used to (at least) determine operand size.
 (defparameter *float-sc-names* '(single-reg))
 (defparameter *double-sc-names* '(double-reg double-stack))
+(defparameter *xmmword-sc-names* '(xmm-reg))
 ) ; EVAL-WHEN
 \f
 ;;;; miscellaneous TNs for the various registers
   (def-misc-reg-tns unsigned-reg eax ebx ecx edx ebp esp edi esi)
   (def-misc-reg-tns word-reg ax bx cx dx bp sp di si)
   (def-misc-reg-tns byte-reg al ah bl bh cl ch dl dh)
-  (def-misc-reg-tns single-reg fr0 fr1 fr2 fr3 fr4 fr5 fr6 fr7))
+  (def-misc-reg-tns single-reg fr0 fr1 fr2 fr3 fr4 fr5 fr6 fr7)
+  (def-misc-reg-tns xmm-reg xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7))
 
 ;;; TNs for registers used to pass arguments
 (defparameter *register-arg-tns*
              ;; FIXME: Shouldn't this be an ERROR?
              (format nil "<unknown reg: off=~W, sc=~A>" offset sc-name))))
       (float-registers (format nil "FR~D" offset))
+      (xmm-registers (format nil "XMM~D" offset))
       (stack (format nil "S~D" offset))
       (constant (format nil "Const~D" offset))
       (immediate-constant "Immed")