• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • 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
        • Implemented-opcodes
        • To-do
        • Proof-utilities
        • Peripherals
        • Model-validation
        • Modelcalls
        • Concrete-simulation-examples
        • Utils
          • Structures
            • Rflagsbits
            • Cr4bits
            • Xcr0bits
            • Cr0bits
              • Cr0bits-p
              • !cr0bits->res3
              • !cr0bits->res1
              • !cr0bits->res2
                • !cr0bits->nw
                • !cr0bits->wp
                • !cr0bits->ts
                • !cr0bits->pg
                • !cr0bits->pe
                • !cr0bits->ne
                • !cr0bits->mp
                • !cr0bits->et
                • !cr0bits->em
                • !cr0bits->cd
                • !cr0bits->am
                • Cr0bits->res3
                • Cr0bits->res2
                • Cr0bits->res1
                • Cr0bits-fix
                • Cr0bits->wp
                • Cr0bits->ts
                • Cr0bits->pg
                • Cr0bits->nw
                • Cr0bits->ne
                • Cr0bits->mp
                • Cr0bits->et
                • Cr0bits->em
                • Cr0bits->cd
                • Cr0bits->am
                • Cr0bits->pe
              • Prefixes
              • Ia32_eferbits
              • Evex-byte1
              • Cr3bits
              • Evex-byte3
              • Vex3-byte2
              • Vex3-byte1
              • Vex2-byte1
              • Evex-prefixes
              • Evex-byte2
              • Vex-prefixes
              • Sib
              • Modr/m-structures
              • Vex-prefixes-layout-structures
              • Sib-structures
              • Legacy-prefixes-layout-structure
              • Evex-prefixes-layout-structures
              • Cr8bits
              • Opcode-maps-structures
              • Segmentation-bitstructs
              • 8bits
              • 2bits
              • 4bits
              • 16bits
              • Paging-bitstructs
              • 3bits
              • 11bits
              • 40bits
              • 5bits
              • 32bits
              • 19bits
              • 10bits
              • 7bits
              • 64bits
              • 54bits
              • 45bits
              • 36bits
              • 31bits
              • 24bits
              • 22bits
              • 17bits
              • 13bits
              • 12bits
              • 6bits
              • Vex->x
              • Vex->b
              • Vex-prefixes-map-p
              • Vex-prefixes-byte0-p
              • Vex->w
              • Vex->vvvv
              • Vex->r
              • Fp-bitstructs
              • Cr4bits-debug
              • Vex->pp
              • Vex->l
              • Rflagsbits-debug
              • Evex->v-prime
              • Evex->z
              • Evex->w
              • Evex->vvvv
              • Evex->vl/rc
              • Evex->pp
              • Evex->aaa
              • Xcr0bits-debug
              • Vex3-byte1-equiv-under-mask
              • Vex3-byte2-equiv-under-mask
              • Vex2-byte1-equiv-under-mask
              • Vex-prefixes-equiv-under-mask
              • Rflagsbits-equiv-under-mask
              • Ia32_eferbits-equiv-under-mask
              • Evex-prefixes-equiv-under-mask
              • Evex-byte3-equiv-under-mask
              • Evex-byte2-equiv-under-mask
              • Evex-byte1-equiv-under-mask
              • Cr0bits-debug
              • Xcr0bits-equiv-under-mask
              • Sib-equiv-under-mask
              • Prefixes-equiv-under-mask
              • Cr8bits-equiv-under-mask
              • Cr4bits-equiv-under-mask
              • Cr3bits-equiv-under-mask
              • Cr0bits-equiv-under-mask
              • Vex3-byte1-debug
              • Prefixes-debug
              • Ia32_eferbits-debug
              • Evex-byte1-debug
              • Vex3-byte2-debug
              • Vex2-byte1-debug
              • Vex-prefixes-debug
              • Evex-prefixes-debug
              • Evex-byte3-debug
              • Evex-byte2-debug
              • Cr3bits-debug
              • Sib-debug
              • Cr8bits-debug
            • Utilities
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Cr0bits

    !cr0bits->res2

    Update the |X86ISA|::|RES2| field of a cr0bits bit structure.

    Signature
    (!cr0bits->res2 res2 x) → new-x
    Arguments
    res2 — Guard (bitp res2).
    x — Guard (cr0bits-p x).
    Returns
    new-x — Type (cr0bits-p new-x).

    Definitions and Theorems

    Function: !cr0bits->res2$inline

    (defun !cr0bits->res2$inline (res2 x)
     (declare (xargs :guard (and (bitp res2) (cr0bits-p x))))
     (mbe
        :logic
        (b* ((res2 (mbe :logic (bfix res2) :exec res2))
             (x (cr0bits-fix x)))
          (part-install res2 x :width 1 :low 17))
        :exec (the (unsigned-byte 32)
                   (logior (the (unsigned-byte 32)
                                (logand (the (unsigned-byte 32) x)
                                        (the (signed-byte 19) -131073)))
                           (the (unsigned-byte 18)
                                (ash (the (unsigned-byte 1) res2)
                                     17))))))

    Theorem: cr0bits-p-of-!cr0bits->res2

    (defthm cr0bits-p-of-!cr0bits->res2
      (b* ((new-x (!cr0bits->res2$inline res2 x)))
        (cr0bits-p new-x))
      :rule-classes :rewrite)

    Theorem: !cr0bits->res2$inline-of-bfix-res2

    (defthm !cr0bits->res2$inline-of-bfix-res2
      (equal (!cr0bits->res2$inline (bfix res2) x)
             (!cr0bits->res2$inline res2 x)))

    Theorem: !cr0bits->res2$inline-bit-equiv-congruence-on-res2

    (defthm !cr0bits->res2$inline-bit-equiv-congruence-on-res2
      (implies (bit-equiv res2 res2-equiv)
               (equal (!cr0bits->res2$inline res2 x)
                      (!cr0bits->res2$inline res2-equiv x)))
      :rule-classes :congruence)

    Theorem: !cr0bits->res2$inline-of-cr0bits-fix-x

    (defthm !cr0bits->res2$inline-of-cr0bits-fix-x
      (equal (!cr0bits->res2$inline res2 (cr0bits-fix x))
             (!cr0bits->res2$inline res2 x)))

    Theorem: !cr0bits->res2$inline-cr0bits-equiv-congruence-on-x

    (defthm !cr0bits->res2$inline-cr0bits-equiv-congruence-on-x
      (implies (cr0bits-equiv x x-equiv)
               (equal (!cr0bits->res2$inline res2 x)
                      (!cr0bits->res2$inline res2 x-equiv)))
      :rule-classes :congruence)

    Theorem: !cr0bits->res2-is-cr0bits

    (defthm !cr0bits->res2-is-cr0bits
      (equal (!cr0bits->res2 res2 x)
             (change-cr0bits x :res2 res2)))

    Theorem: cr0bits->res2-of-!cr0bits->res2

    (defthm cr0bits->res2-of-!cr0bits->res2
      (b* ((?new-x (!cr0bits->res2$inline res2 x)))
        (equal (cr0bits->res2 new-x)
               (bfix res2))))

    Theorem: !cr0bits->res2-equiv-under-mask

    (defthm !cr0bits->res2-equiv-under-mask
      (b* ((?new-x (!cr0bits->res2$inline res2 x)))
        (cr0bits-equiv-under-mask new-x x -131073)))