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

Unified Diff: src/third_party/fdlibm/fdlibm.js

Issue 866553003: Allocate typed array for rempio2 result. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/third_party/fdlibm/fdlibm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/third_party/fdlibm/fdlibm.js
diff --git a/src/third_party/fdlibm/fdlibm.js b/src/third_party/fdlibm/fdlibm.js
index ceeacc59bbf313b850035dcd35c1feb5f97e0362..880446990536b62a633fced0ba3b446c9801b396 100644
--- a/src/third_party/fdlibm/fdlibm.js
+++ b/src/third_party/fdlibm/fdlibm.js
@@ -20,10 +20,13 @@
// and exposed through kMath as typed array. We assume the compiler to convert
// from decimal to binary accurately enough to produce the intended values.
// kMath is initialized to a Float64Array during genesis and not writable.
+// rempio2result is used as a container for return values of %RemPiO2. It is
+// initialized to a two-element Float64Array during genesis.
"use strict";
var kMath;
+var rempio2result;
const INVPIO2 = kMath[0];
const PIO2_1 = kMath[1];
@@ -38,6 +41,7 @@ const PIO4LO = kMath[33];
// Compute k and r such that x - k*pi/2 = r where |r| < pi/4. For
// precision, r is returned as two values y0 and y1 such that r = y0 + y1
// to more than double precision.
+
macro REMPIO2(X)
var n, y0, y1;
var hx = %_DoubleHi(X);
@@ -105,10 +109,9 @@ macro REMPIO2(X)
}
} else {
// Need to do full Payne-Hanek reduction here.
- var r = %RemPiO2(X);
- n = r[0];
- y0 = r[1];
- y1 = r[2];
+ n = %RemPiO2(X, rempio2result);
+ y0 = rempio2result[0];
+ y1 = rempio2result[1];
}
endmacro
« no previous file with comments | « src/third_party/fdlibm/fdlibm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698