summary refs log tree commit diff stats
path: root/hw/core/qdev-properties-system.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-01-06 11:47:21 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-01-07 19:18:07 +0000
commit1bf6beec8a012cae4bb6fbc89c465127e9650c92 (patch)
treee3a514353a37001c81d2b7c4498f67886d3dff4d /hw/core/qdev-properties-system.c
parente3d8cc0536699b66f58b0e3a13a70ee007f61647 (diff)
downloadfocaccia-qemu-1bf6beec8a012cae4bb6fbc89c465127e9650c92.tar.gz
focaccia-qemu-1bf6beec8a012cae4bb6fbc89c465127e9650c92.zip
softfloat: Fix exception flag handling for float32_to_float16()
Our float32 to float16 conversion routine was generating the correct
numerical answers, but not always setting the right set of exception
flags. Fix this, mostly by rearranging the code to more closely
resemble RoundAndPackFloat*, and in particular:
 * non-IEEE halfprec always raises Invalid for input NaNs
 * we need to check for the overflow case before underflow
 * we weren't getting the tininess-detected-after-rounding
   case correct (somewhat academic since only ARM uses halfprec
   and it is always tininess-detected-before-rounding)
 * non-IEEE halfprec overflow raises only Invalid, not
   Invalid + Inexact
 * we weren't setting Inexact when we should

Also add some clarifying comments about what the code is doing.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'hw/core/qdev-properties-system.c')
0 files changed, 0 insertions, 0 deletions