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

Side by Side Diff: fusl/src/math/ilogb.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/fmal.c ('k') | fusl/src/math/ilogbf.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 int ilogb(double x) 4 int ilogb(double x)
5 { 5 {
6 » #pragma STDC FENV_ACCESS ON 6 » PRAGMA_STDC_FENV_ACCESS_ON
7 union {double f; uint64_t i;} u = {x}; 7 union {double f; uint64_t i;} u = {x};
8 uint64_t i = u.i; 8 uint64_t i = u.i;
9 int e = i>>52 & 0x7ff; 9 int e = i>>52 & 0x7ff;
10 10
11 if (!e) { 11 if (!e) {
12 i <<= 12; 12 i <<= 12;
13 if (i == 0) { 13 if (i == 0) {
14 FORCE_EVAL(0/0.0f); 14 FORCE_EVAL(0/0.0f);
15 return FP_ILOGB0; 15 return FP_ILOGB0;
16 } 16 }
17 /* subnormal x */ 17 /* subnormal x */
18 for (e = -0x3ff; i>>63 == 0; e--, i<<=1); 18 for (e = -0x3ff; i>>63 == 0; e--, i<<=1);
19 return e; 19 return e;
20 } 20 }
21 if (e == 0x7ff) { 21 if (e == 0x7ff) {
22 FORCE_EVAL(0/0.0f); 22 FORCE_EVAL(0/0.0f);
23 return i<<12 ? FP_ILOGBNAN : INT_MAX; 23 return i<<12 ? FP_ILOGBNAN : INT_MAX;
24 } 24 }
25 return e - 0x3ff; 25 return e - 0x3ff;
26 } 26 }
OLDNEW
« no previous file with comments | « fusl/src/math/fmal.c ('k') | fusl/src/math/ilogbf.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698