[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v11 14/26] target/loongarch: Add floating point load/store in
From: |
Richard Henderson |
Subject: |
Re: [PATCH v11 14/26] target/loongarch: Add floating point load/store instruction translation |
Date: |
Sat, 20 Nov 2021 10:36:43 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
On 11/19/21 7:13 AM, Song Gao wrote:
+static bool gen_fload_imm(DisasContext *ctx, arg_fr_i *a,
+ MemOp mop, bool nanbox)
Don't pass nanbox, as it can be determined from mop.
I think you should split out
static void maybe_nanbox_load(TCGv freg, MemOp mop)
{
if ((mop & MO_SIZE) == MO_32) {
gen_nanbox_s(freg, freg);
}
}
for use in the 4 different fload functions.
+static bool gen_fstore_imm(DisasContext *ctx, arg_fr_i *a,
+ MemOp mop, bool nanbox)
Don't pass nanbox, because it's useless for stores.
+ if (nanbox) {
+ gen_nanbox_s(cpu_fpr[a->fd], cpu_fpr[a->fd]);
+ }
(1) nanboxing not needed for store,
(2) incorrect to modify fd.
+static bool gen_fload_tl(DisasContext *ctx, arg_frr *a,
+ MemOp mop, bool nanbox)
Similarly.
Since the integer version is called gen_loadx, should this one be called
gen_floadx?
+static bool gen_fstore_tl(DisasContext *ctx, arg_frr *a,
+ MemOp mop, bool nanbox)
...
+static bool gen_fload_gt(DisasContext *ctx, arg_frr *a,
+ MemOp mop, bool nanbox)
...
+static bool gen_fstore_gt(DisasContext *ctx, arg_frr *a,
+ MemOp mop, bool nanbox)
...
+static bool gen_fload_le(DisasContext *ctx, arg_frr *a,
+ MemOp mop, bool nanbox)
...
+static bool gen_fstore_le(DisasContext *ctx, arg_frr *a,
+ MemOp mop, bool nanbox)
Simiarly.
+TRANS(fld_s, gen_fload_imm, MO_TESL, true)
Use TEUL for everything here, because you don't need sign extension.
r~
- Re: [PATCH v11 07/26] target/loongarch: Add fixed point load/store instruction translation, (continued)
- [PATCH v11 02/26] target/loongarch: Add core definition, Song Gao, 2021/11/19
- [PATCH v11 03/26] target/loongarch: Add main translation routines, Song Gao, 2021/11/19
- [PATCH v11 11/26] target/loongarch: Add floating point comparison instruction translation, Song Gao, 2021/11/19
- [PATCH v11 10/26] target/loongarch: Add floating point arithmetic instruction translation, Song Gao, 2021/11/19
- [PATCH v11 13/26] target/loongarch: Add floating point move instruction translation, Song Gao, 2021/11/19
- [PATCH v11 14/26] target/loongarch: Add floating point load/store instruction translation, Song Gao, 2021/11/19
- Re: [PATCH v11 14/26] target/loongarch: Add floating point load/store instruction translation,
Richard Henderson <=
- [PATCH v11 15/26] target/loongarch: Add branch instruction translation, Song Gao, 2021/11/19
- [PATCH v11 20/26] linux-user: Add LoongArch elf support, Song Gao, 2021/11/19
- [PATCH v11 19/26] linux-user: Add LoongArch signal support, Song Gao, 2021/11/19