mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
RISC-V: Adding XTheadBa ISA extension
This patch adds support for the XTheadBa ISA extension. The patch uses the T-Head specific decoder and translation. Co-developed-by: Philipp Tomsich <philipp.tomsich@vrull.eu> Co-developed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu> Message-Id: <20230131202013.2541053-4-christoph.muellner@vrull.eu> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
134c3ffa34
commit
c9410a689f
5 changed files with 66 additions and 1 deletions
|
@ -16,6 +16,12 @@
|
|||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define REQUIRE_XTHEADBA(ctx) do { \
|
||||
if (!ctx->cfg_ptr->ext_xtheadba) { \
|
||||
return false; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define REQUIRE_XTHEADCMO(ctx) do { \
|
||||
if (!ctx->cfg_ptr->ext_xtheadcmo) { \
|
||||
return false; \
|
||||
|
@ -28,6 +34,39 @@
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
/* XTheadBa */
|
||||
|
||||
/*
|
||||
* th.addsl is similar to sh[123]add (from Zba), but not an
|
||||
* alternative encoding: while sh[123] applies the shift to rs1,
|
||||
* th.addsl shifts rs2.
|
||||
*/
|
||||
|
||||
#define GEN_TH_ADDSL(SHAMT) \
|
||||
static void gen_th_addsl##SHAMT(TCGv ret, TCGv arg1, TCGv arg2) \
|
||||
{ \
|
||||
TCGv t = tcg_temp_new(); \
|
||||
tcg_gen_shli_tl(t, arg2, SHAMT); \
|
||||
tcg_gen_add_tl(ret, t, arg1); \
|
||||
tcg_temp_free(t); \
|
||||
}
|
||||
|
||||
GEN_TH_ADDSL(1)
|
||||
GEN_TH_ADDSL(2)
|
||||
GEN_TH_ADDSL(3)
|
||||
|
||||
#define GEN_TRANS_TH_ADDSL(SHAMT) \
|
||||
static bool trans_th_addsl##SHAMT(DisasContext *ctx, \
|
||||
arg_th_addsl##SHAMT * a) \
|
||||
{ \
|
||||
REQUIRE_XTHEADBA(ctx); \
|
||||
return gen_arith(ctx, a, EXT_NONE, gen_th_addsl##SHAMT, NULL); \
|
||||
}
|
||||
|
||||
GEN_TRANS_TH_ADDSL(1)
|
||||
GEN_TRANS_TH_ADDSL(2)
|
||||
GEN_TRANS_TH_ADDSL(3)
|
||||
|
||||
/* XTheadCmo */
|
||||
|
||||
static inline int priv_level(DisasContext *ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue