diff options
Diffstat (limited to 'deps/v8/src/compiler/machine-operator-reducer.cc')
-rw-r--r-- | deps/v8/src/compiler/machine-operator-reducer.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/deps/v8/src/compiler/machine-operator-reducer.cc b/deps/v8/src/compiler/machine-operator-reducer.cc index a2fa6a5bb7..50142003dc 100644 --- a/deps/v8/src/compiler/machine-operator-reducer.cc +++ b/deps/v8/src/compiler/machine-operator-reducer.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "src/compiler/machine-operator-reducer.h" +#include <cmath> #include "src/base/bits.h" #include "src/base/division-by-constant.h" @@ -173,8 +174,8 @@ Reduction MachineOperatorReducer::Reduce(Node* node) { Int32BinopMatcher m(node); if (m.right().Is(0)) return Replace(m.left().node()); // x ror 0 => x if (m.IsFoldable()) { // K ror K => K - return ReplaceInt32( - base::bits::RotateRight32(m.left().Value(), m.right().Value())); + return ReplaceInt32(base::bits::RotateRight32(m.left().Value(), + m.right().Value() & 31)); } break; } @@ -323,7 +324,7 @@ Reduction MachineOperatorReducer::Reduce(Node* node) { case IrOpcode::kFloat32Sub: { Float32BinopMatcher m(node); if (allow_signalling_nan_ && m.right().Is(0) && - (copysign(1.0, m.right().Value()) > 0)) { + (std::copysign(1.0, m.right().Value()) > 0)) { return Replace(m.left().node()); // x - 0 => x } if (m.right().IsNaN()) { // x - NaN => NaN |