• 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
          • Semantics
          • Features
          • States
          • 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
              • Branch-funct
              • Op-imms-funct
              • Instr-validp
              • Store-funct
              • Op-imms-32-funct
              • Instr-option
              • Op-imm-32-funct
            • Encoding
            • Reads-over-writes
            • Execution
            • Decoding
          • Executable
          • 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
    • 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)))))