• 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
                • Instr-load
                • Instr-branch
                  • Make-instr-branch
                    • Instr-branch->funct
                    • Instr-branch->rs2
                    • Instr-branch->rs1
                    • Instr-branch->imm
                    • Change-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-branch

    Make-instr-branch

    Basic constructor macro for instr-branch structures.

    Syntax
    (make-instr-branch [:funct <funct>] 
                       [:rs1 <rs1>] 
                       [:rs2 <rs2>] 
                       [:imm <imm>]) 
    

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

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

    Definition

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

    Macro: make-instr-branch

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

    Function: instr-branch

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