c.li
Load the sign-extended 6-bit immediate
This instruction is defined by:
Synopsis
C.LI loads the sign-extended 6-bit immediate, imm, into register rd.
C.LI expands into addi rd, x0, imm
.
C.LI is only valid when rd ≠ x0; the code points with rd=x0 encode HINTs.
Execution
-
Pruned, XLEN == 64
-
Original
if ((%%LINK%csr_field;misa.C;CSR[misa].C%% == 1'b0)) {
%%LINK%func;raise;raise%%(ExceptionCode::IllegalInstruction, %%LINK%func;mode;mode%%(), $encoding);
}
X[rd] = $signed(imm);
if (%%LINK%func;implemented?;implemented?%%(ExtensionName::C) && (%%LINK%csr_field;misa.C;CSR[misa].C%% == 1'b0)) {
%%LINK%func;raise;raise%%(ExceptionCode::IllegalInstruction, %%LINK%func;mode;mode%%(), $encoding);
}
X[rd] = $signed(imm);