Skip to contentSkip to conversation

alpha: fix conversion from denormal float to double

PATCH New Ivan Kokshaysky 1 participant 1 message Jan 16, 2008 Alpha port

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alpha: fix conversion from denormal float to double

The trap handler does properly update the fraction, but not the exponent...

Thanks to Paolo Bonzini <[email protected]> for the bug report and the testcase.

---
 arch/alpha/math-emu/math.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/alpha/math-emu/math.c +1 -1
index ae79dd9..58c2669 100644
@@ -225,7 +225,7 @@ alpha_fp_emul (unsigned long pc)
 				FP_UNPACK_SP(SB, &vb);
 				DR_c = DB_c;
 				DR_s = DB_s;
-				DR_e = DB_e;
+				DR_e = DB_e + (1024 - 128);
 				DR_f = SB_f << (52 - 23);
 				goto pack_d;
 			}