Basic constructor macro for instr-op-imm-32 structures.
(make-instr-op-imm-32 [:funct <funct>]
[:rd <rd>]
[:rs1 <rs1>]
[:imm <imm>])
This is the usual way to construct instr-op-imm-32 structures. It simply conses together a structure with the specified fields.
This macro generates a new instr-op-imm-32 structure from scratch. See also change-instr-op-imm-32, which can "change" an existing structure, instead.
This is an ordinary
Macro:
(defmacro make-instr-op-imm-32 (&rest args) (std::make-aggregate 'instr-op-imm-32 args '((:funct) (:rd) (:rs1) (:imm)) 'make-instr-op-imm-32 nil))
Function:
(defun instr-op-imm-32 (funct rd rs1 imm) (declare (xargs :guard (and (op-imm-32-funct-p funct) (ubyte5p rd) (ubyte5p rs1) (ubyte12p imm)))) (declare (xargs :guard t)) (b* ((funct (mbe :logic (op-imm-32-funct-fix funct) :exec funct)) (rd (mbe :logic (ubyte5-fix rd) :exec rd)) (rs1 (mbe :logic (ubyte5-fix rs1) :exec rs1)) (imm (mbe :logic (ubyte12-fix imm) :exec imm))) (cons :op-imm-32 (list funct rd rs1 imm))))