summaryrefslogtreecommitdiffstats
path: root/target/riscv/insn_trans
diff options
context:
space:
mode:
authorBastian Koppelmann2019-02-13 16:53:46 +0100
committerBastian Koppelmann2019-03-13 10:34:06 +0100
commit0c865e856a7e97d37c4dea4cf2ff875faa6e72ed (patch)
treeb727e2842ad61f385bae791cda0cd7694e9d4684 /target/riscv/insn_trans
parenttarget/riscv: Convert RVXI arithmetic insns to decodetree (diff)
downloadqemu-0c865e856a7e97d37c4dea4cf2ff875faa6e72ed.tar.gz
qemu-0c865e856a7e97d37c4dea4cf2ff875faa6e72ed.tar.xz
qemu-0c865e856a7e97d37c4dea4cf2ff875faa6e72ed.zip
target/riscv: Convert RVXI fence insns to decodetree
Acked-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Peer Adelt <peer.adelt@hni.uni-paderborn.de>
Diffstat (limited to 'target/riscv/insn_trans')
-rw-r--r--target/riscv/insn_trans/trans_rvi.inc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/target/riscv/insn_trans/trans_rvi.inc.c b/target/riscv/insn_trans/trans_rvi.inc.c
index 136fa54d06..973d6371df 100644
--- a/target/riscv/insn_trans/trans_rvi.inc.c
+++ b/target/riscv/insn_trans/trans_rvi.inc.c
@@ -318,3 +318,22 @@ static bool trans_sraw(DisasContext *ctx, arg_sraw *a)
return true;
}
#endif
+
+static bool trans_fence(DisasContext *ctx, arg_fence *a)
+{
+ /* FENCE is a full memory barrier. */
+ tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
+ return true;
+}
+
+static bool trans_fence_i(DisasContext *ctx, arg_fence_i *a)
+{
+ /*
+ * FENCE_I is a no-op in QEMU,
+ * however we need to end the translation block
+ */
+ tcg_gen_movi_tl(cpu_pc, ctx->pc_succ_insn);
+ tcg_gen_exit_tb(NULL, 0);
+ ctx->base.is_jmp = DISAS_NORETURN;
+ return true;
+}