[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 38/38] target/xtensa: Use tcg_gen_sextract_i32
|
From: |
Richard Henderson |
|
Subject: |
[PULL v3 38/38] target/xtensa: Use tcg_gen_sextract_i32 |
|
Date: |
Mon, 23 Oct 2023 11:13:29 -0700 |
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/xtensa/translate.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 54bee7ddba..de89940599 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -2262,17 +2262,7 @@ static void translate_salt(DisasContext *dc, const
OpcodeArg arg[],
static void translate_sext(DisasContext *dc, const OpcodeArg arg[],
const uint32_t par[])
{
- int shift = 31 - arg[2].imm;
-
- if (shift == 24) {
- tcg_gen_ext8s_i32(arg[0].out, arg[1].in);
- } else if (shift == 16) {
- tcg_gen_ext16s_i32(arg[0].out, arg[1].in);
- } else {
- TCGv_i32 tmp = tcg_temp_new_i32();
- tcg_gen_shli_i32(tmp, arg[1].in, shift);
- tcg_gen_sari_i32(arg[0].out, tmp, shift);
- }
+ tcg_gen_sextract_i32(arg[0].out, arg[1].in, 0, arg[2].imm + 1);
}
static uint32_t test_exceptions_simcall(DisasContext *dc,
--
2.34.1
- [PULL v3 31/38] tcg: Export tcg_gen_ext_{i32,i64,tl}, (continued)
- [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, 2023/10/23
- [PULL v3 38/38] target/xtensa: Use tcg_gen_sextract_i32,
Richard Henderson <=
- Re: [PULL v3 00/38] tcg patch queue, Stefan Hajnoczi, 2023/10/23