FPU: Clear FPSCR[FR,FI] on overflow in convert-to-integer instructions

Also simplify INT_CHECK state by going to INT_OFLOW on overflow.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
pull/457/head
Paul Mackerras 2 weeks ago
parent 37edba4da7
commit 9f27f60b26

@ -2377,26 +2377,22 @@ begin
else else
msb := r.r(63); msb := r.r(63);
end if; end if;
opsel_r <= RES_MISC;
misc_sel <= "110";
if (r.insn(8) = '0' and msb /= r.result_sign) or if (r.insn(8) = '0' and msb /= r.result_sign) or
(r.insn(8) = '1' and msb /= '1') then (r.insn(8) = '1' and msb /= '1') then
set_r := '1'; v.state := INT_OFLOW;
v.fpscr(FPSCR_VXCVI) := '1';
invalid := '1';
else else
set_r := '0';
if r.fpscr(FPSCR_FI) = '1' then if r.fpscr(FPSCR_FI) = '1' then
v.fpscr(FPSCR_XX) := '1'; v.fpscr(FPSCR_XX) := '1';
end if; end if;
end if;
arith_done := '1'; arith_done := '1';
end if;


when INT_OFLOW => when INT_OFLOW =>
opsel_r <= RES_MISC; opsel_r <= RES_MISC;
misc_sel <= "110"; misc_sel <= "110";
set_r := '1'; set_r := '1';
v.fpscr(FPSCR_VXCVI) := '1'; v.fpscr(FPSCR_VXCVI) := '1';
v.fpscr(FPSCR_FR downto FPSCR_FI) := "00";
invalid := '1'; invalid := '1';
arith_done := '1'; arith_done := '1';



Loading…
Cancel
Save