diff mbox series

[for-8.2] target/m68k: Use tcg_gen_deposit_i32 in gen_partset_reg

Message ID 20230813155425.341598-1-richard.henderson@linaro.org
State Superseded
Headers show
Series [for-8.2] target/m68k: Use tcg_gen_deposit_i32 in gen_partset_reg | expand

Commit Message

Richard Henderson Aug. 13, 2023, 3:54 p.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/m68k/translate.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Philippe Mathieu-Daudé Aug. 16, 2023, 9:45 a.m. UTC | #1
On 13/8/23 17:54, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/m68k/translate.c | 11 ++---------
>   1 file changed, 2 insertions(+), 9 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Richard Henderson Aug. 22, 2023, 6:15 p.m. UTC | #2
On 8/16/23 02:45, Philippe Mathieu-Daudé wrote:
> On 13/8/23 17:54, Richard Henderson wrote:
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>   target/m68k/translate.c | 11 ++---------
>>   1 file changed, 2 insertions(+), 9 deletions(-)
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> 
> 

Queued to tcg-next.


r~
diff mbox series

Patch

diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 37954d11a6..15b3701b8f 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -697,19 +697,12 @@  static inline int ext_opsize(int ext, int pos)
  */
 static void gen_partset_reg(int opsize, TCGv reg, TCGv val)
 {
-    TCGv tmp;
     switch (opsize) {
     case OS_BYTE:
-        tcg_gen_andi_i32(reg, reg, 0xffffff00);
-        tmp = tcg_temp_new();
-        tcg_gen_ext8u_i32(tmp, val);
-        tcg_gen_or_i32(reg, reg, tmp);
+        tcg_gen_deposit_i32(reg, reg, val, 0, 8);
         break;
     case OS_WORD:
-        tcg_gen_andi_i32(reg, reg, 0xffff0000);
-        tmp = tcg_temp_new();
-        tcg_gen_ext16u_i32(tmp, val);
-        tcg_gen_or_i32(reg, reg, tmp);
+        tcg_gen_deposit_i32(reg, reg, val, 0, 16);
         break;
     case OS_LONG:
     case OS_SINGLE: