Basic constructor macro for instr-op structures.
(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.
This is an ordinary
Macro:
(defmacro make-instr-op (&rest args) (std::make-aggregate 'instr-op args '((:funct) (:rd) (:rs1) (:rs2)) 'make-instr-op nil))
Function:
(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)))))