Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: test/cctest/compiler/test-run-machops.cc

Issue 1584663007: [turbofan] Implement rounding of floats on x64 and ia32 without sse4.1. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: reduced generated code. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/compiler/value-helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-machops.cc
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc
index 52672c8a89204cdf1fcc7d275311813bbeaf9a46..4569e3f4db7c800d5f0e9cbc7283ab89190a6857 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -5419,6 +5419,28 @@ TEST(RunFloat32RoundDown) {
}
+TEST(RunFloat32RoundDownMinusZero) {
+ BufferedRawMachineAssemblerTester<float> m(MachineType::Float32());
+ if (!m.machine()->Float32RoundDown().IsSupported()) return;
+
+ m.Return(m.Float32RoundDown(m.Parameter(0)));
+ int32_t expected = bit_cast<int32_t>(-0.0f);
+ int32_t result = bit_cast<int32_t>(m.Call(-0.0f));
+ CHECK_EQ(expected, result);
+}
+
+
+TEST(RunFloat64RoundDownMinusZero) {
+ BufferedRawMachineAssemblerTester<double> m(MachineType::Float64());
+ if (!m.machine()->Float64RoundDown().IsSupported()) return;
+
+ m.Return(m.Float64RoundDown(m.Parameter(0)));
+ int64_t expected = bit_cast<int64_t>(-0.0);
+ int64_t result = bit_cast<int64_t>(m.Call(-0.0));
+ CHECK_EQ(expected, result);
+}
+
+
TEST(RunFloat64RoundDown1) {
BufferedRawMachineAssemblerTester<double> m(MachineType::Float64());
if (!m.machine()->Float64RoundDown().IsSupported()) return;
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/compiler/value-helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698