[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 10/12] target/mips: Simplify decode_opc_mxu() ifdef'ry
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v4 10/12] target/mips: Simplify decode_opc_mxu() ifdef'ry |
Date: |
Wed, 24 Feb 2021 19:57:04 +0100 |
By making the prototype public and checking
'TARGET_LONG_BITS == 32' we let the compiler
elide the decode_opc_mxu() call.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/translate.h | 3 +++
target/mips/translate.c | 6 ++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/target/mips/translate.h b/target/mips/translate.h
index 468e29d7578..a5c49f1ee22 100644
--- a/target/mips/translate.h
+++ b/target/mips/translate.h
@@ -178,6 +178,9 @@ extern TCGv bcond;
/* MSA */
void msa_translate_init(void);
+/* MXU */
+bool decode_ase_mxu(DisasContext *ctx, uint32_t insn);
+
/* decodetree generated */
bool decode_isa_rel6(DisasContext *ctx, uint32_t insn);
bool decode_ase_msa(DisasContext *ctx, uint32_t insn);
diff --git a/target/mips/translate.c b/target/mips/translate.c
index f25b1fe4d8f..84948ab9ce0 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -25779,7 +25779,7 @@ static void decode_opc_mxu__pool19(DisasContext *ctx)
/*
* Main MXU decoding function
*/
-static bool decode_ase_mxu(DisasContext *ctx, uint32_t insn)
+bool decode_ase_mxu(DisasContext *ctx, uint32_t insn)
{
uint32_t opcode = extract32(insn, 0, 6);
@@ -26981,8 +26981,7 @@ static bool decode_opc_legacy(CPUMIPSState *env,
DisasContext *ctx)
break;
}
#endif
-#if !defined(TARGET_MIPS64)
- if (ctx->insn_flags & ASE_MXU) {
+ if (TARGET_LONG_BITS == 32 && (ctx->insn_flags & ASE_MXU)) {
if (MASK_SPECIAL2(ctx->opcode) == OPC_MUL) {
gen_arith(ctx, OPC_MUL, rd, rs, rt);
} else {
@@ -26990,7 +26989,6 @@ static bool decode_opc_legacy(CPUMIPSState *env,
DisasContext *ctx)
}
break;
}
-#endif
decode_opc_special2_legacy(env, ctx);
break;
case OPC_SPECIAL3:
--
2.26.2
- Re: [PATCH v4 02/12] target/mips/meson: Restrict mips-semi.c to TCG, (continued)
- [PATCH v4 03/12] target/mips: Rewrite complex ifdef'ry, Philippe Mathieu-Daudé, 2021/02/24
- [PATCH v4 04/12] target/mips: Remove XBurst Media eXtension Unit dead code, Philippe Mathieu-Daudé, 2021/02/24
- [PATCH v4 05/12] target/mips: Remove unused CPUMIPSState* from MXU functions, Philippe Mathieu-Daudé, 2021/02/24
- [PATCH v4 06/12] target/mips: Pass instruction opcode to decode_opc_mxu(), Philippe Mathieu-Daudé, 2021/02/24
- [PATCH v4 07/12] target/mips: Use OPC_MUL instead of OPC__MXU_MUL, Philippe Mathieu-Daudé, 2021/02/24
- [PATCH v4 08/12] target/mips: Move MUL opcode check from decode_mxu() to decode_legacy(), Philippe Mathieu-Daudé, 2021/02/24
- [PATCH v4 09/12] target/mips: Convert decode_opc_mxu() to decodetree prototype, Philippe Mathieu-Daudé, 2021/02/24
- [PATCH v4 10/12] target/mips: Simplify decode_opc_mxu() ifdef'ry,
Philippe Mathieu-Daudé <=
- [PATCH v4 11/12] target/mips: Introduce mxu_translate_init() helper, Philippe Mathieu-Daudé, 2021/02/24
- [PATCH v4 12/12] target/mips: Extract MXU code to new mxu_translate.c file, Philippe Mathieu-Daudé, 2021/02/24