Skip to content

Commit

Permalink
target/hppa: Fix extrw and depw with sar for hppa64
Browse files Browse the repository at this point in the history
These are 32-bit operations regardless of processor.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Nov 7, 2023
1 parent 1e9ab9f commit d781cb7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions target/hppa/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -3230,7 +3230,9 @@ static bool trans_extrw_sar(DisasContext *ctx, arg_extrw_sar *a)
tmp = tcg_temp_new();

/* Recall that SAR is using big-endian bit numbering. */
tcg_gen_xori_reg(tmp, cpu_sar, TARGET_REGISTER_BITS - 1);
tcg_gen_andi_reg(tmp, cpu_sar, 31);
tcg_gen_xori_reg(tmp, tmp, 31);

if (a->se) {
tcg_gen_sar_reg(dest, src, tmp);
tcg_gen_sextract_reg(dest, dest, 0, len);
Expand Down Expand Up @@ -3355,7 +3357,8 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c,
tmp = tcg_temp_new();

/* Convert big-endian bit numbering in SAR to left-shift. */
tcg_gen_xori_reg(shift, cpu_sar, TARGET_REGISTER_BITS - 1);
tcg_gen_andi_reg(shift, cpu_sar, 31);
tcg_gen_xori_reg(shift, shift, 31);

mask = tcg_temp_new();
tcg_gen_movi_reg(mask, msb + (msb - 1));
Expand Down

0 comments on commit d781cb7

Please sign in to comment.