[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 30/62] target/riscv: Update fp_status when float rounding
From: |
Richard Henderson |
Subject: |
Re: [PATCH v8 30/62] target/riscv: Update fp_status when float rounding mode changes |
Date: |
Tue, 2 Jun 2020 21:27:51 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
On 5/21/20 2:43 AM, LIU Zhiwei wrote:
> @@ -174,6 +175,9 @@ static int write_frm(CPURISCVState *env, int csrno,
> target_ulong val)
> env->mstatus |= MSTATUS_FS;
> #endif
> env->frm = val & (FSR_RD >> FSR_RD_SHIFT);
> + if (!riscv_cpu_set_rounding_mode(env, env->frm)) {
> + return -1;
> + }
This will raise an exception immediately in helper_csrrw().
According to Section 8.2, the no exception should occur until the next fp
operation that uses the invalid frm.
You're doing this just fine in helper_set_rounding_mode(), which is sufficient
for scalar fp ops. Without looking forward to later patches, I suppose we'll
need to do something else for vector fp ops.
r~
- Re: [PATCH v8 30/62] target/riscv: Update fp_status when float rounding mode changes,
Richard Henderson <=