From 04100de18d4e48420808556750cfcd7dadd05b8d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 6 Oct 2018 17:07:16 +0100 Subject: [PATCH] allow x2 (sp) to be redirected in C.LWSP --- riscv/insn_template_sv.cc | 6 ++++-- riscv/sv_decode.h | 25 +++++++++++++------------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/riscv/insn_template_sv.cc b/riscv/insn_template_sv.cc index 9e27b80..cd63f07 100644 --- a/riscv/insn_template_sv.cc +++ b/riscv/insn_template_sv.cc @@ -30,6 +30,7 @@ reg_t FN(processor_t* p, insn_t s_insn, reg_t pc) bool zeroingsrc = false; #endif sv_insn_t insn(p, bits, floatintmap, PRED_ARGS, OFFS_ARGS); + reg_t sp = 0; if (vlen > 0) { fprintf(stderr, "pre-ex reg %s %x %ld rd %ld rs1 %ld rs2 %ld vlen %d\n", @@ -38,7 +39,8 @@ reg_t FN(processor_t* p, insn_t s_insn, reg_t pc) vlen); #ifdef INSN_CATEGORY_TWINPREDICATION #ifdef INSN_TYPE_C_STACK_LD - src_pred = insn.predicate(X_SP, SRC_PREDINT, zeroingsrc); + sp = insn._remap(X_SP, true, src_offs); + src_pred = insn.predicate(sp, SRC_PREDINT, zeroingsrc); #else src_pred = insn.predicate(s_insn.SRC_REG(), SRC_PREDINT, zeroingsrc); #endif @@ -110,7 +112,7 @@ reg_t FN(processor_t* p, insn_t s_insn, reg_t pc) xstr(INSN), INSNCODE, voffs, *src_offs, *dest_offs, vlen, insn.stop_vloop(), dest_pred & (1<