« Previous | Next » 

Revision e3d142d0

IDe3d142d073d02f0a3a4aad79eb838c15b6f99c01

Added by Peter Maydell over 11 years ago

fpu: Correct edgecase in float64_muladd

In handling float64_muladd, if we end up doing a subtraction of the
product and c, and the 128 bit result of this subtraction happens to
have its most significant bit in bit 63, we weren't handling this
correctly when attempting to normalize to put the most significant
bit into bit 126. We would end up doing a right shift by a negative
number (undefined behaviour in C) so at best we would return an
incorrect result to the guest. MSB in bit 63 has to be handled as a
special case separately from MSB in 0..62 and MSB in 63..126. (MSB
in 127 is not possible.)

Signed-off-by: Peter Maydell <>
Reviewed-by: Aurelien Jarno <>
Signed-off-by: Aurelien Jarno <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences