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/1487414 Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#59849}
This commit is contained in:
parent
45dfb6c340
commit
73d16d9ad8
@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user