diff options
author | Richard Henderson <rth@twiddle.net> | 2011-10-18 08:35:58 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2011-10-26 14:00:19 -0700 |
commit | add545ab11450c7049468fccdcd362b47740d9fe (patch) | |
tree | 66c307d6aed44f6fb9a88b2ac6c1bd3e02ef8c39 /target-sparc/translate.c | |
parent | 6c07355325b7622c595b961b53755ad5450db0c4 (diff) |
target-sparc: Implement ALIGNADDR* inline.
While ALIGNADDR was implemented out-of-line, ALIGNADDRL was not
implemeneted at all. However, this is a very simple operation
so we're better off doing this inline.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-sparc/translate.c')
-rw-r--r-- | target-sparc/translate.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/target-sparc/translate.c b/target-sparc/translate.c index d02cf06064..685a9070fe 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -2324,6 +2324,20 @@ static void gen_edge(DisasContext *dc, TCGv dst, TCGv s1, TCGv s2, tcg_temp_free(t1); tcg_temp_free(t2); } + +static void gen_alignaddr(TCGv dst, TCGv s1, TCGv s2, bool left) +{ + TCGv tmp = tcg_temp_new(); + + tcg_gen_add_tl(tmp, s1, s2); + tcg_gen_andi_tl(dst, tmp, -8); + if (left) { + tcg_gen_neg_tl(tmp, tmp); + } + tcg_gen_deposit_tl(cpu_gsr, cpu_gsr, tmp, 0, 3); + + tcg_temp_free(tmp); +} #endif #define CHECK_IU_FEATURE(dc, FEATURE) \ @@ -4167,11 +4181,17 @@ static void disas_sparc_insn(DisasContext * dc) CHECK_FPU_FEATURE(dc, VIS1); cpu_src1 = get_src1(insn, cpu_src1); gen_movl_reg_TN(rs2, cpu_src2); - gen_helper_alignaddr(cpu_dst, cpu_env, cpu_src1, cpu_src2); + gen_alignaddr(cpu_dst, cpu_src1, cpu_src2, 0); gen_movl_TN_reg(rd, cpu_dst); break; - case 0x019: /* VIS II bmask */ case 0x01a: /* VIS I alignaddrl */ + CHECK_FPU_FEATURE(dc, VIS1); + cpu_src1 = get_src1(insn, cpu_src1); + gen_movl_reg_TN(rs2, cpu_src2); + gen_alignaddr(cpu_dst, cpu_src1, cpu_src2, 1); + gen_movl_TN_reg(rd, cpu_dst); + break; + case 0x019: /* VIS II bmask */ // XXX goto illegal_insn; case 0x020: /* VIS I fcmple16 */ |