Use hardfloat for float32_to_float64

-----BEGIN PGP SIGNATURE-----
 
 iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAl250RsdHHJpY2hhcmQu
 aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV983gf/dFKei3I6K77s2Dip
 sxwv3YMSwlONx5dmhG809O/7FePXAnARIMoOYYa6Rtu7H3q8A8Q2FL+uMbgaToxM
 h6+D4dvnBUvnrTDzJw29tJmsKSLL8NfFvEw8rGbb9giR/kP+dPQ5NVKYp5y5eIK+
 0CCj+ogJPJ7BlaLz+CH1M4FABcj8k9mZa6/T5dnDZTg7n25iX3exgdESKXL6c+Aq
 r/ntEMLy5NAxonX1S5tR4hf0KWvbh/J5yqN4GcGo8DXRnmcPCTcDPPKU9AwrmKQR
 GE1Bd+LNJRCE+73n4bUbnnl9Idk4Jd/Qwz+RfPAxWBQxZ79HpqMiDv8iQrtVyZHP
 UQp/Lg==
 =iCnl
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/rth/tags/pull-sfp-20191030' into staging

Use hardfloat for float32_to_float64

# gpg: Signature made Wed 30 Oct 2019 18:06:19 GMT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-sfp-20191030:
  softfp: Added hardfloat conversion from float32 to float64

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2019-10-31 08:12:40 +00:00
commit bb335afa61

View File

@ -1920,13 +1920,30 @@ float16 float32_to_float16(float32 a, bool ieee, float_status *s)
return float16a_round_pack_canonical(pr, s, fmt16);
}
float64 float32_to_float64(float32 a, float_status *s)
static float64 QEMU_SOFTFLOAT_ATTR
soft_float32_to_float64(float32 a, float_status *s)
{
FloatParts p = float32_unpack_canonical(a, s);
FloatParts pr = float_to_float(p, &float64_params, s);
return float64_round_pack_canonical(pr, s);
}
float64 float32_to_float64(float32 a, float_status *s)
{
if (likely(float32_is_normal(a))) {
/* Widening conversion can never produce inexact results. */
union_float32 uf;
union_float64 ud;
uf.s = a;
ud.h = uf.h;
return ud.s;
} else if (float32_is_zero(a)) {
return float64_set_sign(float64_zero, float32_is_neg(a));
} else {
return soft_float32_to_float64(a, s);
}
}
float16 float64_to_float16(float64 a, bool ieee, float_status *s)
{
const FloatFmt *fmt16 = ieee ? &float16_params : &float16_params_ahp;