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

Unified Diff: test/cctest/wasm/test-run-wasm-64.cc

Issue 1803453003: [wasm] Int64Lowering of Word64Popcnt. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@arm-shr
Patch Set: Created 4 years, 9 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
Index: test/cctest/wasm/test-run-wasm-64.cc
diff --git a/test/cctest/wasm/test-run-wasm-64.cc b/test/cctest/wasm/test-run-wasm-64.cc
index 3f4f100171c8a8e0c4d8b4f874a28ef40d302367..4875d2f6872149b68f776cd2e9cf9dce3ce9b1b1 100644
--- a/test/cctest/wasm/test-run-wasm-64.cc
+++ b/test/cctest/wasm/test-run-wasm-64.cc
@@ -262,6 +262,22 @@ TEST(Run_WasmI64UConvertI32) {
// kExprI64Clz:
// kExprI64Ctz:
// kExprI64Popcnt:
+TEST(Run_WasmI64Popcnt) {
+ struct {
+ int64_t expected;
+ uint64_t input;
+ } values[] = {{64, 0xffffffffffffffff},
+ {0, 0x0000000000000000},
+ {2, 0x0000080000008000},
+ {26, 0x1123456782345678},
+ {38, 0xffedcba09edcba09}};
+
+ WasmRunner<int64_t> r(MachineType::Uint64());
+ BUILD(r, WASM_I64_POPCNT(WASM_GET_LOCAL(0)));
+ for (size_t i = 0; i < arraysize(values); i++) {
+ CHECK_EQ(values[i].expected, r.Call(values[i].input));
+ }
+}
// kExprF32SConvertI64:
TEST(Run_WasmF32SConvertI64) {

Powered by Google App Engine
This is Rietveld 408576698