• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • X86isa-state
          • Syscalls
          • Cpuid
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • App-view
          • Top-level-memory
          • X86-decoder
            • Get-prefixes
            • Vex-0f3a-execute
            • Vex-0f38-execute
            • Vex-0f-execute
            • Two-byte-opcode-execute
            • Second-three-byte-opcode-execute
              • One-byte-opcode-execute
              • First-three-byte-opcode-execute
              • Evex-0f3a-execute
              • Evex-0f38-execute
              • Evex-0f-execute
              • X86-fetch-decode-execute
              • Vex-decode-and-execute
              • Evex-decode-and-execute
              • X86-run
              • Implemented-opcodes
              • Three-byte-opcode-decode-and-execute
              • X86-run-halt-count
              • Two-byte-opcode-decode-and-execute
              • X86-run-steps
              • Opcode-maps
              • X86-run-halt
              • X86-fetch-decode-execute-halt
              • X86-run-steps1
            • Physical-memory
            • Decoding-and-spec-utils
            • Instructions
            • Register-readers-and-writers
            • X86-modes
            • Segmentation
            • Other-non-deterministic-computations
            • Environment
            • Paging
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • X86-decoder

    Second-three-byte-opcode-execute

    Second three-byte opcode dispatch function.

    Signature
    (second-three-byte-opcode-execute proc-mode start-rip 
                                      temp-rip prefixes mandatory-prefix 
                                      rex-byte opcode modr/m sib x86) 
     
      → 
    x86

    second-three-byte-opcode-execute is the doorway to the second three-byte opcode map, i.e., to all three-byte opcodes whose second two opcode bytes are 0F 3A.

    Definitions and Theorems

    Function: second-three-byte-opcode-execute

    (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))
     (declare (xargs :guard (rip-guard-okp proc-mode temp-rip)))
     (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
                        (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 (:avx2)))))
                    (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))))
      (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
                        (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 (:avx2)))))
                    (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))))
      (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: x86p-second-three-byte-opcode-execute

    (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))))