qemu-riscv
[Top][All Lists]
Advanced

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

Re: [PATCH v1 3/3] target/riscv: Regen floating point rounding mode in d


From: Richard Henderson
Subject: Re: [PATCH v1 3/3] target/riscv: Regen floating point rounding mode in dynamic mode
Date: Tue, 30 Jun 2020 14:51:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

On 6/30/20 1:12 PM, Alistair Francis wrote:
> When a guest specificies the the rounding mode should be dynamic 0b111
> then we want to re-caclulate the rounding mode on each instruction. The
> gen_helper_set_rounding_mode() function will correctly check the
> rounding mode and handle a dynamic rounding, we just need to make sure
> it's always called if dynamic rounding is selected.
> 
> Fixes: 1885350 ("RISCV dynamic rounding mode is not behaving correctly")
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  target/riscv/translate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/riscv/translate.c b/target/riscv/translate.c
> index ce71ca7a92..a39eba679a 100644
> --- a/target/riscv/translate.c
> +++ b/target/riscv/translate.c
> @@ -490,7 +490,7 @@ static void gen_set_rm(DisasContext *ctx, int rm)
>  {
>      TCGv_i32 t0;
>  
> -    if (ctx->frm == rm) {
> +    if (ctx->frm == rm && rm != 7) {
>          return;

This should not be necessary.

It was my understanding that after the set to the csr, that we would end the
TB.  That's certainly what I see in RISCV_OP_CSR_POST.

The next TB will begin wiht ctx->frm = -1, so we will reset the rounding mode
with 7.  It would be good to understand what's really going on here.


r~



reply via email to

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