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

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: positive int48 does not need dati. Created 5 years 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/test-assembler-mips64.cc
diff --git a/test/cctest/test-assembler-mips64.cc b/test/cctest/test-assembler-mips64.cc
index e8674a4c326e7209e83b2b7d6f942f13b78a35cb..8154e36537731802384772b0aee503c35f5d5205 100644
--- a/test/cctest/test-assembler-mips64.cc
+++ b/test/cctest/test-assembler-mips64.cc
@@ -5008,6 +5008,56 @@ TEST(r6_aui_family) {
}
+uint64_t run_li_macro(uint64_t rs) {
+ Isolate* isolate = CcTest::i_isolate();
+ HandleScope scope(isolate);
+ MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
+
+ __ li(a0, rs);
ivica.bogosavljevic 2015/12/21 16:15:56 There is a third parametar to li macro called LiFl
Alan Li 2016/01/20 14:26:59 Done.
+ __ 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,
ivica.bogosavljevic 2015/12/21 16:15:56 Looks good
Alan Li 2016/01/20 14:26:59 Acknowledged.
+ 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]);
+ CHECK_EQ(inputs[i], res);
+ }
+}
+
+
uint64_t run_lwpc(int offset) {
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
« src/mips64/macro-assembler-mips64.cc ('K') | « src/mips64/macro-assembler-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698