Skip to content

Commit

Permalink
target/hppa: Implement PERMH
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Nov 7, 2023
1 parent c2a7ee3 commit 4e7abdb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions target/hppa/insns.decode
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ mixh_r 111110 ..... ..... 1 10 00100000 ..... @rrr
mixw_l 111110 ..... ..... 1 00 00000000 ..... @rrr
mixw_r 111110 ..... ..... 1 10 00000000 ..... @rrr

permh 111110 r1:5 r2:5 0 c0:2 0 c1:2 c2:2 c3:2 0 t:5

####
# Index Mem
####
Expand Down
29 changes: 29 additions & 0 deletions target/hppa/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2946,6 +2946,35 @@ static bool trans_mixw_r(DisasContext *ctx, arg_rrr *a)
return do_multimedia(ctx, a, gen_mixw_r);
}

static bool trans_permh(DisasContext *ctx, arg_permh *a)
{
TCGv_i64 r, t0, t1, t2, t3;

if (!ctx->is_pa20) {
return false;
}

nullify_over(ctx);

r = load_gpr(ctx, a->r1);
t0 = tcg_temp_new_i64();
t1 = tcg_temp_new_i64();
t2 = tcg_temp_new_i64();
t3 = tcg_temp_new_i64();

tcg_gen_extract_i64(t0, r, (3 - a->c0) * 16, 16);
tcg_gen_extract_i64(t1, r, (3 - a->c1) * 16, 16);
tcg_gen_extract_i64(t2, r, (3 - a->c2) * 16, 16);
tcg_gen_extract_i64(t3, r, (3 - a->c3) * 16, 16);

tcg_gen_deposit_i64(t0, t1, t0, 16, 48);
tcg_gen_deposit_i64(t2, t3, t2, 16, 48);
tcg_gen_deposit_i64(t0, t2, t0, 32, 32);

save_gpr(ctx, a->t, t0);
return nullify_end(ctx);
}

static bool trans_ld(DisasContext *ctx, arg_ldst *a)
{
if (!ctx->is_pa20 && a->size > MO_32) {
Expand Down

0 comments on commit 4e7abdb

Please sign in to comment.