• 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
              • Instr
                • Instrp
                • Instr-fix
                • Instr-case
                • Instr-store
                • Instr-op-imms64
                • Instr-op-imms32
                • Instr-op-imms-32
                • Instr-op-imm-32
                • Instr-op-imm
                • Instr-op-32
                • Instr-op
                  • Make-instr-op
                    • Instr-op->funct
                    • Instr-op->rs2
                    • Instr-op->rs1
                    • Instr-op->rd
                    • Change-instr-op
                  • Instr-load
                  • Instr-branch
                  • Instr-equiv
                  • Instr-jalr
                  • Instr-lui
                  • Instr-jal
                  • Instr-auipc
                  • Instr-kind
                • Op-funct
                • Op-32-funct
                • Op-imm-funct
                • Load-funct
                • Instr-validp
                • Branch-funct
                • Op-imms-funct
                • Store-funct
                • Op-imms-32-funct
                • Instr-option
                • Op-imm-32-funct
              • Encoding
              • 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
    • Instr-op

    Make-instr-op

    Basic constructor macro for instr-op structures.

    Syntax
    (make-instr-op [:funct <funct>] 
                   [:rd <rd>] 
                   [:rs1 <rs1>] 
                   [:rs2 <rs2>]) 
    

    This is the usual way to construct instr-op structures. It simply conses together a structure with the specified fields.

    This macro generates a new instr-op structure from scratch. See also change-instr-op, which can "change" an existing structure, instead.

    Definition

    This is an ordinary make- macro introduced by fty::defprod.

    Macro: make-instr-op

    (defmacro make-instr-op (&rest args)
      (std::make-aggregate 'instr-op
                           args '((:funct) (:rd) (:rs1) (:rs2))
                           'make-instr-op
                           nil))

    Function: instr-op

    (defun instr-op (funct rd rs1 rs2)
      (declare (xargs :guard (and (op-funct-p funct)
                                  (ubyte5p rd)
                                  (ubyte5p rs1)
                                  (ubyte5p rs2))))
      (declare (xargs :guard t))
      (let ((__function__ 'instr-op))
        (declare (ignorable __function__))
        (b* ((funct (mbe :logic (op-funct-fix funct)
                         :exec funct))
             (rd (mbe :logic (ubyte5-fix rd) :exec rd))
             (rs1 (mbe :logic (ubyte5-fix rs1) :exec rs1))
             (rs2 (mbe :logic (ubyte5-fix rs2)
                       :exec rs2)))
          (cons :op (list funct rd rs1 rs2)))))