[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 37/38] target/tricore: Use tcg_gen_*extract_tl
|
From: |
Richard Henderson |
|
Subject: |
[PULL v3 37/38] target/tricore: Use tcg_gen_*extract_tl |
|
Date: |
Mon, 23 Oct 2023 11:13:28 -0700 |
The EXTR instructions can use the extract opcodes.
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/tricore/translate.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/target/tricore/translate.c b/target/tricore/translate.c
index dd812ec0f0..66553d1be0 100644
--- a/target/tricore/translate.c
+++ b/target/tricore/translate.c
@@ -6542,28 +6542,16 @@ static void decode_rrpw_extract_insert(DisasContext
*ctx)
switch (op2) {
case OPC2_32_RRPW_EXTR:
if (width == 0) {
- tcg_gen_movi_tl(cpu_gpr_d[r3], 0);
- break;
- }
-
- if (pos + width <= 32) {
- /* optimize special cases */
- if ((pos == 0) && (width == 8)) {
- tcg_gen_ext8s_tl(cpu_gpr_d[r3], cpu_gpr_d[r1]);
- } else if ((pos == 0) && (width == 16)) {
- tcg_gen_ext16s_tl(cpu_gpr_d[r3], cpu_gpr_d[r1]);
- } else {
- tcg_gen_shli_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], 32 - pos -
width);
- tcg_gen_sari_tl(cpu_gpr_d[r3], cpu_gpr_d[r3], 32 - width);
- }
+ tcg_gen_movi_tl(cpu_gpr_d[r3], 0);
+ } else if (pos + width <= 32) {
+ tcg_gen_sextract_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], pos, width);
}
break;
case OPC2_32_RRPW_EXTR_U:
if (width == 0) {
tcg_gen_movi_tl(cpu_gpr_d[r3], 0);
} else {
- tcg_gen_shri_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], pos);
- tcg_gen_andi_tl(cpu_gpr_d[r3], cpu_gpr_d[r3], ~0u >> (32-width));
+ tcg_gen_extract_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], pos, width);
}
break;
case OPC2_32_RRPW_IMASK:
--
2.34.1
- [PULL v3 24/38] tcg/s390x: Use tcg_use_softmmu, (continued)
- [PULL v3 24/38] tcg/s390x: Use tcg_use_softmmu, Richard Henderson, 2023/10/23
- [PULL v3 31/38] tcg: Export tcg_gen_ext_{i32,i64,tl}, Richard Henderson, 2023/10/23
- [PULL v3 32/38] tcg: Define MO_TL, Richard Henderson, 2023/10/23
- [PULL v3 34/38] target/i386: Use tcg_gen_ext_tl, Richard Henderson, 2023/10/23
- [PULL v3 33/38] target/arm: Use tcg_gen_ext_i64, Richard Henderson, 2023/10/23
- [PULL v3 25/38] tcg: drop unused tcg_temp_free define, Richard Henderson, 2023/10/23
- [PULL v3 26/38] tcg: Use constant zero when expanding with divu2, Richard Henderson, 2023/10/23
- [PULL v3 30/38] tcg: add negsetcondi, Richard Henderson, 2023/10/23
- [PULL v3 35/38] target/m68k: Use tcg_gen_ext_i32, Richard Henderson, 2023/10/23
- [PULL v3 36/38] target/rx: Use tcg_gen_ext_i32, Richard Henderson, 2023/10/23
- [PULL v3 37/38] target/tricore: Use tcg_gen_*extract_tl,
Richard Henderson <=
- [PULL v3 38/38] target/xtensa: Use tcg_gen_sextract_i32, Richard Henderson, 2023/10/23
- Re: [PULL v3 00/38] tcg patch queue, Stefan Hajnoczi, 2023/10/23