target/riscv: add "set round to odd" rounding mode helper function

helper_set_rounding_mode() is responsible for SIGILL, and "round to odd"
should be an interface private to translation, so add a new independent
helper_set_rod_rounding_mode().

Signed-off-by: Frank Chang <frank.chang@sifive.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20211210075704.23951-64-frank.chang@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
Frank Chang 2021-12-10 15:56:49 +08:00 committed by Alistair Francis
parent 3ce4c09df7
commit 75804f7131
4 changed files with 14 additions and 0 deletions

View file

@ -30,6 +30,7 @@
#include "exec/log.h"
#include "instmap.h"
#include "internals.h"
/* global register indices */
static TCGv cpu_gpr[32], cpu_pc, cpu_vl;
@ -403,6 +404,12 @@ static void gen_set_rm(DisasContext *ctx, int rm)
return;
}
ctx->frm = rm;
if (rm == RISCV_FRM_ROD) {
gen_helper_set_rod_rounding_mode(cpu_env);
return;
}
gen_helper_set_rounding_mode(cpu_env, tcg_constant_i32(rm));
}