Skip to content

Commit

Permalink
Fix __fpclassifyl when double == long double. As with r283693 this is
Browse files Browse the repository at this point in the history
needed on ARM and PowerPC.

MFC after:	1 Week
  • Loading branch information
zxombie committed May 29, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent ac994ca commit 665a8e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/libc/gen/fpclassify.c
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@

#include <sys/endian.h>

#include <machine/float.h>

#include <math.h>
#include <stdint.h>

@@ -84,10 +86,18 @@ __fpclassifyl(long double e)
return (FP_SUBNORMAL);
}
mask_nbit_l(u); /* Mask normalization bit if applicable. */
#if LDBL_MANT_DIG == 53
if (u.bits.exp == 2047) {
if ((u.bits.manl | u.bits.manh) == 0)
return (FP_INFINITE);
return (FP_NAN);
}
#else
if (u.bits.exp == 32767) {
if ((u.bits.manl | u.bits.manh) == 0)
return (FP_INFINITE);
return (FP_NAN);
}
#endif
return (FP_NORMAL);
}

0 comments on commit 665a8e9

Please sign in to comment.