Commit 73d16d9a authored by Matt Gardner's avatar Matt Gardner Committed by Commit Bot

Remove obsolete MSVC 10.0 workaround for std::floor

MSVC 14.x and 15.x handle -0 correctly unless /fp:fast is used. /fp:precise
is the default.


bug: v8:3477, v8:8912
Change-Id: I242a1dfd845f750cab7c56f13107612259d44d23
Reviewed-on: https://chromium-review.googlesource.com/c/1487414Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59849}
parent 45dfb6c3
......@@ -1461,7 +1461,7 @@ Reduction MachineOperatorReducer::ReduceFloat64RoundDown(Node* node) {
DCHECK_EQ(IrOpcode::kFloat64RoundDown, node->opcode());
Float64Matcher m(node->InputAt(0));
if (m.HasValue()) {
return ReplaceFloat64(Floor(m.Value()));
return ReplaceFloat64(std::floor(m.Value()));
}
return NoChange();
}
......
......@@ -5575,7 +5575,7 @@ double JSDate::CurrentTimeValue(Isolate* isolate) {
// the number in a Date object representing a particular instant in
// time is milliseconds. Therefore, we floor the result of getting
// the OS time.
return Floor(V8::GetCurrentPlatform()->CurrentClockTimeMillis());
return std::floor(V8::GetCurrentPlatform()->CurrentClockTimeMillis());
}
// static
......
......@@ -220,14 +220,6 @@ T Nabs(T a) {
return a < 0 ? a : -a;
}
// Floor(-0.0) == 0.0
inline double Floor(double x) {
#if V8_CC_MSVC
if (x == 0) return x; // Fix for issue 3477.
#endif
return std::floor(x);
}
inline double Modulo(double x, double y) {
#if defined(V8_OS_WIN)
// Workaround MS fmod bugs. ECMA-262 says:
......
......@@ -2227,7 +2227,7 @@ TEST_F(MachineOperatorReducerTest, Float64RoundDownWithConstant) {
Reduction r = Reduce(graph()->NewNode(
machine()->Float64RoundDown().placeholder(), Float64Constant(x)));
ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsFloat64Constant(Floor(x)));
EXPECT_THAT(r.replacement(), IsFloat64Constant(std::floor(x)));
}
}
......
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