Skip to content

Commit

Permalink
target/m68k: Use tcg_gen_deposit_i32 in gen_partset_reg
Browse files Browse the repository at this point in the history
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Aug 24, 2023
1 parent e79f814 commit 64919f7
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions target/m68k/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 64919f7

Please sign in to comment.