softfloat: Add round-to-odd rounding mode
authorBharata B Rao <bharata@linux.vnet.ibm.com>
Fri, 10 Feb 2017 07:23:05 +0000 (12:53 +0530)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 22 Feb 2017 00:28:28 +0000 (11:28 +1100)
commit9ee6f678f473007e252934d6acd09c24490d9d42
treeea047e7fd74f4518830d8bb3a456088dce977fea
parent5b929608b94fc3ee4104553f961b6b1fae3d7b88
softfloat: Add round-to-odd rounding mode

Power ISA 3.0 introduces a few quadruple precision floating point
instructions that support round-to-odd rounding mode. The
round-to-odd mode is explained as under:

Let Z be the intermediate arithmetic result or the operand of a convert
operation. If Z can be represented exactly in the target format, the
result is Z. Otherwise the result is either Z1 or Z2 whichever is odd.
Here Z1 and Z2 are the next larger and smaller numbers representable
in the target format respectively.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
fpu/softfloat.c
include/fpu/softfloat.h