• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • 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
          • Register-readers-and-writers
            • Zmms-reads-and-writes
            • Gprs-reads-and-writes
              • Wr08
              • Wr16
              • Rr08
              • Wr32
              • !rgfi-size
                • Rgfi-size
                • Rr64
                • Wr64
                • Rr32
                • Rr16
              • Mmx-registers-reads-and-writes
              • Xmms-reads-and-writes
              • Rflags-reads-and-writes
              • Gpr-indices
              • Vex-vvvv-reg-index
              • Msr-reads-and-writes
              • Ctr-reads-and-writes
            • 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
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Gprs-reads-and-writes

    !rgfi-size

    Write to byte, word, doubleword, or quadword general-purpose register

    Signature
    (!rgfi-size nbytes index val rex x86) → x86
    Returns
    x86 — Type (x86p x86), given (x86p x86).

    Definitions and Theorems

    Function: !rgfi-size$inline

    (defun !rgfi-size$inline (nbytes index val rex x86)
     (declare (xargs :stobjs (x86)))
     (declare (type (unsigned-byte 4) nbytes)
              (type (unsigned-byte 4) index)
              (type integer val)
              (type (unsigned-byte 8) rex))
     (declare (xargs :guard (and (reg-indexp index rex)
                                 (member nbytes '(1 2 4 8))
                                 (unsigned-byte-p (ash nbytes 3) val))))
     (case nbytes
       (1 (wr08 index rex val x86))
       (2 (wr16 index val x86))
       (4 (wr32 index val x86))
       (8 (wr64 index val x86))
       (otherwise x86)))

    Theorem: x86p-of-!rgfi-size

    (defthm x86p-of-!rgfi-size
      (implies (x86p x86)
               (b* ((x86 (!rgfi-size$inline nbytes index val rex x86)))
                 (x86p x86)))
      :rule-classes :rewrite)