From f888300b818a46bb1b339d68d6748bc097396a7b Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 17 Oct 2011 17:32:26 -0700 Subject: target-sparc: Implement PDIST. Signed-off-by: Richard Henderson --- target-sparc/translate.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'target-sparc/translate.c') diff --git a/target-sparc/translate.c b/target-sparc/translate.c index 0b9ace323e..2646aaf1db 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -1738,6 +1738,21 @@ static inline void gen_ne_fop_DDD(DisasContext *dc, int rd, int rs1, int rs2, gen_store_fpr_D(dc, rd, dst); } + +static inline void gen_ne_fop_DDDD(DisasContext *dc, int rd, int rs1, int rs2, + void (*gen)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64)) +{ + TCGv_i64 dst, src0, src1, src2; + + src1 = gen_load_fpr_D(dc, rs1); + src2 = gen_load_fpr_D(dc, rs2); + src0 = gen_load_fpr_D(dc, rd); + dst = gen_dest_fpr_D(); + + gen(dst, src0, src1, src2); + + gen_store_fpr_D(dc, rd, dst); +} #endif static inline void gen_fop_QQ(DisasContext *dc, int rd, int rs, @@ -4059,9 +4074,11 @@ static void disas_sparc_insn(DisasContext * dc) case 0x03a: /* VIS I fpack32 */ case 0x03b: /* VIS I fpack16 */ case 0x03d: /* VIS I fpackfix */ - case 0x03e: /* VIS I pdist */ - // XXX goto illegal_insn; + case 0x03e: /* VIS I pdist */ + CHECK_FPU_FEATURE(dc, VIS1); + gen_ne_fop_DDDD(dc, rd, rs1, rs2, gen_helper_pdist); + break; case 0x048: /* VIS I faligndata */ CHECK_FPU_FEATURE(dc, VIS1); cpu_src1_64 = gen_load_fpr_D(dc, rs1); -- cgit v1.2.3