[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5] riscv: Add support for the Zfa extension

From: Richard Henderson
Subject: Re: [PATCH v5] riscv: Add support for the Zfa extension
Date: Fri, 30 Jun 2023 15:50:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 6/30/23 13:52, Christoph Muellner wrote:
+bool trans_fmvp_d_x(DisasContext *ctx, arg_fmvp_d_x *a)
+    REQUIRE_ZFA(ctx);
+    REQUIRE_EXT(ctx, RVD);
+    REQUIRE_32BIT(ctx);
+    TCGv src1 = get_gpr(ctx, a->rs1, EXT_ZERO);
+    TCGv src2 = get_gpr(ctx, a->rs2, EXT_ZERO);
+    TCGv_i64 t1 = tcg_temp_new_i64();
+    TCGv_i64 t2 = tcg_temp_new_i64();
+    tcg_gen_ext_tl_i64(t1, src1);
+    tcg_gen_ext_tl_i64(t2, src2);
+    tcg_gen_shli_i64(t2, t2, 32);
+    tcg_gen_or_i64(t2, t2, t1);
+    tcg_gen_mov_i64(cpu_fpr[a->rd], t2);

This isn't right, because tcg_gen_ext_tl_i64 does signed extension.

But this whole operation is

    tcg_gen_concat_tl_i64(cpu_fpr[a->rd], src1, src2);

(which isn't a great name, but chosen long ago).

You can also use EXT_NONE, since we'll be discarding the upper bits.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]