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

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

Issue 1424173006: Implemented the Word64Popcnt TurboFan operator for x64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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') | no next file » | 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 b7c978a747d76e8c6639b502e31f64a5164be84d..96bcc86953d79bc41abf2b058d06fbe28791eca1 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -284,6 +284,25 @@ TEST(RunWord64Ctz) {
CHECK_EQ(1, m.Call(uint64_t(0x000000009afdbc82)));
CHECK_EQ(0, m.Call(uint64_t(0x000000009afdbc81)));
}
+
+
+TEST(RunWord64Popcnt) {
+ BufferedRawMachineAssemblerTester<int32_t> m(kMachUint64);
+ if (!m.machine()->Word64Popcnt().IsSupported()) {
+ return;
+ }
+
+ m.Return(m.AddNode(m.machine()->Word64Popcnt().op(), m.Parameter(0)));
+
+ CHECK_EQ(0, m.Call(uint64_t(0x0000000000000000)));
+ CHECK_EQ(1, m.Call(uint64_t(0x0000000000000001)));
+ CHECK_EQ(1, m.Call(uint64_t(0x8000000000000000)));
+ CHECK_EQ(64, m.Call(uint64_t(0xffffffffffffffff)));
+ CHECK_EQ(12, m.Call(uint64_t(0x000dc100000dc100)));
+ CHECK_EQ(18, m.Call(uint64_t(0xe00dc100e00dc100)));
+ CHECK_EQ(22, m.Call(uint64_t(0xe00dc103e00dc103)));
+ CHECK_EQ(18, m.Call(uint64_t(0x000dc107000dc107)));
+}
#endif // V8_TARGET_ARCH_64_BIT
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698