Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(581)

Side by Side Diff: fusl/src/math/ilogbl.c

Issue 1581793002: Remove -Wno-unknown-pragmas from fusl build (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: comment to clang bug Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/src/math/ilogbf.c ('k') | fusl/src/math/llrintl.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <limits.h> 1 #include <limits.h>
2 #include "libm.h" 2 #include "libm.h"
3 3
4 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 4 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
5 int ilogbl(long double x) 5 int ilogbl(long double x)
6 { 6 {
7 return ilogb(x); 7 return ilogb(x);
8 } 8 }
9 #elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 9 #elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384
10 int ilogbl(long double x) 10 int ilogbl(long double x)
11 { 11 {
12 » #pragma STDC FENV_ACCESS ON 12 » PRAGMA_STDC_FENV_ACCESS_ON
13 union ldshape u = {x}; 13 union ldshape u = {x};
14 uint64_t m = u.i.m; 14 uint64_t m = u.i.m;
15 int e = u.i.se & 0x7fff; 15 int e = u.i.se & 0x7fff;
16 16
17 if (!e) { 17 if (!e) {
18 if (m == 0) { 18 if (m == 0) {
19 FORCE_EVAL(0/0.0f); 19 FORCE_EVAL(0/0.0f);
20 return FP_ILOGB0; 20 return FP_ILOGB0;
21 } 21 }
22 /* subnormal x */ 22 /* subnormal x */
(...skipping 23 matching lines...) Expand all
46 return ilogbl(x) - 120; 46 return ilogbl(x) - 120;
47 } 47 }
48 if (e == 0x7fff) { 48 if (e == 0x7fff) {
49 FORCE_EVAL(0/0.0f); 49 FORCE_EVAL(0/0.0f);
50 u.i.se = 0; 50 u.i.se = 0;
51 return u.f ? FP_ILOGBNAN : INT_MAX; 51 return u.f ? FP_ILOGBNAN : INT_MAX;
52 } 52 }
53 return e - 0x3fff; 53 return e - 0x3fff;
54 } 54 }
55 #endif 55 #endif
OLDNEW
« no previous file with comments | « fusl/src/math/ilogbf.c ('k') | fusl/src/math/llrintl.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698