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

Side by Side Diff: test/cctest/test-assembler-mips.cc

Issue 1476763002: Make whether or not a Code object should be created by masm explicit (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: enum class FTW 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-assembler-ia32.cc ('k') | test/cctest/test-assembler-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // clang-format off 53 // clang-format off
54 54
55 55
56 #define __ assm. 56 #define __ assm.
57 57
58 TEST(MIPS0) { 58 TEST(MIPS0) {
59 CcTest::InitializeVM(); 59 CcTest::InitializeVM();
60 Isolate* isolate = CcTest::i_isolate(); 60 Isolate* isolate = CcTest::i_isolate();
61 HandleScope scope(isolate); 61 HandleScope scope(isolate);
62 62
63 MacroAssembler assm(isolate, NULL, 0); 63 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
64 64
65 // Addition. 65 // Addition.
66 __ addu(v0, a0, a1); 66 __ addu(v0, a0, a1);
67 __ jr(ra); 67 __ jr(ra);
68 __ nop(); 68 __ nop();
69 69
70 CodeDesc desc; 70 CodeDesc desc;
71 assm.GetCode(&desc); 71 assm.GetCode(&desc);
72 Handle<Code> code = isolate->factory()->NewCode( 72 Handle<Code> code = isolate->factory()->NewCode(
73 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 73 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
74 F2 f = FUNCTION_CAST<F2>(code->entry()); 74 F2 f = FUNCTION_CAST<F2>(code->entry());
75 int res = reinterpret_cast<int>( 75 int res = reinterpret_cast<int>(
76 CALL_GENERATED_CODE(isolate, f, 0xab0, 0xc, 0, 0, 0)); 76 CALL_GENERATED_CODE(isolate, f, 0xab0, 0xc, 0, 0, 0));
77 CHECK_EQ(static_cast<int32_t>(0xabc), res); 77 CHECK_EQ(static_cast<int32_t>(0xabc), res);
78 } 78 }
79 79
80 80
81 TEST(MIPS1) { 81 TEST(MIPS1) {
82 CcTest::InitializeVM(); 82 CcTest::InitializeVM();
83 Isolate* isolate = CcTest::i_isolate(); 83 Isolate* isolate = CcTest::i_isolate();
84 HandleScope scope(isolate); 84 HandleScope scope(isolate);
85 85
86 MacroAssembler assm(isolate, NULL, 0); 86 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
87 Label L, C; 87 Label L, C;
88 88
89 __ mov(a1, a0); 89 __ mov(a1, a0);
90 __ li(v0, 0); 90 __ li(v0, 0);
91 __ b(&C); 91 __ b(&C);
92 __ nop(); 92 __ nop();
93 93
94 __ bind(&L); 94 __ bind(&L);
95 __ addu(v0, v0, a1); 95 __ addu(v0, v0, a1);
96 __ addiu(a1, a1, -1); 96 __ addiu(a1, a1, -1);
(...skipping 15 matching lines...) Expand all
112 CALL_GENERATED_CODE(isolate, f, 50, 0, 0, 0, 0)); 112 CALL_GENERATED_CODE(isolate, f, 50, 0, 0, 0, 0));
113 CHECK_EQ(1275, res); 113 CHECK_EQ(1275, res);
114 } 114 }
115 115
116 116
117 TEST(MIPS2) { 117 TEST(MIPS2) {
118 CcTest::InitializeVM(); 118 CcTest::InitializeVM();
119 Isolate* isolate = CcTest::i_isolate(); 119 Isolate* isolate = CcTest::i_isolate();
120 HandleScope scope(isolate); 120 HandleScope scope(isolate);
121 121
122 MacroAssembler assm(isolate, NULL, 0); 122 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
123 123
124 Label exit, error; 124 Label exit, error;
125 125
126 // ----- Test all instructions. 126 // ----- Test all instructions.
127 127
128 // Test lui, ori, and addiu, used in the li pseudo-instruction. 128 // Test lui, ori, and addiu, used in the li pseudo-instruction.
129 // This way we can then safely load registers with chosen values. 129 // This way we can then safely load registers with chosen values.
130 130
131 __ ori(t0, zero_reg, 0); 131 __ ori(t0, zero_reg, 0);
132 __ lui(t0, 0x1234); 132 __ lui(t0, 0x1234);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 float fc; 273 float fc;
274 float fd; 274 float fd;
275 float fe; 275 float fe;
276 float ff; 276 float ff;
277 float fg; 277 float fg;
278 } T; 278 } T;
279 T t; 279 T t;
280 280
281 // Create a function that accepts &t, and loads, manipulates, and stores 281 // Create a function that accepts &t, and loads, manipulates, and stores
282 // the doubles t.a ... t.f. 282 // the doubles t.a ... t.f.
283 MacroAssembler assm(isolate, NULL, 0); 283 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
284 Label L, C; 284 Label L, C;
285 285
286 // Double precision floating point instructions. 286 // Double precision floating point instructions.
287 __ ldc1(f4, MemOperand(a0, offsetof(T, a)) ); 287 __ ldc1(f4, MemOperand(a0, offsetof(T, a)) );
288 __ ldc1(f6, MemOperand(a0, offsetof(T, b)) ); 288 __ ldc1(f6, MemOperand(a0, offsetof(T, b)) );
289 __ add_d(f8, f4, f6); 289 __ add_d(f8, f4, f6);
290 __ sdc1(f8, MemOperand(a0, offsetof(T, c)) ); // c = a + b. 290 __ sdc1(f8, MemOperand(a0, offsetof(T, c)) ); // c = a + b.
291 291
292 __ mov_d(f10, f8); // c 292 __ mov_d(f10, f8); // c
293 __ neg_d(f12, f6); // -b 293 __ neg_d(f12, f6); // -b
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 double c; 611 double c;
612 double d; 612 double d;
613 double e; 613 double e;
614 double f; 614 double f;
615 int32_t result; 615 int32_t result;
616 } T; 616 } T;
617 T t; 617 T t;
618 618
619 // Create a function that accepts &t, and loads, manipulates, and stores 619 // Create a function that accepts &t, and loads, manipulates, and stores
620 // the doubles t.a ... t.f. 620 // the doubles t.a ... t.f.
621 MacroAssembler assm(isolate, NULL, 0); 621 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
622 Label neither_is_nan, less_than, outa_here; 622 Label neither_is_nan, less_than, outa_here;
623 623
624 __ ldc1(f4, MemOperand(a0, offsetof(T, a)) ); 624 __ ldc1(f4, MemOperand(a0, offsetof(T, a)) );
625 __ ldc1(f6, MemOperand(a0, offsetof(T, b)) ); 625 __ ldc1(f6, MemOperand(a0, offsetof(T, b)) );
626 if (!IsMipsArchVariant(kMips32r6)) { 626 if (!IsMipsArchVariant(kMips32r6)) {
627 __ c(UN, D, f4, f6); 627 __ c(UN, D, f4, f6);
628 __ bc1f(&neither_is_nan); 628 __ bc1f(&neither_is_nan);
629 } else { 629 } else {
630 __ cmp(UN, L, f2, f4, f6); 630 __ cmp(UN, L, f2, f4, f6);
631 __ bc1eqz(&neither_is_nan, f2); 631 __ bc1eqz(&neither_is_nan, f2);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 int32_t result_rotrv_4; 702 int32_t result_rotrv_4;
703 int32_t result_rotrv_8; 703 int32_t result_rotrv_8;
704 int32_t result_rotrv_12; 704 int32_t result_rotrv_12;
705 int32_t result_rotrv_16; 705 int32_t result_rotrv_16;
706 int32_t result_rotrv_20; 706 int32_t result_rotrv_20;
707 int32_t result_rotrv_24; 707 int32_t result_rotrv_24;
708 int32_t result_rotrv_28; 708 int32_t result_rotrv_28;
709 } T; 709 } T;
710 T t; 710 T t;
711 711
712 MacroAssembler assm(isolate, NULL, 0); 712 MacroAssembler assm(isolate, NULL, 0,
713 v8::internal::CodeObjectRequired::kYes);
713 714
714 // Basic word load. 715 // Basic word load.
715 __ lw(t0, MemOperand(a0, offsetof(T, input)) ); 716 __ lw(t0, MemOperand(a0, offsetof(T, input)) );
716 717
717 // ROTR instruction (called through the Ror macro). 718 // ROTR instruction (called through the Ror macro).
718 __ Ror(t1, t0, 0x0004); 719 __ Ror(t1, t0, 0x0004);
719 __ Ror(t2, t0, 0x0008); 720 __ Ror(t2, t0, 0x0008);
720 __ Ror(t3, t0, 0x000c); 721 __ Ror(t3, t0, 0x000c);
721 __ Ror(t4, t0, 0x0010); 722 __ Ror(t4, t0, 0x0010);
722 __ Ror(t5, t0, 0x0014); 723 __ Ror(t5, t0, 0x0014);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 } 787 }
787 } 788 }
788 789
789 790
790 TEST(MIPS9) { 791 TEST(MIPS9) {
791 // Test BRANCH improvements. 792 // Test BRANCH improvements.
792 CcTest::InitializeVM(); 793 CcTest::InitializeVM();
793 Isolate* isolate = CcTest::i_isolate(); 794 Isolate* isolate = CcTest::i_isolate();
794 HandleScope scope(isolate); 795 HandleScope scope(isolate);
795 796
796 MacroAssembler assm(isolate, NULL, 0); 797 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
797 Label exit, exit2, exit3; 798 Label exit, exit2, exit3;
798 799
799 __ Branch(&exit, ge, a0, Operand(zero_reg)); 800 __ Branch(&exit, ge, a0, Operand(zero_reg));
800 __ Branch(&exit2, ge, a0, Operand(0x00001FFF)); 801 __ Branch(&exit2, ge, a0, Operand(0x00001FFF));
801 __ Branch(&exit3, ge, a0, Operand(0x0001FFFF)); 802 __ Branch(&exit3, ge, a0, Operand(0x0001FFFF));
802 803
803 __ bind(&exit); 804 __ bind(&exit);
804 __ bind(&exit2); 805 __ bind(&exit2);
805 __ bind(&exit3); 806 __ bind(&exit3);
806 __ jr(ra); 807 __ jr(ra);
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 typedef struct { 1061 typedef struct {
1061 int32_t x; 1062 int32_t x;
1062 int32_t y; 1063 int32_t y;
1063 int32_t y1; 1064 int32_t y1;
1064 int32_t y2; 1065 int32_t y2;
1065 int32_t y3; 1066 int32_t y3;
1066 int32_t y4; 1067 int32_t y4;
1067 } T; 1068 } T;
1068 T t; 1069 T t;
1069 1070
1070 MacroAssembler assm(isolate, NULL, 0); 1071 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
1071 1072
1072 __ mov(t6, fp); // Save frame pointer. 1073 __ mov(t6, fp); // Save frame pointer.
1073 __ mov(fp, a0); // Access struct T by fp. 1074 __ mov(fp, a0); // Access struct T by fp.
1074 __ lw(t0, MemOperand(a0, offsetof(T, y)) ); 1075 __ lw(t0, MemOperand(a0, offsetof(T, y)) );
1075 __ lw(t3, MemOperand(a0, offsetof(T, y4)) ); 1076 __ lw(t3, MemOperand(a0, offsetof(T, y4)) );
1076 1077
1077 __ addu(t1, t0, t3); 1078 __ addu(t1, t0, t3);
1078 __ subu(t4, t0, t3); 1079 __ subu(t4, t0, t3);
1079 __ nop(); 1080 __ nop();
1080 __ push(t0); // These instructions disappear after opt. 1081 __ push(t0); // These instructions disappear after opt.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 typedef struct { 1150 typedef struct {
1150 double cvt_big_out; 1151 double cvt_big_out;
1151 double cvt_small_out; 1152 double cvt_small_out;
1152 uint32_t trunc_big_out; 1153 uint32_t trunc_big_out;
1153 uint32_t trunc_small_out; 1154 uint32_t trunc_small_out;
1154 uint32_t cvt_big_in; 1155 uint32_t cvt_big_in;
1155 uint32_t cvt_small_in; 1156 uint32_t cvt_small_in;
1156 } T; 1157 } T;
1157 T t; 1158 T t;
1158 1159
1159 MacroAssembler assm(isolate, NULL, 0); 1160 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
1160 1161
1161 __ sw(t0, MemOperand(a0, offsetof(T, cvt_small_in))); 1162 __ sw(t0, MemOperand(a0, offsetof(T, cvt_small_in)));
1162 __ Cvt_d_uw(f10, t0, f4); 1163 __ Cvt_d_uw(f10, t0, f4);
1163 __ sdc1(f10, MemOperand(a0, offsetof(T, cvt_small_out))); 1164 __ sdc1(f10, MemOperand(a0, offsetof(T, cvt_small_out)));
1164 1165
1165 __ Trunc_uw_d(f10, f10, f4); 1166 __ Trunc_uw_d(f10, f10, f4);
1166 __ swc1(f10, MemOperand(a0, offsetof(T, trunc_small_out))); 1167 __ swc1(f10, MemOperand(a0, offsetof(T, trunc_small_out)));
1167 1168
1168 __ sw(t0, MemOperand(a0, offsetof(T, cvt_big_in))); 1169 __ sw(t0, MemOperand(a0, offsetof(T, cvt_big_in)));
1169 __ Cvt_d_uw(f8, t0, f4); 1170 __ Cvt_d_uw(f8, t0, f4);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 ROUND_STRUCT_ELEMENT(round) 1227 ROUND_STRUCT_ELEMENT(round)
1227 ROUND_STRUCT_ELEMENT(floor) 1228 ROUND_STRUCT_ELEMENT(floor)
1228 ROUND_STRUCT_ELEMENT(ceil) 1229 ROUND_STRUCT_ELEMENT(ceil)
1229 ROUND_STRUCT_ELEMENT(trunc) 1230 ROUND_STRUCT_ELEMENT(trunc)
1230 ROUND_STRUCT_ELEMENT(cvt) 1231 ROUND_STRUCT_ELEMENT(cvt)
1231 } T; 1232 } T;
1232 T t; 1233 T t;
1233 1234
1234 #undef ROUND_STRUCT_ELEMENT 1235 #undef ROUND_STRUCT_ELEMENT
1235 1236
1236 MacroAssembler assm(isolate, NULL, 0); 1237 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
1237 1238
1238 // Save FCSR. 1239 // Save FCSR.
1239 __ cfc1(a1, FCSR); 1240 __ cfc1(a1, FCSR);
1240 // Disable FPU exceptions. 1241 // Disable FPU exceptions.
1241 __ ctc1(zero_reg, FCSR); 1242 __ ctc1(zero_reg, FCSR);
1242 #define RUN_ROUND_TEST(x) \ 1243 #define RUN_ROUND_TEST(x) \
1243 __ ldc1(f0, MemOperand(a0, offsetof(T, round_up_in))); \ 1244 __ ldc1(f0, MemOperand(a0, offsetof(T, round_up_in))); \
1244 __ x##_w_d(f0, f0); \ 1245 __ x##_w_d(f0, f0); \
1245 __ swc1(f0, MemOperand(a0, offsetof(T, x##_up_out))); \ 1246 __ swc1(f0, MemOperand(a0, offsetof(T, x##_up_out))); \
1246 \ 1247 \
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 __ nop(); 1343 __ nop();
1343 } 1344 }
1344 1345
1345 1346
1346 // ----------------------mips32r6 specific tests---------------------- 1347 // ----------------------mips32r6 specific tests----------------------
1347 TEST(seleqz_selnez) { 1348 TEST(seleqz_selnez) {
1348 if (IsMipsArchVariant(kMips32r6)) { 1349 if (IsMipsArchVariant(kMips32r6)) {
1349 CcTest::InitializeVM(); 1350 CcTest::InitializeVM();
1350 Isolate* isolate = CcTest::i_isolate(); 1351 Isolate* isolate = CcTest::i_isolate();
1351 HandleScope scope(isolate); 1352 HandleScope scope(isolate);
1352 MacroAssembler assm(isolate, NULL, 0); 1353 MacroAssembler assm(isolate, NULL, 0,
1354 v8::internal::CodeObjectRequired::kYes);
1353 1355
1354 typedef struct test { 1356 typedef struct test {
1355 int a; 1357 int a;
1356 int b; 1358 int b;
1357 int c; 1359 int c;
1358 int d; 1360 int d;
1359 double e; 1361 double e;
1360 double f; 1362 double f;
1361 double g; 1363 double g;
1362 double h; 1364 double h;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 } 1445 }
1444 } 1446 }
1445 } 1447 }
1446 1448
1447 1449
1448 TEST(min_max) { 1450 TEST(min_max) {
1449 if (IsMipsArchVariant(kMips32r6)) { 1451 if (IsMipsArchVariant(kMips32r6)) {
1450 CcTest::InitializeVM(); 1452 CcTest::InitializeVM();
1451 Isolate* isolate = CcTest::i_isolate(); 1453 Isolate* isolate = CcTest::i_isolate();
1452 HandleScope scope(isolate); 1454 HandleScope scope(isolate);
1453 MacroAssembler assm(isolate, NULL, 0); 1455 MacroAssembler assm(isolate, NULL, 0,
1456 v8::internal::CodeObjectRequired::kYes);
1454 1457
1455 typedef struct test_float { 1458 typedef struct test_float {
1456 double a; 1459 double a;
1457 double b; 1460 double b;
1458 double c; 1461 double c;
1459 double d; 1462 double d;
1460 float e; 1463 float e;
1461 float f; 1464 float f;
1462 float g; 1465 float g;
1463 float h; 1466 float h;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 } 1523 }
1521 } 1524 }
1522 1525
1523 1526
1524 TEST(rint_d) { 1527 TEST(rint_d) {
1525 if (IsMipsArchVariant(kMips32r6)) { 1528 if (IsMipsArchVariant(kMips32r6)) {
1526 const int kTableLength = 30; 1529 const int kTableLength = 30;
1527 CcTest::InitializeVM(); 1530 CcTest::InitializeVM();
1528 Isolate* isolate = CcTest::i_isolate(); 1531 Isolate* isolate = CcTest::i_isolate();
1529 HandleScope scope(isolate); 1532 HandleScope scope(isolate);
1530 MacroAssembler assm(isolate, NULL, 0); 1533 MacroAssembler assm(isolate, NULL, 0,
1534 v8::internal::CodeObjectRequired::kYes);
1531 1535
1532 typedef struct test_float { 1536 typedef struct test_float {
1533 double a; 1537 double a;
1534 double b; 1538 double b;
1535 int fcsr; 1539 int fcsr;
1536 }TestFloat; 1540 }TestFloat;
1537 1541
1538 TestFloat test; 1542 TestFloat test;
1539 double inputs[kTableLength] = {18446744073709551617.0, 1543 double inputs[kTableLength] = {18446744073709551617.0,
1540 4503599627370496.0, -4503599627370496.0, 1544 4503599627370496.0, -4503599627370496.0,
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 } 1629 }
1626 } 1630 }
1627 } 1631 }
1628 1632
1629 1633
1630 TEST(sel) { 1634 TEST(sel) {
1631 if (IsMipsArchVariant(kMips32r6)) { 1635 if (IsMipsArchVariant(kMips32r6)) {
1632 CcTest::InitializeVM(); 1636 CcTest::InitializeVM();
1633 Isolate* isolate = CcTest::i_isolate(); 1637 Isolate* isolate = CcTest::i_isolate();
1634 HandleScope scope(isolate); 1638 HandleScope scope(isolate);
1635 MacroAssembler assm(isolate, NULL, 0); 1639 MacroAssembler assm(isolate, NULL, 0,
1640 v8::internal::CodeObjectRequired::kYes);
1636 1641
1637 typedef struct test { 1642 typedef struct test {
1638 double dd; 1643 double dd;
1639 double ds; 1644 double ds;
1640 double dt; 1645 double dt;
1641 float fd; 1646 float fd;
1642 float fs; 1647 float fs;
1643 float ft; 1648 float ft;
1644 } Test; 1649 } Test;
1645 1650
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 } 1704 }
1700 } 1705 }
1701 1706
1702 1707
1703 TEST(rint_s) { 1708 TEST(rint_s) {
1704 if (IsMipsArchVariant(kMips32r6)) { 1709 if (IsMipsArchVariant(kMips32r6)) {
1705 const int kTableLength = 30; 1710 const int kTableLength = 30;
1706 CcTest::InitializeVM(); 1711 CcTest::InitializeVM();
1707 Isolate* isolate = CcTest::i_isolate(); 1712 Isolate* isolate = CcTest::i_isolate();
1708 HandleScope scope(isolate); 1713 HandleScope scope(isolate);
1709 MacroAssembler assm(isolate, NULL, 0); 1714 MacroAssembler assm(isolate, NULL, 0,
1715 v8::internal::CodeObjectRequired::kYes);
1710 1716
1711 typedef struct test_float { 1717 typedef struct test_float {
1712 float a; 1718 float a;
1713 float b; 1719 float b;
1714 int fcsr; 1720 int fcsr;
1715 }TestFloat; 1721 }TestFloat;
1716 1722
1717 TestFloat test; 1723 TestFloat test;
1718 float inputs[kTableLength] = {18446744073709551617.0, 1724 float inputs[kTableLength] = {18446744073709551617.0,
1719 4503599627370496.0, -4503599627370496.0, 1725 4503599627370496.0, -4503599627370496.0,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 } 1811 }
1806 } 1812 }
1807 1813
1808 1814
1809 TEST(mina_maxa) { 1815 TEST(mina_maxa) {
1810 if (IsMipsArchVariant(kMips32r6)) { 1816 if (IsMipsArchVariant(kMips32r6)) {
1811 const int kTableLength = 15; 1817 const int kTableLength = 15;
1812 CcTest::InitializeVM(); 1818 CcTest::InitializeVM();
1813 Isolate* isolate = CcTest::i_isolate(); 1819 Isolate* isolate = CcTest::i_isolate();
1814 HandleScope scope(isolate); 1820 HandleScope scope(isolate);
1815 MacroAssembler assm(isolate, NULL, 0); 1821 MacroAssembler assm(isolate, NULL, 0,
1822 v8::internal::CodeObjectRequired::kYes);
1816 const double double_nan = std::numeric_limits<double>::quiet_NaN(); 1823 const double double_nan = std::numeric_limits<double>::quiet_NaN();
1817 const float float_nan = std::numeric_limits<float>::quiet_NaN(); 1824 const float float_nan = std::numeric_limits<float>::quiet_NaN();
1818 1825
1819 typedef struct test_float { 1826 typedef struct test_float {
1820 double a; 1827 double a;
1821 double b; 1828 double b;
1822 double resd; 1829 double resd;
1823 double resd1; 1830 double resd1;
1824 float c; 1831 float c;
1825 float d; 1832 float d;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 } 1909 }
1903 } 1910 }
1904 1911
1905 1912
1906 // ----------------------mips32r2 specific tests---------------------- 1913 // ----------------------mips32r2 specific tests----------------------
1907 TEST(trunc_l) { 1914 TEST(trunc_l) {
1908 if (IsMipsArchVariant(kMips32r2) && IsFp64Mode()) { 1915 if (IsMipsArchVariant(kMips32r2) && IsFp64Mode()) {
1909 CcTest::InitializeVM(); 1916 CcTest::InitializeVM();
1910 Isolate* isolate = CcTest::i_isolate(); 1917 Isolate* isolate = CcTest::i_isolate();
1911 HandleScope scope(isolate); 1918 HandleScope scope(isolate);
1912 MacroAssembler assm(isolate, NULL, 0); 1919 MacroAssembler assm(isolate, NULL, 0,
1920 v8::internal::CodeObjectRequired::kYes);
1913 const double dFPU64InvalidResult = static_cast<double>(kFPU64InvalidResult); 1921 const double dFPU64InvalidResult = static_cast<double>(kFPU64InvalidResult);
1914 typedef struct test_float { 1922 typedef struct test_float {
1915 double a; 1923 double a;
1916 float b; 1924 float b;
1917 int64_t c; // a trunc result 1925 int64_t c; // a trunc result
1918 int64_t d; // b trunc result 1926 int64_t d; // b trunc result
1919 }Test; 1927 }Test;
1920 const int kTableLength = 15; 1928 const int kTableLength = 15;
1921 double inputs_D[kTableLength] = { 1929 double inputs_D[kTableLength] = {
1922 2.1, 2.6, 2.5, 3.1, 3.6, 3.5, 1930 2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1962 } 1970 }
1963 } 1971 }
1964 1972
1965 1973
1966 TEST(movz_movn) { 1974 TEST(movz_movn) {
1967 if (IsMipsArchVariant(kMips32r2)) { 1975 if (IsMipsArchVariant(kMips32r2)) {
1968 const int kTableLength = 4; 1976 const int kTableLength = 4;
1969 CcTest::InitializeVM(); 1977 CcTest::InitializeVM();
1970 Isolate* isolate = CcTest::i_isolate(); 1978 Isolate* isolate = CcTest::i_isolate();
1971 HandleScope scope(isolate); 1979 HandleScope scope(isolate);
1972 MacroAssembler assm(isolate, NULL, 0); 1980 MacroAssembler assm(isolate, NULL, 0,
1981 v8::internal::CodeObjectRequired::kYes);
1973 1982
1974 typedef struct test_float { 1983 typedef struct test_float {
1975 int64_t rt; 1984 int64_t rt;
1976 double a; 1985 double a;
1977 double b; 1986 double b;
1978 double bold; 1987 double bold;
1979 double b1; 1988 double b1;
1980 double bold1; 1989 double bold1;
1981 float c; 1990 float c;
1982 float d; 1991 float d;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2091 test.srcf = inputs_S[i]; 2100 test.srcf = inputs_S[i];
2092 2101
2093 for (int j = 0; j< 8; j++) { 2102 for (int j = 0; j< 8; j++) {
2094 test.cc = condition_flags[j]; 2103 test.cc = condition_flags[j];
2095 if (test.cc == 0) { 2104 if (test.cc == 0) {
2096 test.fcsr = 1 << 23; 2105 test.fcsr = 1 << 23;
2097 } else { 2106 } else {
2098 test.fcsr = 1 << (24+condition_flags[j]); 2107 test.fcsr = 1 << (24+condition_flags[j]);
2099 } 2108 }
2100 HandleScope scope(isolate); 2109 HandleScope scope(isolate);
2101 MacroAssembler assm(isolate, NULL, 0); 2110 MacroAssembler assm(isolate, NULL, 0,
2111 v8::internal::CodeObjectRequired::kYes);
2102 __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, srcd)) ); 2112 __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, srcd)) );
2103 __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, srcf)) ); 2113 __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, srcf)) );
2104 __ lw(t1, MemOperand(a0, offsetof(TestFloat, fcsr)) ); 2114 __ lw(t1, MemOperand(a0, offsetof(TestFloat, fcsr)) );
2105 __ cfc1(t0, FCSR); 2115 __ cfc1(t0, FCSR);
2106 __ ctc1(t1, FCSR); 2116 __ ctc1(t1, FCSR);
2107 __ li(t2, 0x0); 2117 __ li(t2, 0x0);
2108 __ mtc1(t2, f12); 2118 __ mtc1(t2, f12);
2109 __ mtc1(t2, f10); 2119 __ mtc1(t2, f10);
2110 __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstdold)) ); 2120 __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstdold)) );
2111 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstfold)) ); 2121 __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstfold)) );
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2144 } 2154 }
2145 } 2155 }
2146 } 2156 }
2147 2157
2148 2158
2149 // ----------------------tests for all archs-------------------------- 2159 // ----------------------tests for all archs--------------------------
2150 TEST(cvt_w_d) { 2160 TEST(cvt_w_d) {
2151 CcTest::InitializeVM(); 2161 CcTest::InitializeVM();
2152 Isolate* isolate = CcTest::i_isolate(); 2162 Isolate* isolate = CcTest::i_isolate();
2153 HandleScope scope(isolate); 2163 HandleScope scope(isolate);
2154 MacroAssembler assm(isolate, NULL, 0); 2164 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
2155 2165
2156 typedef struct test_float { 2166 typedef struct test_float {
2157 double a; 2167 double a;
2158 int32_t b; 2168 int32_t b;
2159 int32_t fcsr; 2169 int32_t fcsr;
2160 }Test; 2170 }Test;
2161 const int kTableLength = 24; 2171 const int kTableLength = 24;
2162 double inputs[kTableLength] = { 2172 double inputs[kTableLength] = {
2163 2.1, 2.6, 2.5, 3.1, 3.6, 3.5, 2173 2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
2164 -2.1, -2.6, -2.5, -3.1, -3.6, -3.5, 2174 -2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
2221 CHECK_EQ(test.b, outputs[j][i]); 2231 CHECK_EQ(test.b, outputs[j][i]);
2222 } 2232 }
2223 } 2233 }
2224 } 2234 }
2225 2235
2226 2236
2227 TEST(trunc_w) { 2237 TEST(trunc_w) {
2228 CcTest::InitializeVM(); 2238 CcTest::InitializeVM();
2229 Isolate* isolate = CcTest::i_isolate(); 2239 Isolate* isolate = CcTest::i_isolate();
2230 HandleScope scope(isolate); 2240 HandleScope scope(isolate);
2231 MacroAssembler assm(isolate, NULL, 0); 2241 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
2232 2242
2233 typedef struct test_float { 2243 typedef struct test_float {
2234 double a; 2244 double a;
2235 float b; 2245 float b;
2236 int32_t c; // a trunc result 2246 int32_t c; // a trunc result
2237 int32_t d; // b trunc result 2247 int32_t d; // b trunc result
2238 }Test; 2248 }Test;
2239 const int kTableLength = 15; 2249 const int kTableLength = 15;
2240 double inputs_D[kTableLength] = { 2250 double inputs_D[kTableLength] = {
2241 2.1, 2.6, 2.5, 3.1, 3.6, 3.5, 2251 2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2278 CHECK_EQ(test.c, outputs[i]); 2288 CHECK_EQ(test.c, outputs[i]);
2279 CHECK_EQ(test.d, test.c); 2289 CHECK_EQ(test.d, test.c);
2280 } 2290 }
2281 } 2291 }
2282 2292
2283 2293
2284 TEST(round_w) { 2294 TEST(round_w) {
2285 CcTest::InitializeVM(); 2295 CcTest::InitializeVM();
2286 Isolate* isolate = CcTest::i_isolate(); 2296 Isolate* isolate = CcTest::i_isolate();
2287 HandleScope scope(isolate); 2297 HandleScope scope(isolate);
2288 MacroAssembler assm(isolate, NULL, 0); 2298 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
2289 2299
2290 typedef struct test_float { 2300 typedef struct test_float {
2291 double a; 2301 double a;
2292 float b; 2302 float b;
2293 int32_t c; // a trunc result 2303 int32_t c; // a trunc result
2294 int32_t d; // b trunc result 2304 int32_t d; // b trunc result
2295 }Test; 2305 }Test;
2296 const int kTableLength = 15; 2306 const int kTableLength = 15;
2297 double inputs_D[kTableLength] = { 2307 double inputs_D[kTableLength] = {
2298 2.1, 2.6, 2.5, 3.1, 3.6, 3.5, 2308 2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2336 CHECK_EQ(test.d, test.c); 2346 CHECK_EQ(test.d, test.c);
2337 } 2347 }
2338 } 2348 }
2339 2349
2340 2350
2341 TEST(round_l) { 2351 TEST(round_l) {
2342 if (IsFp64Mode()) { 2352 if (IsFp64Mode()) {
2343 CcTest::InitializeVM(); 2353 CcTest::InitializeVM();
2344 Isolate* isolate = CcTest::i_isolate(); 2354 Isolate* isolate = CcTest::i_isolate();
2345 HandleScope scope(isolate); 2355 HandleScope scope(isolate);
2346 MacroAssembler assm(isolate, NULL, 0); 2356 MacroAssembler assm(isolate, NULL, 0,
2357 v8::internal::CodeObjectRequired::kYes);
2347 const double dFPU64InvalidResult = static_cast<double>(kFPU64InvalidResult); 2358 const double dFPU64InvalidResult = static_cast<double>(kFPU64InvalidResult);
2348 typedef struct test_float { 2359 typedef struct test_float {
2349 double a; 2360 double a;
2350 float b; 2361 float b;
2351 int64_t c; 2362 int64_t c;
2352 int64_t d; 2363 int64_t d;
2353 }Test; 2364 }Test;
2354 const int kTableLength = 15; 2365 const int kTableLength = 15;
2355 double inputs_D[kTableLength] = { 2366 double inputs_D[kTableLength] = {
2356 2.1, 2.6, 2.5, 3.1, 3.6, 3.5, 2367 2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2395 } 2406 }
2396 } 2407 }
2397 } 2408 }
2398 2409
2399 2410
2400 TEST(sub) { 2411 TEST(sub) {
2401 const int kTableLength = 12; 2412 const int kTableLength = 12;
2402 CcTest::InitializeVM(); 2413 CcTest::InitializeVM();
2403 Isolate* isolate = CcTest::i_isolate(); 2414 Isolate* isolate = CcTest::i_isolate();
2404 HandleScope scope(isolate); 2415 HandleScope scope(isolate);
2405 MacroAssembler assm(isolate, NULL, 0); 2416 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
2406 2417
2407 typedef struct test_float { 2418 typedef struct test_float {
2408 float a; 2419 float a;
2409 float b; 2420 float b;
2410 float resultS; 2421 float resultS;
2411 double c; 2422 double c;
2412 double d; 2423 double d;
2413 double resultD; 2424 double resultD;
2414 }TestFloat; 2425 }TestFloat;
2415 2426
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 2479
2469 TEST(sqrt_rsqrt_recip) { 2480 TEST(sqrt_rsqrt_recip) {
2470 const int kTableLength = 4; 2481 const int kTableLength = 4;
2471 const double deltaDouble = 2E-15; 2482 const double deltaDouble = 2E-15;
2472 const float deltaFloat = 2E-7; 2483 const float deltaFloat = 2E-7;
2473 const float sqrt2_s = sqrt(2); 2484 const float sqrt2_s = sqrt(2);
2474 const double sqrt2_d = sqrt(2); 2485 const double sqrt2_d = sqrt(2);
2475 CcTest::InitializeVM(); 2486 CcTest::InitializeVM();
2476 Isolate* isolate = CcTest::i_isolate(); 2487 Isolate* isolate = CcTest::i_isolate();
2477 HandleScope scope(isolate); 2488 HandleScope scope(isolate);
2478 MacroAssembler assm(isolate, NULL, 0); 2489 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
2479 2490
2480 typedef struct test_float { 2491 typedef struct test_float {
2481 float a; 2492 float a;
2482 float resultS; 2493 float resultS;
2483 float resultS1; 2494 float resultS1;
2484 float resultS2; 2495 float resultS2;
2485 double c; 2496 double c;
2486 double resultD; 2497 double resultD;
2487 double resultD1; 2498 double resultD1;
2488 double resultD2; 2499 double resultD2;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
2568 } 2579 }
2569 } 2580 }
2570 } 2581 }
2571 2582
2572 2583
2573 TEST(neg) { 2584 TEST(neg) {
2574 const int kTableLength = 3; 2585 const int kTableLength = 3;
2575 CcTest::InitializeVM(); 2586 CcTest::InitializeVM();
2576 Isolate* isolate = CcTest::i_isolate(); 2587 Isolate* isolate = CcTest::i_isolate();
2577 HandleScope scope(isolate); 2588 HandleScope scope(isolate);
2578 MacroAssembler assm(isolate, NULL, 0); 2589 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
2579 2590
2580 typedef struct test_float { 2591 typedef struct test_float {
2581 float a; 2592 float a;
2582 float resultS; 2593 float resultS;
2583 double c; 2594 double c;
2584 double resultD; 2595 double resultD;
2585 }TestFloat; 2596 }TestFloat;
2586 2597
2587 TestFloat test; 2598 TestFloat test;
2588 double inputs_D[kTableLength] = { 2599 double inputs_D[kTableLength] = {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2621 CHECK_EQ(test.resultD, outputs_D[i]); 2632 CHECK_EQ(test.resultD, outputs_D[i]);
2622 } 2633 }
2623 } 2634 }
2624 2635
2625 2636
2626 TEST(mul) { 2637 TEST(mul) {
2627 const int kTableLength = 4; 2638 const int kTableLength = 4;
2628 CcTest::InitializeVM(); 2639 CcTest::InitializeVM();
2629 Isolate* isolate = CcTest::i_isolate(); 2640 Isolate* isolate = CcTest::i_isolate();
2630 HandleScope scope(isolate); 2641 HandleScope scope(isolate);
2631 MacroAssembler assm(isolate, NULL, 0); 2642 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
2632 2643
2633 typedef struct test_float { 2644 typedef struct test_float {
2634 float a; 2645 float a;
2635 float b; 2646 float b;
2636 float resultS; 2647 float resultS;
2637 double c; 2648 double c;
2638 double d; 2649 double d;
2639 double resultD; 2650 double resultD;
2640 }TestFloat; 2651 }TestFloat;
2641 2652
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2680 CHECK_EQ(test.resultD, inputfs_D[i]*inputft_D[i]); 2691 CHECK_EQ(test.resultD, inputfs_D[i]*inputft_D[i]);
2681 } 2692 }
2682 } 2693 }
2683 2694
2684 2695
2685 TEST(mov) { 2696 TEST(mov) {
2686 const int kTableLength = 4; 2697 const int kTableLength = 4;
2687 CcTest::InitializeVM(); 2698 CcTest::InitializeVM();
2688 Isolate* isolate = CcTest::i_isolate(); 2699 Isolate* isolate = CcTest::i_isolate();
2689 HandleScope scope(isolate); 2700 HandleScope scope(isolate);
2690 MacroAssembler assm(isolate, NULL, 0); 2701 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
2691 2702
2692 typedef struct test_float { 2703 typedef struct test_float {
2693 double a; 2704 double a;
2694 double b; 2705 double b;
2695 float c; 2706 float c;
2696 float d; 2707 float d;
2697 }TestFloat; 2708 }TestFloat;
2698 2709
2699 TestFloat test; 2710 TestFloat test;
2700 double inputs_D[kTableLength] = { 2711 double inputs_D[kTableLength] = {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
2734 CHECK_EQ(test.b, outputs_D[i]); 2745 CHECK_EQ(test.b, outputs_D[i]);
2735 CHECK_EQ(test.d, outputs_S[i]); 2746 CHECK_EQ(test.d, outputs_S[i]);
2736 } 2747 }
2737 } 2748 }
2738 2749
2739 2750
2740 TEST(floor_w) { 2751 TEST(floor_w) {
2741 CcTest::InitializeVM(); 2752 CcTest::InitializeVM();
2742 Isolate* isolate = CcTest::i_isolate(); 2753 Isolate* isolate = CcTest::i_isolate();
2743 HandleScope scope(isolate); 2754 HandleScope scope(isolate);
2744 MacroAssembler assm(isolate, NULL, 0); 2755 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
2745 2756
2746 typedef struct test_float { 2757 typedef struct test_float {
2747 double a; 2758 double a;
2748 float b; 2759 float b;
2749 int32_t c; // a floor result 2760 int32_t c; // a floor result
2750 int32_t d; // b floor result 2761 int32_t d; // b floor result
2751 }Test; 2762 }Test;
2752 const int kTableLength = 15; 2763 const int kTableLength = 15;
2753 double inputs_D[kTableLength] = { 2764 double inputs_D[kTableLength] = {
2754 2.1, 2.6, 2.5, 3.1, 3.6, 3.5, 2765 2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2792 CHECK_EQ(test.d, test.c); 2803 CHECK_EQ(test.d, test.c);
2793 } 2804 }
2794 } 2805 }
2795 2806
2796 2807
2797 TEST(floor_l) { 2808 TEST(floor_l) {
2798 if (IsFp64Mode()) { 2809 if (IsFp64Mode()) {
2799 CcTest::InitializeVM(); 2810 CcTest::InitializeVM();
2800 Isolate* isolate = CcTest::i_isolate(); 2811 Isolate* isolate = CcTest::i_isolate();
2801 HandleScope scope(isolate); 2812 HandleScope scope(isolate);
2802 MacroAssembler assm(isolate, NULL, 0); 2813 MacroAssembler assm(isolate, NULL, 0,
2814 v8::internal::CodeObjectRequired::kYes);
2803 const double dFPU64InvalidResult = static_cast<double>(kFPU64InvalidResult); 2815 const double dFPU64InvalidResult = static_cast<double>(kFPU64InvalidResult);
2804 typedef struct test_float { 2816 typedef struct test_float {
2805 double a; 2817 double a;
2806 float b; 2818 float b;
2807 int64_t c; 2819 int64_t c;
2808 int64_t d; 2820 int64_t d;
2809 }Test; 2821 }Test;
2810 const int kTableLength = 15; 2822 const int kTableLength = 15;
2811 double inputs_D[kTableLength] = { 2823 double inputs_D[kTableLength] = {
2812 2.1, 2.6, 2.5, 3.1, 3.6, 3.5, 2824 2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2850 CHECK_EQ(test.d, test.c); 2862 CHECK_EQ(test.d, test.c);
2851 } 2863 }
2852 } 2864 }
2853 } 2865 }
2854 2866
2855 2867
2856 TEST(ceil_w) { 2868 TEST(ceil_w) {
2857 CcTest::InitializeVM(); 2869 CcTest::InitializeVM();
2858 Isolate* isolate = CcTest::i_isolate(); 2870 Isolate* isolate = CcTest::i_isolate();
2859 HandleScope scope(isolate); 2871 HandleScope scope(isolate);
2860 MacroAssembler assm(isolate, NULL, 0); 2872 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
2861 2873
2862 typedef struct test_float { 2874 typedef struct test_float {
2863 double a; 2875 double a;
2864 float b; 2876 float b;
2865 int32_t c; // a floor result 2877 int32_t c; // a floor result
2866 int32_t d; // b floor result 2878 int32_t d; // b floor result
2867 }Test; 2879 }Test;
2868 const int kTableLength = 15; 2880 const int kTableLength = 15;
2869 double inputs_D[kTableLength] = { 2881 double inputs_D[kTableLength] = {
2870 2.1, 2.6, 2.5, 3.1, 3.6, 3.5, 2882 2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2908 CHECK_EQ(test.d, test.c); 2920 CHECK_EQ(test.d, test.c);
2909 } 2921 }
2910 } 2922 }
2911 2923
2912 2924
2913 TEST(ceil_l) { 2925 TEST(ceil_l) {
2914 if (IsFp64Mode()) { 2926 if (IsFp64Mode()) {
2915 CcTest::InitializeVM(); 2927 CcTest::InitializeVM();
2916 Isolate* isolate = CcTest::i_isolate(); 2928 Isolate* isolate = CcTest::i_isolate();
2917 HandleScope scope(isolate); 2929 HandleScope scope(isolate);
2918 MacroAssembler assm(isolate, NULL, 0); 2930 MacroAssembler assm(isolate, NULL, 0,
2931 v8::internal::CodeObjectRequired::kYes);
2919 const double dFPU64InvalidResult = static_cast<double>(kFPU64InvalidResult); 2932 const double dFPU64InvalidResult = static_cast<double>(kFPU64InvalidResult);
2920 typedef struct test_float { 2933 typedef struct test_float {
2921 double a; 2934 double a;
2922 float b; 2935 float b;
2923 int64_t c; 2936 int64_t c;
2924 int64_t d; 2937 int64_t d;
2925 }Test; 2938 }Test;
2926 const int kTableLength = 15; 2939 const int kTableLength = 15;
2927 double inputs_D[kTableLength] = { 2940 double inputs_D[kTableLength] = {
2928 2.1, 2.6, 2.5, 3.1, 3.6, 3.5, 2941 2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
3257 float fNegSubnorm; 3270 float fNegSubnorm;
3258 float fNegZero; 3271 float fNegZero;
3259 float fPosInf; 3272 float fPosInf;
3260 float fPosNorm; 3273 float fPosNorm;
3261 float fPosSubnorm; 3274 float fPosSubnorm;
3262 float fPosZero; } T; 3275 float fPosZero; } T;
3263 T t; 3276 T t;
3264 3277
3265 // Create a function that accepts &t, and loads, manipulates, and stores 3278 // Create a function that accepts &t, and loads, manipulates, and stores
3266 // the doubles t.a ... t.f. 3279 // the doubles t.a ... t.f.
3267 MacroAssembler assm(isolate, NULL, 0); 3280 MacroAssembler assm(isolate, NULL, 0,
3281 v8::internal::CodeObjectRequired::kYes);
3268 3282
3269 __ ldc1(f4, MemOperand(a0, offsetof(T, dSignalingNan))); 3283 __ ldc1(f4, MemOperand(a0, offsetof(T, dSignalingNan)));
3270 __ class_d(f6, f4); 3284 __ class_d(f6, f4);
3271 __ sdc1(f6, MemOperand(a0, offsetof(T, dSignalingNan))); 3285 __ sdc1(f6, MemOperand(a0, offsetof(T, dSignalingNan)));
3272 3286
3273 __ ldc1(f4, MemOperand(a0, offsetof(T, dQuietNan))); 3287 __ ldc1(f4, MemOperand(a0, offsetof(T, dQuietNan)));
3274 __ class_d(f6, f4); 3288 __ class_d(f6, f4);
3275 __ sdc1(f6, MemOperand(a0, offsetof(T, dQuietNan))); 3289 __ sdc1(f6, MemOperand(a0, offsetof(T, dQuietNan)));
3276 3290
3277 __ ldc1(f4, MemOperand(a0, offsetof(T, dNegInf))); 3291 __ ldc1(f4, MemOperand(a0, offsetof(T, dNegInf)));
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
3405 CHECK_EQ(bit_cast<int32_t>(t.fPosSubnorm), 0x100); 3419 CHECK_EQ(bit_cast<int32_t>(t.fPosSubnorm), 0x100);
3406 CHECK_EQ(bit_cast<int32_t>(t.fPosZero), 0x200); 3420 CHECK_EQ(bit_cast<int32_t>(t.fPosZero), 0x200);
3407 } 3421 }
3408 } 3422 }
3409 3423
3410 3424
3411 TEST(ABS) { 3425 TEST(ABS) {
3412 CcTest::InitializeVM(); 3426 CcTest::InitializeVM();
3413 Isolate* isolate = CcTest::i_isolate(); 3427 Isolate* isolate = CcTest::i_isolate();
3414 HandleScope scope(isolate); 3428 HandleScope scope(isolate);
3415 MacroAssembler assm(isolate, NULL, 0); 3429 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
3416 3430
3417 typedef struct test_float { 3431 typedef struct test_float {
3418 int64_t fir; 3432 int64_t fir;
3419 double a; 3433 double a;
3420 float b; 3434 float b;
3421 double fcsr; 3435 double fcsr;
3422 } TestFloat; 3436 } TestFloat;
3423 3437
3424 TestFloat test; 3438 TestFloat test;
3425 3439
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
3502 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); 3516 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3503 CHECK_EQ(std::isnan(test.a), true); 3517 CHECK_EQ(std::isnan(test.a), true);
3504 CHECK_EQ(std::isnan(test.b), true); 3518 CHECK_EQ(std::isnan(test.b), true);
3505 } 3519 }
3506 3520
3507 3521
3508 TEST(ADD_FMT) { 3522 TEST(ADD_FMT) {
3509 CcTest::InitializeVM(); 3523 CcTest::InitializeVM();
3510 Isolate* isolate = CcTest::i_isolate(); 3524 Isolate* isolate = CcTest::i_isolate();
3511 HandleScope scope(isolate); 3525 HandleScope scope(isolate);
3512 MacroAssembler assm(isolate, NULL, 0); 3526 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
3513 3527
3514 typedef struct test_float { 3528 typedef struct test_float {
3515 double a; 3529 double a;
3516 double b; 3530 double b;
3517 double c; 3531 double c;
3518 float fa; 3532 float fa;
3519 float fb; 3533 float fb;
3520 float fc; 3534 float fc;
3521 } TestFloat; 3535 } TestFloat;
3522 3536
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
3572 CHECK_EQ(std::isnan(test.c), true); 3586 CHECK_EQ(std::isnan(test.c), true);
3573 CHECK_EQ(std::isnan(test.fc), true); 3587 CHECK_EQ(std::isnan(test.fc), true);
3574 } 3588 }
3575 3589
3576 3590
3577 TEST(C_COND_FMT) { 3591 TEST(C_COND_FMT) {
3578 if ((IsMipsArchVariant(kMips32r1)) || (IsMipsArchVariant(kMips32r2))) { 3592 if ((IsMipsArchVariant(kMips32r1)) || (IsMipsArchVariant(kMips32r2))) {
3579 CcTest::InitializeVM(); 3593 CcTest::InitializeVM();
3580 Isolate* isolate = CcTest::i_isolate(); 3594 Isolate* isolate = CcTest::i_isolate();
3581 HandleScope scope(isolate); 3595 HandleScope scope(isolate);
3582 MacroAssembler assm(isolate, NULL, 0); 3596 MacroAssembler assm(isolate, NULL, 0,
3597 v8::internal::CodeObjectRequired::kYes);
3583 3598
3584 typedef struct test_float { 3599 typedef struct test_float {
3585 double dOp1; 3600 double dOp1;
3586 double dOp2; 3601 double dOp2;
3587 uint32_t dF; 3602 uint32_t dF;
3588 uint32_t dUn; 3603 uint32_t dUn;
3589 uint32_t dEq; 3604 uint32_t dEq;
3590 uint32_t dUeq; 3605 uint32_t dUeq;
3591 uint32_t dOlt; 3606 uint32_t dOlt;
3592 uint32_t dUlt; 3607 uint32_t dUlt;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
3783 CHECK_EQ(test.fUle, 1U); 3798 CHECK_EQ(test.fUle, 1U);
3784 } 3799 }
3785 } 3800 }
3786 3801
3787 3802
3788 TEST(CMP_COND_FMT) { 3803 TEST(CMP_COND_FMT) {
3789 if (IsMipsArchVariant(kMips32r6)) { 3804 if (IsMipsArchVariant(kMips32r6)) {
3790 CcTest::InitializeVM(); 3805 CcTest::InitializeVM();
3791 Isolate* isolate = CcTest::i_isolate(); 3806 Isolate* isolate = CcTest::i_isolate();
3792 HandleScope scope(isolate); 3807 HandleScope scope(isolate);
3793 MacroAssembler assm(isolate, NULL, 0); 3808 MacroAssembler assm(isolate, NULL, 0,
3809 v8::internal::CodeObjectRequired::kYes);
3794 3810
3795 typedef struct test_float { 3811 typedef struct test_float {
3796 double dOp1; 3812 double dOp1;
3797 double dOp2; 3813 double dOp2;
3798 double dF; 3814 double dF;
3799 double dUn; 3815 double dUn;
3800 double dEq; 3816 double dEq;
3801 double dUeq; 3817 double dUeq;
3802 double dOlt; 3818 double dOlt;
3803 double dUlt; 3819 double dUlt;
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
3999 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fFalse); 4015 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fFalse);
4000 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fTrue); 4016 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fTrue);
4001 } 4017 }
4002 } 4018 }
4003 4019
4004 4020
4005 TEST(CVT) { 4021 TEST(CVT) {
4006 CcTest::InitializeVM(); 4022 CcTest::InitializeVM();
4007 Isolate* isolate = CcTest::i_isolate(); 4023 Isolate* isolate = CcTest::i_isolate();
4008 HandleScope scope(isolate); 4024 HandleScope scope(isolate);
4009 MacroAssembler assm(isolate, NULL, 0); 4025 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4010 4026
4011 typedef struct test_float { 4027 typedef struct test_float {
4012 float cvt_d_s_in; 4028 float cvt_d_s_in;
4013 double cvt_d_s_out; 4029 double cvt_d_s_out;
4014 int32_t cvt_d_w_in; 4030 int32_t cvt_d_w_in;
4015 double cvt_d_w_out; 4031 double cvt_d_w_out;
4016 int64_t cvt_d_l_in; 4032 int64_t cvt_d_l_in;
4017 double cvt_d_l_out; 4033 double cvt_d_l_out;
4018 4034
4019 float cvt_l_s_in; 4035 float cvt_l_s_in;
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
4245 } 4261 }
4246 CHECK_EQ(test.cvt_w_s_out, 0); 4262 CHECK_EQ(test.cvt_w_s_out, 0);
4247 CHECK_EQ(test.cvt_w_d_out, 0); 4263 CHECK_EQ(test.cvt_w_d_out, 0);
4248 } 4264 }
4249 4265
4250 4266
4251 TEST(DIV_FMT) { 4267 TEST(DIV_FMT) {
4252 CcTest::InitializeVM(); 4268 CcTest::InitializeVM();
4253 Isolate* isolate = CcTest::i_isolate(); 4269 Isolate* isolate = CcTest::i_isolate();
4254 HandleScope scope(isolate); 4270 HandleScope scope(isolate);
4255 MacroAssembler assm(isolate, NULL, 0); 4271 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4256 4272
4257 typedef struct test { 4273 typedef struct test {
4258 double dOp1; 4274 double dOp1;
4259 double dOp2; 4275 double dOp2;
4260 double dRes; 4276 double dRes;
4261 float fOp1; 4277 float fOp1;
4262 float fOp2; 4278 float fOp2;
4263 float fRes; 4279 float fRes;
4264 } Test; 4280 } Test;
4265 4281
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
4367 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); 4383 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
4368 CHECK_EQ(true, std::isnan(test.dRes)); 4384 CHECK_EQ(true, std::isnan(test.dRes));
4369 CHECK_EQ(true, std::isnan(test.fRes)); 4385 CHECK_EQ(true, std::isnan(test.fRes));
4370 } 4386 }
4371 4387
4372 4388
4373 uint32_t run_align(uint32_t rs_value, uint32_t rt_value, uint8_t bp) { 4389 uint32_t run_align(uint32_t rs_value, uint32_t rt_value, uint8_t bp) {
4374 Isolate* isolate = CcTest::i_isolate(); 4390 Isolate* isolate = CcTest::i_isolate();
4375 HandleScope scope(isolate); 4391 HandleScope scope(isolate);
4376 4392
4377 MacroAssembler assm(isolate, NULL, 0); 4393 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4378 4394
4379 __ align(v0, a0, a1, bp); 4395 __ align(v0, a0, a1, bp);
4380 __ jr(ra); 4396 __ jr(ra);
4381 __ nop(); 4397 __ nop();
4382 4398
4383 CodeDesc desc; 4399 CodeDesc desc;
4384 assm.GetCode(&desc); 4400 assm.GetCode(&desc);
4385 Handle<Code> code = isolate->factory()->NewCode( 4401 Handle<Code> code = isolate->factory()->NewCode(
4386 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4402 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4387 4403
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
4420 } 4436 }
4421 } 4437 }
4422 } 4438 }
4423 4439
4424 uint32_t PC; // The program counter. 4440 uint32_t PC; // The program counter.
4425 4441
4426 uint32_t run_aluipc(int16_t offset) { 4442 uint32_t run_aluipc(int16_t offset) {
4427 Isolate* isolate = CcTest::i_isolate(); 4443 Isolate* isolate = CcTest::i_isolate();
4428 HandleScope scope(isolate); 4444 HandleScope scope(isolate);
4429 4445
4430 MacroAssembler assm(isolate, NULL, 0); 4446 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4431 4447
4432 __ aluipc(v0, offset); 4448 __ aluipc(v0, offset);
4433 __ jr(ra); 4449 __ jr(ra);
4434 __ nop(); 4450 __ nop();
4435 4451
4436 CodeDesc desc; 4452 CodeDesc desc;
4437 assm.GetCode(&desc); 4453 assm.GetCode(&desc);
4438 Handle<Code> code = isolate->factory()->NewCode( 4454 Handle<Code> code = isolate->factory()->NewCode(
4439 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4455 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4440 4456
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
4474 CHECK_EQ(expected_res, res); 4490 CHECK_EQ(expected_res, res);
4475 } 4491 }
4476 } 4492 }
4477 } 4493 }
4478 4494
4479 4495
4480 uint32_t run_auipc(int16_t offset) { 4496 uint32_t run_auipc(int16_t offset) {
4481 Isolate* isolate = CcTest::i_isolate(); 4497 Isolate* isolate = CcTest::i_isolate();
4482 HandleScope scope(isolate); 4498 HandleScope scope(isolate);
4483 4499
4484 MacroAssembler assm(isolate, NULL, 0); 4500 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4485 4501
4486 __ auipc(v0, offset); 4502 __ auipc(v0, offset);
4487 __ jr(ra); 4503 __ jr(ra);
4488 __ nop(); 4504 __ nop();
4489 4505
4490 CodeDesc desc; 4506 CodeDesc desc;
4491 assm.GetCode(&desc); 4507 assm.GetCode(&desc);
4492 Handle<Code> code = isolate->factory()->NewCode( 4508 Handle<Code> code = isolate->factory()->NewCode(
4493 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4509 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4494 4510
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
4528 CHECK_EQ(expected_res, res); 4544 CHECK_EQ(expected_res, res);
4529 } 4545 }
4530 } 4546 }
4531 } 4547 }
4532 4548
4533 4549
4534 uint32_t run_lwpc(int offset) { 4550 uint32_t run_lwpc(int offset) {
4535 Isolate* isolate = CcTest::i_isolate(); 4551 Isolate* isolate = CcTest::i_isolate();
4536 HandleScope scope(isolate); 4552 HandleScope scope(isolate);
4537 4553
4538 MacroAssembler assm(isolate, NULL, 0); 4554 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4539 4555
4540 // 256k instructions; 2^8k 4556 // 256k instructions; 2^8k
4541 // addiu t7, t0, 0xffff; (0x250fffff) 4557 // addiu t7, t0, 0xffff; (0x250fffff)
4542 // ... 4558 // ...
4543 // addiu t4, t0, 0x0000; (0x250c0000) 4559 // addiu t4, t0, 0x0000; (0x250c0000)
4544 uint32_t addiu_start_1 = 0x25000000; 4560 uint32_t addiu_start_1 = 0x25000000;
4545 for (int32_t i = 0xfffff; i >= 0xc0000; --i) { 4561 for (int32_t i = 0xfffff; i >= 0xc0000; --i) {
4546 uint32_t addiu_new = addiu_start_1 + i; 4562 uint32_t addiu_new = addiu_start_1 + i;
4547 __ dd(addiu_new); 4563 __ dd(addiu_new);
4548 } 4564 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
4604 CHECK_EQ(tc[i].expected_res, res); 4620 CHECK_EQ(tc[i].expected_res, res);
4605 } 4621 }
4606 } 4622 }
4607 } 4623 }
4608 4624
4609 4625
4610 uint32_t run_jic(int16_t offset) { 4626 uint32_t run_jic(int16_t offset) {
4611 Isolate* isolate = CcTest::i_isolate(); 4627 Isolate* isolate = CcTest::i_isolate();
4612 HandleScope scope(isolate); 4628 HandleScope scope(isolate);
4613 4629
4614 MacroAssembler assm(isolate, NULL, 0); 4630 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4615 4631
4616 Label get_program_counter, stop_execution; 4632 Label get_program_counter, stop_execution;
4617 __ push(ra); 4633 __ push(ra);
4618 __ li(v0, 0); 4634 __ li(v0, 0);
4619 __ li(t1, 0x66); 4635 __ li(t1, 0x66);
4620 4636
4621 __ addiu(v0, v0, 0x1); // <-- offset = -32 4637 __ addiu(v0, v0, 0x1); // <-- offset = -32
4622 __ addiu(v0, v0, 0x2); 4638 __ addiu(v0, v0, 0x2);
4623 __ addiu(v0, v0, 0x10); 4639 __ addiu(v0, v0, 0x10);
4624 __ addiu(v0, v0, 0x20); 4640 __ addiu(v0, v0, 0x20);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
4685 CHECK_EQ(tc[i].expected_res, res); 4701 CHECK_EQ(tc[i].expected_res, res);
4686 } 4702 }
4687 } 4703 }
4688 } 4704 }
4689 4705
4690 4706
4691 uint64_t run_beqzc(int32_t value, int32_t offset) { 4707 uint64_t run_beqzc(int32_t value, int32_t offset) {
4692 Isolate* isolate = CcTest::i_isolate(); 4708 Isolate* isolate = CcTest::i_isolate();
4693 HandleScope scope(isolate); 4709 HandleScope scope(isolate);
4694 4710
4695 MacroAssembler assm(isolate, NULL, 0); 4711 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4696 4712
4697 Label stop_execution; 4713 Label stop_execution;
4698 __ li(v0, 0); 4714 __ li(v0, 0);
4699 __ li(t1, 0x66); 4715 __ li(t1, 0x66);
4700 4716
4701 __ addiu(v0, v0, 0x1); // <-- offset = -32 4717 __ addiu(v0, v0, 0x1); // <-- offset = -32
4702 __ addiu(v0, v0, 0x2); 4718 __ addiu(v0, v0, 0x2);
4703 __ addiu(v0, v0, 0x10); 4719 __ addiu(v0, v0, 0x10);
4704 __ addiu(v0, v0, 0x20); 4720 __ addiu(v0, v0, 0x20);
4705 __ beq(v0, t1, &stop_execution); 4721 __ beq(v0, t1, &stop_execution);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
4758 CHECK_EQ(tc[i].expected_res, res); 4774 CHECK_EQ(tc[i].expected_res, res);
4759 } 4775 }
4760 } 4776 }
4761 } 4777 }
4762 4778
4763 4779
4764 uint32_t run_jialc(int16_t offset) { 4780 uint32_t run_jialc(int16_t offset) {
4765 Isolate* isolate = CcTest::i_isolate(); 4781 Isolate* isolate = CcTest::i_isolate();
4766 HandleScope scope(isolate); 4782 HandleScope scope(isolate);
4767 4783
4768 MacroAssembler assm(isolate, NULL, 0); 4784 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4769 4785
4770 Label main_block, get_program_counter; 4786 Label main_block, get_program_counter;
4771 __ push(ra); 4787 __ push(ra);
4772 __ li(v0, 0); 4788 __ li(v0, 0);
4773 __ beq(v0, v0, &main_block); 4789 __ beq(v0, v0, &main_block);
4774 __ nop(); 4790 __ nop();
4775 4791
4776 // Block 1 4792 // Block 1
4777 __ addiu(v0, v0, 0x1); // <-- offset = -40 4793 __ addiu(v0, v0, 0x1); // <-- offset = -40
4778 __ addiu(v0, v0, 0x2); 4794 __ addiu(v0, v0, 0x2);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
4850 CHECK_EQ(tc[i].expected_res, res); 4866 CHECK_EQ(tc[i].expected_res, res);
4851 } 4867 }
4852 } 4868 }
4853 } 4869 }
4854 4870
4855 4871
4856 uint64_t run_addiupc(int32_t imm19) { 4872 uint64_t run_addiupc(int32_t imm19) {
4857 Isolate* isolate = CcTest::i_isolate(); 4873 Isolate* isolate = CcTest::i_isolate();
4858 HandleScope scope(isolate); 4874 HandleScope scope(isolate);
4859 4875
4860 MacroAssembler assm(isolate, NULL, 0); 4876 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4861 4877
4862 __ addiupc(v0, imm19); 4878 __ addiupc(v0, imm19);
4863 __ jr(ra); 4879 __ jr(ra);
4864 __ nop(); 4880 __ nop();
4865 4881
4866 CodeDesc desc; 4882 CodeDesc desc;
4867 assm.GetCode(&desc); 4883 assm.GetCode(&desc);
4868 Handle<Code> code = isolate->factory()->NewCode( 4884 Handle<Code> code = isolate->factory()->NewCode(
4869 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4885 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4870 4886
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
4904 CHECK_EQ(expected_res, res); 4920 CHECK_EQ(expected_res, res);
4905 } 4921 }
4906 } 4922 }
4907 } 4923 }
4908 4924
4909 4925
4910 int32_t run_bc(int32_t offset) { 4926 int32_t run_bc(int32_t offset) {
4911 Isolate* isolate = CcTest::i_isolate(); 4927 Isolate* isolate = CcTest::i_isolate();
4912 HandleScope scope(isolate); 4928 HandleScope scope(isolate);
4913 4929
4914 MacroAssembler assm(isolate, NULL, 0); 4930 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4915 4931
4916 Label continue_1, stop_execution; 4932 Label continue_1, stop_execution;
4917 __ push(ra); 4933 __ push(ra);
4918 __ li(v0, 0); 4934 __ li(v0, 0);
4919 __ li(t8, 0); 4935 __ li(t8, 0);
4920 __ li(t9, 2); // A condition for stopping execution. 4936 __ li(t9, 2); // A condition for stopping execution.
4921 4937
4922 uint32_t instruction_addiu = 0x24420001; // addiu v0, v0, 1 4938 uint32_t instruction_addiu = 0x24420001; // addiu v0, v0, 1
4923 for (int32_t i = -100; i <= -11; ++i) { 4939 for (int32_t i = -100; i <= -11; ++i) {
4924 __ dd(instruction_addiu); 4940 __ dd(instruction_addiu);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
4985 CHECK_EQ(tc[i].expected_res, res); 5001 CHECK_EQ(tc[i].expected_res, res);
4986 } 5002 }
4987 } 5003 }
4988 } 5004 }
4989 5005
4990 5006
4991 int32_t run_balc(int32_t offset) { 5007 int32_t run_balc(int32_t offset) {
4992 Isolate* isolate = CcTest::i_isolate(); 5008 Isolate* isolate = CcTest::i_isolate();
4993 HandleScope scope(isolate); 5009 HandleScope scope(isolate);
4994 5010
4995 MacroAssembler assm(isolate, NULL, 0); 5011 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
4996 5012
4997 Label continue_1, stop_execution; 5013 Label continue_1, stop_execution;
4998 __ push(ra); 5014 __ push(ra);
4999 __ li(v0, 0); 5015 __ li(v0, 0);
5000 __ li(t8, 0); 5016 __ li(t8, 0);
5001 __ li(t9, 2); // A condition for stopping execution. 5017 __ li(t9, 2); // A condition for stopping execution.
5002 5018
5003 __ beq(t8, t8, &continue_1); 5019 __ beq(t8, t8, &continue_1);
5004 __ nop(); 5020 __ nop();
5005 5021
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
5066 CHECK_EQ(tc[i].expected_res, res); 5082 CHECK_EQ(tc[i].expected_res, res);
5067 } 5083 }
5068 } 5084 }
5069 } 5085 }
5070 5086
5071 5087
5072 uint32_t run_bal(int16_t offset) { 5088 uint32_t run_bal(int16_t offset) {
5073 Isolate* isolate = CcTest::i_isolate(); 5089 Isolate* isolate = CcTest::i_isolate();
5074 HandleScope scope(isolate); 5090 HandleScope scope(isolate);
5075 5091
5076 MacroAssembler assm(isolate, NULL, 0); 5092 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes);
5077 5093
5078 __ mov(t0, ra); 5094 __ mov(t0, ra);
5079 __ bal(offset); // Equivalent for "BGEZAL zero_reg, offset". 5095 __ bal(offset); // Equivalent for "BGEZAL zero_reg, offset".
5080 __ nop(); 5096 __ nop();
5081 5097
5082 __ mov(ra, t0); 5098 __ mov(ra, t0);
5083 __ jr(ra); 5099 __ jr(ra);
5084 __ nop(); 5100 __ nop();
5085 5101
5086 __ li(v0, 1); 5102 __ li(v0, 1);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
5122 5138
5123 5139
5124 TEST(Trampoline) { 5140 TEST(Trampoline) {
5125 // Private member of Assembler class. 5141 // Private member of Assembler class.
5126 static const int kMaxBranchOffset = (1 << (18 - 1)) - 1; 5142 static const int kMaxBranchOffset = (1 << (18 - 1)) - 1;
5127 5143
5128 CcTest::InitializeVM(); 5144 CcTest::InitializeVM();
5129 Isolate* isolate = CcTest::i_isolate(); 5145 Isolate* isolate = CcTest::i_isolate();
5130 HandleScope scope(isolate); 5146 HandleScope scope(isolate);
5131 5147
5132 MacroAssembler assm(isolate, nullptr, 0); 5148 MacroAssembler assm(isolate, nullptr, 0,
5149 v8::internal::CodeObjectRequired::kYes);
5133 Label done; 5150 Label done;
5134 size_t nr_calls = kMaxBranchOffset / (2 * Instruction::kInstrSize) + 2; 5151 size_t nr_calls = kMaxBranchOffset / (2 * Instruction::kInstrSize) + 2;
5135 5152
5136 for (size_t i = 0; i < nr_calls; ++i) { 5153 for (size_t i = 0; i < nr_calls; ++i) {
5137 __ BranchShort(&done, eq, a0, Operand(a1)); 5154 __ BranchShort(&done, eq, a0, Operand(a1));
5138 } 5155 }
5139 __ bind(&done); 5156 __ bind(&done);
5140 __ Ret(USE_DELAY_SLOT); 5157 __ Ret(USE_DELAY_SLOT);
5141 __ mov(v0, zero_reg); 5158 __ mov(v0, zero_reg);
5142 5159
5143 CodeDesc desc; 5160 CodeDesc desc;
5144 assm.GetCode(&desc); 5161 assm.GetCode(&desc);
5145 Handle<Code> code = isolate->factory()->NewCode( 5162 Handle<Code> code = isolate->factory()->NewCode(
5146 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 5163 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
5147 F2 f = FUNCTION_CAST<F2>(code->entry()); 5164 F2 f = FUNCTION_CAST<F2>(code->entry());
5148 5165
5149 int32_t res = reinterpret_cast<int32_t>( 5166 int32_t res = reinterpret_cast<int32_t>(
5150 CALL_GENERATED_CODE(isolate, f, 42, 42, 0, 0, 0)); 5167 CALL_GENERATED_CODE(isolate, f, 42, 42, 0, 0, 0));
5151 CHECK_EQ(res, 0); 5168 CHECK_EQ(res, 0);
5152 } 5169 }
5153 5170
5154 5171
5155 #undef __ 5172 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-assembler-ia32.cc ('k') | test/cctest/test-assembler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698