• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • 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
          • Top-level-memory
          • App-view
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
          • Instructions
            • Two-byte-opcodes
            • One-byte-opcodes
            • Fp-opcodes
            • Instruction-semantic-functions
            • X86-illegal-instruction
            • Implemented-opcodes
            • Opcode-maps
              • Cpuid
              • Opcode-maps-structures
              • Implemented-opcodes
              • Chk-exc-fn
                • Filtering-instructions
                • Addressing-method-code-p
                • Operand-type-code-p
                • Eval-pre-map
              • X86-general-protection
              • X86-device-not-available
              • X86-step-unimplemented
              • Privileged-opcodes
              • Three-byte-opcodes
            • 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
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Quote
    • Opcode-maps

    Chk-exc-fn

    Signature
    (chk-exc-fn decode-context 
                type-id feature-flags proc-mode 
                prefixes rex-byte opcode modr/m sib x86) 
     
      → 
    *
    Arguments
    decode-context — Guard (symbolp decode-context).
    type-id — Guard (symbolp type-id).
    feature-flags — Guard (symbol-listp feature-flags).

    Definitions and Theorems

    Function: chk-exc-fn

    (defun chk-exc-fn
           (decode-context type-id feature-flags proc-mode
                           prefixes rex-byte opcode modr/m sib x86)
     (declare (xargs :stobjs (x86)))
     (declare (type (integer 0 4) proc-mode)
              (type (unsigned-byte 52) prefixes)
              (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 (and (symbolp decode-context)
                                 (symbolp type-id)
                                 (symbol-listp feature-flags))))
     (declare (ignore opcode modr/m sib))
     (declare
       (xargs
            :guard (and (member-eq decode-context '(:legacy :vex :evex))
                        (subsetp-equal feature-flags
                                       *supported-feature-flags*))))
     (let ((__function__ 'chk-exc-fn))
       (declare (ignorable __function__))
       (cond ((and (eq decode-context :vex)
                   (or (ud-reps-used)
                       (ud-opr-used)
                       (not (eql rex-byte 0))
                       (not (or (eql proc-mode 0)
                                (eql proc-mode 1)
                                (eql proc-mode 2)))))
              :ud)
             ((or (eq type-id :type-vex-gpr)
                  (eq type-id :type-13))
              (cond ((equal (feature-flags feature-flags) 0)
                     :ud)))
             ((equal (cr0bits->ts (cr0)) 1) :nm)
             ((and (not (member-eq type-id
                                   '(:type-22-7 :type-22-8 :type-22-9)))
                   (equal (cr4bits->osfxsr (cr4)) 0))
              :ud)
             ((or (equal (cr0bits->em (cr0)) 1)
                  (ud-lock-used)
                  (equal (feature-flags feature-flags) 0))
              :ud))))