[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 05/10] target/tricore: Fix RRPW_DEXTR
From: |
Bastian Koppelmann |
Subject: |
[PATCH v2 05/10] target/tricore: Fix RRPW_DEXTR |
Date: |
Thu, 2 Feb 2023 13:04:27 +0100 |
if we used const16 == 0 we would crash qemu with the error:
../tcg/tcg-op.c:196: tcg_gen_shri_i32: Assertion `arg2 >= 0 && arg2 < 32' failed
This whole instruction can be handled by 'tcg_gen_extract2_tl' which
takes care of this special case as well.
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
v1 -> v2:
Use tcg_gen_extract2_tl and remove all special cases.
target/tricore/translate.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/target/tricore/translate.c b/target/tricore/translate.c
index 6149d4f5c0..3b4ec530b1 100644
--- a/target/tricore/translate.c
+++ b/target/tricore/translate.c
@@ -8706,15 +8706,9 @@ static void decode_32Bit_opc(DisasContext *ctx)
r2 = MASK_OP_RRPW_S2(ctx->opcode);
r3 = MASK_OP_RRPW_D(ctx->opcode);
const16 = MASK_OP_RRPW_POS(ctx->opcode);
- if (r1 == r2) {
- tcg_gen_rotli_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], const16);
- } else {
- temp = tcg_temp_new();
- tcg_gen_shli_tl(temp, cpu_gpr_d[r1], const16);
- tcg_gen_shri_tl(cpu_gpr_d[r3], cpu_gpr_d[r2], 32 - const16);
- tcg_gen_or_tl(cpu_gpr_d[r3], cpu_gpr_d[r3], temp);
- tcg_temp_free(temp);
- }
+
+ tcg_gen_extract2_tl(cpu_gpr_d[r3], cpu_gpr_d[r2], cpu_gpr_d[r1],
+ 32 - const16);
break;
/* RRR Format */
case OPCM_32_RRR_COND_SELECT:
--
2.39.1
- [PATCH v2 00/10] TriCore instruction bugfixes, Bastian Koppelmann, 2023/02/02
- [PATCH v2 08/10] tests/tcg/tricore: Add OPC2_32_RRRR_DEXTR tests, Bastian Koppelmann, 2023/02/02
- [PATCH v2 09/10] target/tricore: Fix OPC2_32_BO_LD_BU_PREINC, Bastian Koppelmann, 2023/02/02
- [PATCH v2 02/10] tests/tcg/tricore: Add test for OPC2_32_RCRW_IMASK, Bastian Koppelmann, 2023/02/02
- [PATCH v2 06/10] tests/tcg/tricore: Add tests for RRPW_DEXTR, Bastian Koppelmann, 2023/02/02
- [PATCH v2 05/10] target/tricore: Fix RRPW_DEXTR,
Bastian Koppelmann <=
- [PATCH v2 03/10] target/tricore: Fix OPC2_32_RCRW_INSERT translation, Bastian Koppelmann, 2023/02/02
- [PATCH v2 01/10] target/tricore: Fix OPC2_32_RCRW_IMASK translation, Bastian Koppelmann, 2023/02/02
- [PATCH v2 07/10] target/tricore: Fix OPC2_32_RRRR_DEXTR, Bastian Koppelmann, 2023/02/02
- [PATCH v2 04/10] tests/tcg/tricore: Add test for OPC2_32_RCRW_INSERT, Bastian Koppelmann, 2023/02/02
- [PATCH v2 10/10] tests/tcg/tricore: Add LD.BU tests, Bastian Koppelmann, 2023/02/02