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