diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-13 19:20:00 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-13 19:20:00 +0000 |
commit | 80621676af6893b84dec1c5d00e0f5b928253ef9 (patch) | |
tree | 3e44ca3b9dbe070d98366ce234a817c23854d837 | |
parent | 0ca9d3807c8c429f7b21ffcac7f7acdd4d9659b0 (diff) |
Math functions helper for CONFIG_SOFTFLOAT=yes
The patch below adds isfinite() and isnormal() functions which can
work with float64 type, used when CONFIG_SOFTFLOAT=yes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4048 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | target-ppc/op_helper.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 7136e51f7d..544d906664 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -492,6 +492,27 @@ static always_inline int isinfinity (float64 d) (u.ll & 0x000FFFFFFFFFFFFFULL) == 0; } +#ifdef CONFIG_SOFTFLOAT +static always_inline int isfinite (float64 d) +{ + CPU_DoubleU u; + + u.d = d; + + return (((u.ll >> 52) & 0x7FF) != 0x7FF); +} + +static always_inline int isnormal (float64 d) +{ + CPU_DoubleU u; + + u.d = d; + + uint32_t exp = (u.ll >> 52) & 0x7FF; + return ((0 < exp) && (exp < 0x7FF)); +} +#endif + void do_compute_fprf (int set_fprf) { int isneg; |