• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
        • Specification
        • Executable
          • Decoding-left-inverse
          • Decoding-executable
            • Decodex
            • Get-fields-rtype
            • Get-fields-stype
            • Get-fields-itype
            • Get-fields-btype
            • Get-imm-jtype
            • Get-imm-btype
            • Get-imm-utype
            • Get-fields-utype
            • Get-imm-stype
            • Get-imm-itype
            • Get-fields-jtype
            • Get-rs2
            • Get-rs1
              • Get-rd
              • Get-opcode
              • Get-funct7
              • Get-funct3
            • Decoding-right-inverse
            • Execution-executable
            • Decoding-correct
          • Specialized
        • Bitcoin
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Decoding-executable

    Get-rs1

    Retrieve the rs1 field of an instruction.

    Signature
    (get-rs1 enc) → rs1
    Arguments
    enc — Guard (ubyte32p enc).
    Returns
    rs1 — Type (ubyte5p rs1).

    This is always in the bits 15-19 of the 32-bit encoding, for the formats with an rs1 field [ISA:2.2] [ISA:2.3].

    Definitions and Theorems

    Function: get-rs1

    (defun get-rs1 (enc)
      (declare (xargs :guard (ubyte32p enc)))
      (let ((__function__ 'get-rs1))
        (declare (ignorable __function__))
        (part-select enc :low 15 :high 19)))

    Theorem: ubyte5p-of-get-rs1

    (defthm ubyte5p-of-get-rs1
      (b* ((rs1 (get-rs1 enc))) (ubyte5p rs1))
      :rule-classes :rewrite)