[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 35/38] target/m68k: Use tcg_gen_ext_i32
|
From: |
Richard Henderson |
|
Subject: |
[PULL v3 35/38] target/m68k: Use tcg_gen_ext_i32 |
|
Date: |
Mon, 23 Oct 2023 11:13:26 -0700 |
We still need to check OS_{BYTE,WORD,LONG},
because m68k includes floating point in OS_*.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/m68k/translate.c | 23 +++--------------------
1 file changed, 3 insertions(+), 20 deletions(-)
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 4d0110de95..4a0b0b2703 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -520,21 +520,9 @@ static inline void gen_ext(TCGv res, TCGv val, int opsize,
int sign)
{
switch (opsize) {
case OS_BYTE:
- if (sign) {
- tcg_gen_ext8s_i32(res, val);
- } else {
- tcg_gen_ext8u_i32(res, val);
- }
- break;
case OS_WORD:
- if (sign) {
- tcg_gen_ext16s_i32(res, val);
- } else {
- tcg_gen_ext16u_i32(res, val);
- }
- break;
case OS_LONG:
- tcg_gen_mov_i32(res, val);
+ tcg_gen_ext_i32(res, val, opsize | (sign ? MO_SIGN : 0));
break;
default:
g_assert_not_reached();
@@ -1072,15 +1060,10 @@ static int gen_ea_mode_fp(CPUM68KState *env,
DisasContext *s, int mode,
tmp = tcg_temp_new();
switch (opsize) {
case OS_BYTE:
- tcg_gen_ext8s_i32(tmp, reg);
- gen_helper_exts32(tcg_env, fp, tmp);
- break;
case OS_WORD:
- tcg_gen_ext16s_i32(tmp, reg);
- gen_helper_exts32(tcg_env, fp, tmp);
- break;
case OS_LONG:
- gen_helper_exts32(tcg_env, fp, reg);
+ tcg_gen_ext_i32(tmp, reg, opsize | MO_SIGN);
+ gen_helper_exts32(tcg_env, fp, tmp);
break;
case OS_SINGLE:
gen_helper_extf32(tcg_env, fp, reg);
--
2.34.1
- [PULL v3 29/38] target/i386: Use i128 for 128 and 256-bit loads and stores, (continued)
- [PULL v3 29/38] target/i386: Use i128 for 128 and 256-bit loads and stores, Richard Henderson, 2023/10/23
- [PULL v3 23/38] tcg/riscv: Use tcg_use_softmmu, Richard Henderson, 2023/10/23
- [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 <=
- [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, 2023/10/23
- Re: [PULL v3 00/38] tcg patch queue, Stefan Hajnoczi, 2023/10/23