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

Unified Diff: test/cctest/test-assembler-mips64.cc

Issue 1522573002: MIPS: use DAHI/DATH for li macro on mips64r6. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: more fixes. 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/mips64/macro-assembler-mips64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-assembler-mips64.cc
diff --git a/test/cctest/test-assembler-mips64.cc b/test/cctest/test-assembler-mips64.cc
index 988083cadc0247c799d19cfc67ed70d357f27eb4..255f205e5be4be4662ea280a88d763c354e3af59 100644
--- a/test/cctest/test-assembler-mips64.cc
+++ b/test/cctest/test-assembler-mips64.cc
@@ -4997,6 +4997,54 @@ TEST(r6_aui_family) {
}
+uint64_t run_li_macro(uint64_t rs, LiFlags mode) {
+ Isolate* isolate = CcTest::i_isolate();
+ HandleScope scope(isolate);
+ MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
+
+ __ li(a0, rs, mode);
+ __ mov(v0, a0);
+ __ jr(ra);
+ __ nop();
+
+ CodeDesc desc;
+ assm.GetCode(&desc);
+ Handle<Code> code = isolate->factory()->NewCode(
+ desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
+
+ F2 f = FUNCTION_CAST<F2>(code->entry());
+
+ uint64_t res = reinterpret_cast<uint64_t>(
+ CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0));
+
+ return res;
+}
+
+
+TEST(li_macro) {
+ CcTest::InitializeVM();
+
+ uint64_t inputs[] = {
+ 0x0000000000000000, 0x000000000000ffff, 0x00000000ffffffff,
+ 0x0000ffffffffffff, 0xffffffffffffffff, 0xffff000000000000,
+ 0xffffffff00000000, 0xffffffffffff0000, 0xffff0000ffff0000,
+ 0x0000ffffffff0000, 0x0000ffff0000ffff,
+ };
+
+ size_t nr_test_cases = sizeof(inputs) / sizeof(inputs[0]);
+ for (size_t i = 0; i < nr_test_cases; ++i) {
+ uint64_t res = run_li_macro(inputs[i], OPTIMIZE_SIZE);
+ CHECK_EQ(inputs[i], res);
+ res = run_li_macro(inputs[i], CONSTANT_SIZE);
+ CHECK_EQ(inputs[i], res);
+ if (is_int48(inputs[i])) {
+ res = run_li_macro(inputs[i], ADDRESS_LOAD);
+ CHECK_EQ(inputs[i], res);
+ }
+ }
+}
+
+
uint64_t run_lwpc(int offset) {
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
« no previous file with comments | « src/mips64/macro-assembler-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698