Second three-byte opcode dispatch function.
(second-three-byte-opcode-execute proc-mode start-rip temp-rip prefixes mandatory-prefix rex-byte opcode modr/m sib x86) → x86
Function:
(defun second-three-byte-opcode-execute (proc-mode start-rip temp-rip prefixes mandatory-prefix rex-byte opcode modr/m sib x86) (declare (xargs :stobjs (x86))) (declare (type (integer 0 4) proc-mode) (type (signed-byte 48) start-rip) (type (signed-byte 48) temp-rip) (type (unsigned-byte 52) prefixes) (type (unsigned-byte 8) mandatory-prefix) (type (unsigned-byte 8) rex-byte) (type (unsigned-byte 8) opcode) (type (unsigned-byte 8) modr/m) (type (unsigned-byte 8) sib)) (case opcode (8 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-2 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (9 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-2 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (10 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-3 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (11 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-3 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (12 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (13 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (14 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (15 (cond ((equal mandatory-prefix 0) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:ssse3))))) (or chk-ex (if (or (equal (feature-flags-macro '(:ssse3)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:ssse3))))) (or chk-ex (if (or (equal (feature-flags-macro '(:ssse3)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (20 (cond ((and (not (equal (modr/m->mod modr/m) 3)) (equal mandatory-prefix 102)) (let ((fault-var (let ((chk-ex (or (chk-exc :type-5 (:avx2))))) (or chk-ex nil)))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) ((and (equal (modr/m->mod modr/m) 3) (equal mandatory-prefix 102)) (let ((fault-var (let ((chk-ex (or (chk-exc :type-5 (:avx2))))) (or chk-ex nil)))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (21 (cond ((and (not (equal (modr/m->mod modr/m) 3)) (equal mandatory-prefix 102)) (let ((fault-var (let ((chk-ex (or (chk-exc :type-5 (:avx2))))) (or chk-ex nil)))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) ((and (equal (modr/m->mod modr/m) 3) (equal mandatory-prefix 102)) (let ((fault-var (let ((chk-ex (or (chk-exc :type-5 (:avx2))))) (or chk-ex nil)))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (22 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-5 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (23 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-5 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (32 (cond ((and (equal (modr/m->mod modr/m) 3) (equal mandatory-prefix 102)) (let ((fault-var (let ((chk-ex (or (chk-exc :type-5 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) ((and (not (equal (modr/m->mod modr/m) 3)) (equal mandatory-prefix 102)) (let ((fault-var (let ((chk-ex (or (chk-exc :type-5 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (33 (cond ((and (not (equal (modr/m->mod modr/m) 3)) (equal mandatory-prefix 102)) (let ((fault-var (let ((chk-ex (or (chk-exc :type-5 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) ((and (equal (modr/m->mod modr/m) 3) (equal mandatory-prefix 102)) (let ((fault-var (let ((chk-ex (or (chk-exc :type-5 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (34 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-5 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (64 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-2 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (65 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-2 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (66 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:sse4.1))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.1)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (68 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:pclmulqdq))))) (or chk-ex (if (or (equal (feature-flags-macro '(:pclmulqdq)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (96 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:sse4.2))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.2)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (97 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:sse4.2))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.2)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (98 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:sse4.2))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.2)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (99 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:sse4.2))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sse4.2)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (204 (cond ('t (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:sha))))) (or chk-ex (if (or (equal (feature-flags-macro '(:sha)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (223 (cond ((equal mandatory-prefix 102) (let ((fault-var (let ((chk-ex (or (chk-exc :type-4 (:aes))))) (or chk-ex (if (or (equal (feature-flags-macro '(:aes)) 0)) ':ud nil))))) (if fault-var (case fault-var (:ud (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)) (:gp (x86-general-protection "#GP Encountered!" start-rip temp-rip x86)) (:nm (x86-device-not-available "#NM Encountered!" start-rip temp-rip x86)) (t (x86-step-unimplemented "Unimplemented exception in x86isa!" x86))) (x86-step-unimplemented "Opcode Unimplemented in x86isa!" x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86)))) (t (x86-illegal-instruction "#UD Encountered!" start-rip temp-rip x86))))
Theorem:
(defthm x86p-second-three-byte-opcode-execute (implies (x86p x86) (x86p (second-three-byte-opcode-execute proc-mode start-rip temp-rip prefixes mandatory-prefix rex-byte opcode modr/m sib x86))))