• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • 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
              • Sar-spec
              • Shr-spec
              • Sal/shl-spec
              • Rol-spec
              • Ror-spec
              • Rcl-spec
              • Rcr-spec
              • Simd-sub-spec
              • Simd-add-spec
              • Imul-spec
              • Mul-spec
              • Idiv-spec
              • Div-spec
              • Shrd-spec
                • Shrd-spec-64
                • Shrd-spec-32
                • Shrd-spec-16
              • Shld-spec
              • Gpr-arith/logic-spec
              • Shrx-spec
              • Shlx-spec
              • Sarx-spec
              • Floating-point-specifications
            • X86-illegal-instruction
            • Implemented-opcodes
            • Opcode-maps
            • 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
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Bigmems
      • Builtins
      • Execloader
      • Aleo
      • Solidity
      • Paco
      • Concurrent-programs
      • Bls12-377-curves
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Instruction-semantic-functions

Shrd-spec

Specification for the SHRD instruction.

Signature
(shrd-spec size dst src cnt input-rflags) → (mv * * * *)

Definitions and Theorems

Function: shrd-spec$inline

(defun shrd-spec$inline (size dst src cnt input-rflags)
  (declare (type (member 2 4 8) size)
           (type (unsigned-byte 32) input-rflags))
  (declare (xargs :guard (and (unsigned-byte-p 6 cnt)
                              (case size
                                (2 (and (n16p dst) (n16p src)))
                                (4 (and (n32p dst) (n32p src)))
                                (8 (and (n64p dst) (n64p src)))
                                (otherwise nil)))))
  (case size
    (2 (shrd-spec-16 dst src cnt input-rflags))
    (4 (shrd-spec-32 dst src cnt input-rflags))
    (8 (shrd-spec-64 dst src cnt input-rflags))
    (otherwise (mv 0 nil 0 0))))

Theorem: natp-mv-nth-0-shrd-spec

(defthm natp-mv-nth-0-shrd-spec
  (natp (mv-nth 0
                (shrd-spec size dst src cnt input-rflags)))
  :rule-classes :type-prescription)

Theorem: booleanp-of-mv-nth-1-shrd-spec

(defthm booleanp-of-mv-nth-1-shrd-spec
  (booleanp (mv-nth 1
                    (shrd-spec size dst src cnt input-rflags))))

Theorem: n32p-mv-nth-2-shrd-spec

(defthm n32p-mv-nth-2-shrd-spec
 (unsigned-byte-p
      32
      (mv-nth 2
              (shrd-spec size dst src cnt input-rflags)))
 :rule-classes
 (:rewrite
  (:type-prescription
      :corollary
      (natp (mv-nth 2
                    (shrd-spec size dst src cnt input-rflags)))
      :hints
      (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp))))
  (:linear
   :corollary
   (and (<= 0
            (mv-nth 2
                    (shrd-spec size dst src cnt input-rflags)))
        (< (mv-nth 2
                   (shrd-spec size dst src cnt input-rflags))
           4294967296))
   :hints
   (("Goal"
        :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))

Theorem: n32p-mv-nth-3-shrd-spec

(defthm n32p-mv-nth-3-shrd-spec
 (unsigned-byte-p
      32
      (mv-nth 3
              (shrd-spec size dst src cnt input-rflags)))
 :rule-classes
 (:rewrite
  (:type-prescription
      :corollary
      (natp (mv-nth 3
                    (shrd-spec size dst src cnt input-rflags)))
      :hints
      (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp))))
  (:linear
   :corollary
   (and (<= 0
            (mv-nth 3
                    (shrd-spec size dst src cnt input-rflags)))
        (< (mv-nth 3
                   (shrd-spec size dst src cnt input-rflags))
           4294967296))
   :hints
   (("Goal"
        :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))

Subtopics

Shrd-spec-64
Shrd-spec-32
Shrd-spec-16