diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-05-21 00:21:46 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-05-31 18:29:45 -0700 |
commit | bdcb5b297f9919bdd1a1b6031a3b5c469e982d14 (patch) | |
tree | a9c411e8bd1dba295217d8aa28f23b56d4f39313 /riscv/insns/c_lui.h | |
parent | 292fef830dad9d6d8b868ba27cf4ddd80bf9243a (diff) | |
download | spike-bdcb5b297f9919bdd1a1b6031a3b5c469e982d14.zip spike-bdcb5b297f9919bdd1a1b6031a3b5c469e982d14.tar.gz spike-bdcb5b297f9919bdd1a1b6031a3b5c469e982d14.tar.bz2 |
New RV64C proposal
Diffstat (limited to 'riscv/insns/c_lui.h')
-rw-r--r-- | riscv/insns/c_lui.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/riscv/insns/c_lui.h b/riscv/insns/c_lui.h index 4bd4f87..040d7ec 100644 --- a/riscv/insns/c_lui.h +++ b/riscv/insns/c_lui.h @@ -1,2 +1,9 @@ require_extension('C'); -WRITE_RD(insn.rvc_imm() << 12); +require(insn.rvc_rd() != 0); +if (insn.rvc_imm() == 0) { // c.jalr + reg_t tmp = npc; + set_pc(RVC_RS1 & ~reg_t(1)); + WRITE_REG(X_RA, tmp); +} else { + WRITE_RD(insn.rvc_imm() << 12); +} |