Skip to content

Commit 09b340e

Browse files
committed
FPU: Update committed FPSCR value correctly
The committed FPSCR is updated in the cycle where an FPU instruction signals completion. Since we update the FPRF field in the FPSCR in that same cycle, the value put into r.comm_fpscr needs to include the new FPRF value. Otherwise, a subsequent flush (for example, due to the following instruction being an illegal instruction that has to be emulated) will drop the FPSCR update. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
1 parent 1ad8848 commit 09b340e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fpu.vhdl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,6 @@ begin
10771077
v.writing_fpr := '0';
10781078
v.writing_cr := '0';
10791079
v.writing_xer := '0';
1080-
v.comm_fpscr := r.fpscr;
10811080
v.illegal := '0';
10821081
end if;
10831082

@@ -3728,6 +3727,10 @@ begin
37283727
v.fpscr(FPSCR_FX) := '1';
37293728
end if;
37303729

3730+
if r.complete = '1' or r.do_intr = '1' then
3731+
v.comm_fpscr := v.fpscr;
3732+
end if;
3733+
37313734
if v.instr_done = '1' then
37323735
if r.state /= IDLE then
37333736
v.state := IDLE;

0 commit comments

Comments
 (0)