-
Benedikt Meurer authored
This adds a fast-path to inline `Math.hypot(v1,...,vn)` into optimized code assuming that v1,...,vn are already numbers. The inlining follows the general C++ implementation (which was also simplified a bit), and thus uses Kahan summation to avoid rounding errors. This improves the benchmark in [1] from around testHypot: 656 ms. testSqrt: 105 ms. testExp: 103 ms. to testHypot: 147 ms. testSqrt: 103 ms. testExp: 102 ms. so its roughly a **4.5x improvement**. [1] https://github.com/bmeurer/js-micro-benchmarks/blob/60a34c0dd29b77e6950555c2dd9687b1a0a7671e/bench-math-hypot.js Bug: chromium:979893 Change-Id: Id834d5613bc22aa7ce27b9d6eca1f1f1979aa3e7 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1684178 Auto-Submit: Benedikt Meurer <bmeurer@chromium.org> Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#62483}
545a2502