qemu-ppc
[Top][All Lists]
Advanced

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

Re: [PATCH 03/33] target/ppc: Move load and store floating point instruc


From: Richard Henderson
Subject: Re: [PATCH 03/33] target/ppc: Move load and store floating point instructions to decodetree
Date: Fri, 22 Oct 2021 15:19:56 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 10/21/21 12:45 PM, matheus.ferst@eldorado.org.br wrote:
+/*            Floating-point Load/Store Instructions                         */
+static bool do_lsfpsd(DisasContext *ctx, int rt, int ra, TCGv displ,
+                      bool update, bool store, bool single)
+{
+    TCGv ea;
+    TCGv_i64 t0;
+    REQUIRE_INSNS_FLAGS(ctx, FLOAT);
+    REQUIRE_FPU(ctx);
+    if (update && ra == 0) {
+        gen_invalid(ctx);
+        return true;
+    }
+    gen_set_access_type(ctx, ACCESS_FLOAT);
+    t0 = tcg_temp_new_i64();
+    ea = tcg_temp_new();
+    do_ea_calc(ctx, ra, displ, ea);
+    if (store) {
+        get_fpr(t0, rt);
+        single ? gen_qemu_st32fs(ctx, t0, ea) : gen_qemu_st64_i64(ctx, t0, ea);
+    } else {
+        single ? gen_qemu_ld32fs(ctx, t0, ea) : gen_qemu_ld64_i64(ctx, t0, ea);
+        set_fpr(rt, t0);
+    }

Not thrilled about the top-level ?: expression. I mean, it works, but surely an if statement is clearer.

Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

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