[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] RISC-V: fcvt can set fflags, so set FS accordingly
From: |
Richard Henderson |
Subject: |
Re: [PATCH] RISC-V: fcvt can set fflags, so set FS accordingly |
Date: |
Wed, 9 Oct 2019 18:26:15 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 10/9/19 5:15 PM, Palmer Dabbelt wrote:
> A user pinged me to say "my floating point heavy code works in user mode
> but not system mode", which I'm guessing is the result of a lazy FP
> save/restore issue as those still crop up from time to time as long tail
> bugs. I figured it was worth giving the FP stuff a look to see if
> anything jumps out, and it turns out that there is a bug: converting
> float to integer can set the invalid flag, which is supposed to mark FS
> as dirty, but the emulation routine doesn't do so.
>
> This patch unconditionally marks FS as dirty for fcvt instructions that
> convert into X registers (fcvt into F registers already did so). I
> haven't actually tried to manifest a bug here, but as far as I can tell
> the soft float stuff does set the invalid flag.
>
> Signed-off-by: Palmer Dabbelt <address@hidden>
> ---
> target/riscv/insn_trans/trans_rvd.inc.c | 2 ++
> target/riscv/insn_trans/trans_rvf.inc.c | 4 ++++
> 2 files changed, 6 insertions(+)
Reviewed-by: Richard Henderson <address@hidden>
r~