aboutsummaryrefslogtreecommitdiff
path: root/target/riscv/insn_trans/trans_rvb.c.inc
diff options
context:
space:
mode:
authorKito Cheng <kito.cheng@sifive.com>2021-05-06 00:06:16 +0800
committerAlistair Francis <alistair.francis@wdc.com>2021-06-08 09:59:45 +1000
commit3a4a43e4e213a18d1ee4ed97090a5e86401c85bc (patch)
tree49772d3c0585632261e495a7bb054ab064781c0d /target/riscv/insn_trans/trans_rvb.c.inc
parent920a1f9955c528f2be3ff9c9e1cbf40ddad1b192 (diff)
target/riscv: rvb: add/shift with prefix zero-extend
Signed-off-by: Kito Cheng <kito.cheng@sifive.com> Signed-off-by: Frank Chang <frank.chang@sifive.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210505160620.15723-16-frank.chang@sifive.com Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target/riscv/insn_trans/trans_rvb.c.inc')
-rw-r--r--target/riscv/insn_trans/trans_rvb.c.inc26
1 files changed, 26 insertions, 0 deletions
diff --git a/target/riscv/insn_trans/trans_rvb.c.inc b/target/riscv/insn_trans/trans_rvb.c.inc
index b27114a068..9e81f6e3de 100644
--- a/target/riscv/insn_trans/trans_rvb.c.inc
+++ b/target/riscv/insn_trans/trans_rvb.c.inc
@@ -410,3 +410,29 @@ static bool trans_sh##SHAMT##add_uw(DisasContext *ctx, \
GEN_TRANS_SHADD_UW(1)
GEN_TRANS_SHADD_UW(2)
GEN_TRANS_SHADD_UW(3)
+
+static bool trans_add_uw(DisasContext *ctx, arg_add_uw *a)
+{
+ REQUIRE_64BIT(ctx);
+ REQUIRE_EXT(ctx, RVB);
+ return gen_arith(ctx, a, gen_add_uw);
+}
+
+static bool trans_slli_uw(DisasContext *ctx, arg_slli_uw *a)
+{
+ REQUIRE_64BIT(ctx);
+ REQUIRE_EXT(ctx, RVB);
+
+ TCGv source1 = tcg_temp_new();
+ gen_get_gpr(source1, a->rs1);
+
+ if (a->shamt < 32) {
+ tcg_gen_deposit_z_tl(source1, source1, a->shamt, 32);
+ } else {
+ tcg_gen_shli_tl(source1, source1, a->shamt);
+ }
+
+ gen_set_gpr(a->rd, source1);
+ tcg_temp_free(source1);
+ return true;
+}