• 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
            • Semantics
            • Features
            • Instructions
            • Encoding
              • Encode
              • Encoding-decoding-illustration
              • Encoding-validp
              • Encode-load-funct
              • Encode-store-funct
                • Encode-op-imms-32-funct
                • Encode-op-funct
                • Encode-op-32-funct
                • Encode-op-imms64-funct
                • Encode-op-imms32-funct
                • Encode-op-imm-funct
                • Encode-op-imm-32-funct
                • Encode-branch-funct
              • States
              • Reads-over-writes
              • Semantics-equivalences
              • Decoding
              • Execution
            • Executable
            • 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
    • Encoding

    Encode-store-funct

    Encode the name of an instruction with the STORE opcode into the funct3 field [ISA:2.6] [ISA:4.3] [ISA:35].

    Signature
    (encode-store-funct funct feat) → funct3
    Arguments
    funct — Guard (store-funct-p funct).
    feat — Guard (featp feat).
    Returns
    funct3 — Type (ubyte3p funct3).

    Definitions and Theorems

    Function: encode-store-funct

    (defun encode-store-funct (funct feat)
      (declare (xargs :guard (and (store-funct-p funct)
                                  (featp feat))))
      (declare (xargs :guard (implies (store-funct-case funct :sd)
                                      (feat-64p feat))))
      (let ((__function__ 'encode-store-funct))
        (declare (ignorable __function__))
        (store-funct-case funct
                          :sb 0
                          :sh 1
                          :sw 2
                          :sd (assert$ (feat-64p feat) 3))))

    Theorem: ubyte3p-of-encode-store-funct

    (defthm ubyte3p-of-encode-store-funct
      (b* ((funct3 (encode-store-funct funct feat)))
        (ubyte3p funct3))
      :rule-classes :rewrite)

    Theorem: encode-store-funct-of-store-funct-fix-funct

    (defthm encode-store-funct-of-store-funct-fix-funct
      (equal (encode-store-funct (store-funct-fix funct)
                                 feat)
             (encode-store-funct funct feat)))

    Theorem: encode-store-funct-store-funct-equiv-congruence-on-funct

    (defthm encode-store-funct-store-funct-equiv-congruence-on-funct
      (implies (store-funct-equiv funct funct-equiv)
               (equal (encode-store-funct funct feat)
                      (encode-store-funct funct-equiv feat)))
      :rule-classes :congruence)

    Theorem: encode-store-funct-of-feat-fix-feat

    (defthm encode-store-funct-of-feat-fix-feat
      (equal (encode-store-funct funct (feat-fix feat))
             (encode-store-funct funct feat)))

    Theorem: encode-store-funct-feat-equiv-congruence-on-feat

    (defthm encode-store-funct-feat-equiv-congruence-on-feat
      (implies (feat-equiv feat feat-equiv)
               (equal (encode-store-funct funct feat)
                      (encode-store-funct funct feat-equiv)))
      :rule-classes :congruence)