On 12/23/21 7:49 PM, liweiwei wrote:
static bool trans_fsgnj_d(DisasContext *ctx, arg_fsgnj_d *a) { + REQUIRE_FPU; + REQUIRE_ZDINX_OR_D(ctx); + + TCGv_i64 dest = dest_fpr(ctx, a->rd); + TCGv_i64 src1 = get_fpr_d(ctx, a->rs1); + TCGv_i64 src2 = get_fpr_d(ctx, a->rs2); + if (a->rs1 == a->rs2) { /* FMOV */
Applies to the F version as well, but we should not assemble src2 when we don't need it.
- tcg_gen_mov_i64(cpu_fpr[a->rd], cpu_fpr[a->rs1]); + tcg_gen_mov_i64(dest, src1);
I think this can just be dest = get_fpr_d(ctx, a->src1), leaving the final "move" to gen_set_fpr_d.
r~