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

Side by Side Diff: fusl/src/math/fma.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/internal/libm.h ('k') | fusl/src/math/fmaf.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 <fenv.h> 1 #include <fenv.h>
2 #include "libm.h" 2 #include "libm.h"
3 3
4 #if LDBL_MANT_DIG==64 && LDBL_MAX_EXP==16384 4 #if LDBL_MANT_DIG==64 && LDBL_MAX_EXP==16384
5 /* exact add, assumes exponent_x >= exponent_y */ 5 /* exact add, assumes exponent_x >= exponent_y */
6 static void add(long double *hi, long double *lo, long double x, long double y) 6 static void add(long double *hi, long double *lo, long double x, long double y)
7 { 7 {
8 long double r; 8 long double r;
9 9
10 r = x + y; 10 r = x + y;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 static int getexp(long double x) 73 static int getexp(long double x)
74 { 74 {
75 union ldshape u; 75 union ldshape u;
76 u.f = x; 76 u.f = x;
77 return u.i.se & 0x7fff; 77 return u.i.se & 0x7fff;
78 } 78 }
79 79
80 double fma(double x, double y, double z) 80 double fma(double x, double y, double z)
81 { 81 {
82 » #pragma STDC FENV_ACCESS ON 82 » PRAGMA_STDC_FENV_ACCESS_ON
83 long double hi, lo1, lo2, xy; 83 long double hi, lo1, lo2, xy;
84 int round, ez, exy; 84 int round, ez, exy;
85 85
86 /* handle +-inf,nan */ 86 /* handle +-inf,nan */
87 if (!isfinite(x) || !isfinite(y)) 87 if (!isfinite(x) || !isfinite(y))
88 return x*y + z; 88 return x*y + z;
89 if (!isfinite(z)) 89 if (!isfinite(z))
90 return z; 90 return z;
91 /* handle +-0 */ 91 /* handle +-0 */
92 if (x == 0.0 || y == 0.0) 92 if (x == 0.0 || y == 0.0)
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 return ret; 451 return ret;
452 } 452 }
453 453
454 adj = add_adjusted(r.lo, xy.lo); 454 adj = add_adjusted(r.lo, xy.lo);
455 if (spread + ilogb(r.hi) > -1023) 455 if (spread + ilogb(r.hi) > -1023)
456 return scalbn(r.hi + adj, spread); 456 return scalbn(r.hi + adj, spread);
457 else 457 else
458 return add_and_denormalize(r.hi, adj, spread); 458 return add_and_denormalize(r.hi, adj, spread);
459 } 459 }
460 #endif 460 #endif
OLDNEW
« no previous file with comments | « fusl/src/internal/libm.h ('k') | fusl/src/math/fmaf.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698