Commit 8d11b06f authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[compiler] Restore two optimizations of Float64Pow

These appear to be consistent with the pow implementation in ieee754.cc.

Bug: v8:11371
Change-Id: I1b695facb5ba7dc1a7bd28914bdb535966e080c7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2710432
Auto-Submit: Georg Neis <neis@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72922}
parent 23b08e2a
......@@ -737,6 +737,13 @@ Reduction MachineOperatorReducer::Reduce(Node* node) {
m.right().ResolvedValue()));
} else if (m.right().Is(0.0)) { // x ** +-0.0 => 1.0
return ReplaceFloat64(1.0);
} else if (m.right().Is(2.0)) { // x ** 2.0 => x * x
node->ReplaceInput(1, m.left().node());
NodeProperties::ChangeOp(node, machine()->Float64Mul());
return Changed(node);
} else if (m.right().Is(0.5)) {
// x ** 0.5 => if x <= -Infinity then Infinity else sqrt(0.0 + x)
return Replace(Float64PowHalf(m.left().node()));
}
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment