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