• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • 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
            • Optimized
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Decoding-executable

    Get-rd

    Retrieve the rd field of an instruction.

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

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

    Definitions and Theorems

    Function: get-rd

    (defun get-rd (enc)
      (declare (xargs :guard (ubyte32p enc)))
      (let ((__function__ 'get-rd))
        (declare (ignorable __function__))
        (part-select enc :low 7 :high 11)))

    Theorem: ubyte5p-of-get-rd

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