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

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

Issue 1457223005: Remove a bunch of Isolate::Current() callsites from simulators (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-assembler-arm.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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
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>(CALL_GENERATED_CODE(f, 0xab0, 0xc, 0, 0, 0)); 75 int res = reinterpret_cast<int>(
76 CALL_GENERATED_CODE(isolate, f, 0xab0, 0xc, 0, 0, 0));
76 CHECK_EQ(static_cast<int32_t>(0xabc), res); 77 CHECK_EQ(static_cast<int32_t>(0xabc), res);
77 } 78 }
78 79
79 80
80 TEST(MIPS1) { 81 TEST(MIPS1) {
81 CcTest::InitializeVM(); 82 CcTest::InitializeVM();
82 Isolate* isolate = CcTest::i_isolate(); 83 Isolate* isolate = CcTest::i_isolate();
83 HandleScope scope(isolate); 84 HandleScope scope(isolate);
84 85
85 MacroAssembler assm(isolate, NULL, 0); 86 MacroAssembler assm(isolate, NULL, 0);
(...skipping 14 matching lines...) Expand all
100 __ nop(); 101 __ nop();
101 102
102 __ jr(ra); 103 __ jr(ra);
103 __ nop(); 104 __ nop();
104 105
105 CodeDesc desc; 106 CodeDesc desc;
106 assm.GetCode(&desc); 107 assm.GetCode(&desc);
107 Handle<Code> code = isolate->factory()->NewCode( 108 Handle<Code> code = isolate->factory()->NewCode(
108 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 109 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
109 F1 f = FUNCTION_CAST<F1>(code->entry()); 110 F1 f = FUNCTION_CAST<F1>(code->entry());
110 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 50, 0, 0, 0, 0)); 111 int res = reinterpret_cast<int>(
112 CALL_GENERATED_CODE(isolate, f, 50, 0, 0, 0, 0));
111 CHECK_EQ(1275, res); 113 CHECK_EQ(1275, res);
112 } 114 }
113 115
114 116
115 TEST(MIPS2) { 117 TEST(MIPS2) {
116 CcTest::InitializeVM(); 118 CcTest::InitializeVM();
117 Isolate* isolate = CcTest::i_isolate(); 119 Isolate* isolate = CcTest::i_isolate();
118 HandleScope scope(isolate); 120 HandleScope scope(isolate);
119 121
120 MacroAssembler assm(isolate, NULL, 0); 122 MacroAssembler assm(isolate, NULL, 0);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 239
238 __ bind(&exit); 240 __ bind(&exit);
239 __ jr(ra); 241 __ jr(ra);
240 __ nop(); 242 __ nop();
241 243
242 CodeDesc desc; 244 CodeDesc desc;
243 assm.GetCode(&desc); 245 assm.GetCode(&desc);
244 Handle<Code> code = isolate->factory()->NewCode( 246 Handle<Code> code = isolate->factory()->NewCode(
245 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 247 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
246 F2 f = FUNCTION_CAST<F2>(code->entry()); 248 F2 f = FUNCTION_CAST<F2>(code->entry());
247 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, 0xab0, 0xc, 0, 0, 0)); 249 int res = reinterpret_cast<int>(
250 CALL_GENERATED_CODE(isolate, f, 0xab0, 0xc, 0, 0, 0));
248 CHECK_EQ(static_cast<int32_t>(0x31415926), res); 251 CHECK_EQ(static_cast<int32_t>(0x31415926), res);
249 } 252 }
250 253
251 254
252 TEST(MIPS3) { 255 TEST(MIPS3) {
253 // Test floating point instructions. 256 // Test floating point instructions.
254 CcTest::InitializeVM(); 257 CcTest::InitializeVM();
255 Isolate* isolate = CcTest::i_isolate(); 258 Isolate* isolate = CcTest::i_isolate();
256 HandleScope scope(isolate); 259 HandleScope scope(isolate);
257 260
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 t.f = 0.0; 357 t.f = 0.0;
355 t.h = 1.5; 358 t.h = 1.5;
356 t.i = 2.75; 359 t.i = 2.75;
357 // Single test values. 360 // Single test values.
358 t.fa = 1.5e6; 361 t.fa = 1.5e6;
359 t.fb = 2.75e4; 362 t.fb = 2.75e4;
360 t.fc = 0.0; 363 t.fc = 0.0;
361 t.fd = 0.0; 364 t.fd = 0.0;
362 t.fe = 0.0; 365 t.fe = 0.0;
363 t.ff = 0.0; 366 t.ff = 0.0;
364 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 367 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
365 USE(dummy); 368 USE(dummy);
366 // Expected double results. 369 // Expected double results.
367 CHECK_EQ(1.5e14, t.a); 370 CHECK_EQ(1.5e14, t.a);
368 CHECK_EQ(1.5e14, t.b); 371 CHECK_EQ(1.5e14, t.b);
369 CHECK_EQ(1.50275e14, t.c); 372 CHECK_EQ(1.50275e14, t.c);
370 CHECK_EQ(1.50550e14, t.d); 373 CHECK_EQ(1.50550e14, t.d);
371 CHECK_EQ(1.8066e16, t.e); 374 CHECK_EQ(1.8066e16, t.e);
372 CHECK_EQ(120.44, t.f); 375 CHECK_EQ(120.44, t.f);
373 CHECK_EQ(10.97451593465515908537, t.g); 376 CHECK_EQ(10.97451593465515908537, t.g);
374 if (IsMipsArchVariant(kMips32r2)) { 377 if (IsMipsArchVariant(kMips32r2)) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 __ nop(); 438 __ nop();
436 439
437 CodeDesc desc; 440 CodeDesc desc;
438 assm.GetCode(&desc); 441 assm.GetCode(&desc);
439 Handle<Code> code = isolate->factory()->NewCode( 442 Handle<Code> code = isolate->factory()->NewCode(
440 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 443 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
441 F3 f = FUNCTION_CAST<F3>(code->entry()); 444 F3 f = FUNCTION_CAST<F3>(code->entry());
442 t.a = 1.5e22; 445 t.a = 1.5e22;
443 t.b = 2.75e11; 446 t.b = 2.75e11;
444 t.c = 17.17; 447 t.c = 17.17;
445 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 448 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
446 USE(dummy); 449 USE(dummy);
447 450
448 CHECK_EQ(2.75e11, t.a); 451 CHECK_EQ(2.75e11, t.a);
449 CHECK_EQ(2.75e11, t.b); 452 CHECK_EQ(2.75e11, t.b);
450 CHECK_EQ(1.5e22, t.c); 453 CHECK_EQ(1.5e22, t.c);
451 } 454 }
452 455
453 456
454 TEST(MIPS5) { 457 TEST(MIPS5) {
455 // Test conversions between doubles and integers. 458 // Test conversions between doubles and integers.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 502
500 CodeDesc desc; 503 CodeDesc desc;
501 assm.GetCode(&desc); 504 assm.GetCode(&desc);
502 Handle<Code> code = isolate->factory()->NewCode( 505 Handle<Code> code = isolate->factory()->NewCode(
503 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 506 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
504 F3 f = FUNCTION_CAST<F3>(code->entry()); 507 F3 f = FUNCTION_CAST<F3>(code->entry());
505 t.a = 1.5e4; 508 t.a = 1.5e4;
506 t.b = 2.75e8; 509 t.b = 2.75e8;
507 t.i = 12345678; 510 t.i = 12345678;
508 t.j = -100000; 511 t.j = -100000;
509 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 512 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
510 USE(dummy); 513 USE(dummy);
511 514
512 CHECK_EQ(12345678.0, t.a); 515 CHECK_EQ(12345678.0, t.a);
513 CHECK_EQ(-100000.0, t.b); 516 CHECK_EQ(-100000.0, t.b);
514 CHECK_EQ(15000, t.i); 517 CHECK_EQ(15000, t.i);
515 CHECK_EQ(275000000, t.j); 518 CHECK_EQ(275000000, t.j);
516 } 519 }
517 520
518 521
519 TEST(MIPS6) { 522 TEST(MIPS6) {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 __ jr(ra); 570 __ jr(ra);
568 __ nop(); 571 __ nop();
569 572
570 CodeDesc desc; 573 CodeDesc desc;
571 assm.GetCode(&desc); 574 assm.GetCode(&desc);
572 Handle<Code> code = isolate->factory()->NewCode( 575 Handle<Code> code = isolate->factory()->NewCode(
573 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 576 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
574 F3 f = FUNCTION_CAST<F3>(code->entry()); 577 F3 f = FUNCTION_CAST<F3>(code->entry());
575 t.ui = 0x11223344; 578 t.ui = 0x11223344;
576 t.si = 0x99aabbcc; 579 t.si = 0x99aabbcc;
577 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 580 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
578 USE(dummy); 581 USE(dummy);
579 582
580 CHECK_EQ(static_cast<int32_t>(0x11223344), t.r1); 583 CHECK_EQ(static_cast<int32_t>(0x11223344), t.r1);
581 #if __BYTE_ORDER == __LITTLE_ENDIAN 584 #if __BYTE_ORDER == __LITTLE_ENDIAN
582 CHECK_EQ(static_cast<int32_t>(0x3344), t.r2); 585 CHECK_EQ(static_cast<int32_t>(0x3344), t.r2);
583 CHECK_EQ(static_cast<int32_t>(0xffffbbcc), t.r3); 586 CHECK_EQ(static_cast<int32_t>(0xffffbbcc), t.r3);
584 CHECK_EQ(static_cast<int32_t>(0x0000bbcc), t.r4); 587 CHECK_EQ(static_cast<int32_t>(0x0000bbcc), t.r4);
585 CHECK_EQ(static_cast<int32_t>(0xffffffcc), t.r5); 588 CHECK_EQ(static_cast<int32_t>(0xffffffcc), t.r5);
586 CHECK_EQ(static_cast<int32_t>(0x3333bbcc), t.r6); 589 CHECK_EQ(static_cast<int32_t>(0x3333bbcc), t.r6);
587 #elif __BYTE_ORDER == __BIG_ENDIAN 590 #elif __BYTE_ORDER == __BIG_ENDIAN
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 Handle<Code> code = isolate->factory()->NewCode( 668 Handle<Code> code = isolate->factory()->NewCode(
666 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 669 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
667 F3 f = FUNCTION_CAST<F3>(code->entry()); 670 F3 f = FUNCTION_CAST<F3>(code->entry());
668 t.a = 1.5e14; 671 t.a = 1.5e14;
669 t.b = 2.75e11; 672 t.b = 2.75e11;
670 t.c = 2.0; 673 t.c = 2.0;
671 t.d = -4.0; 674 t.d = -4.0;
672 t.e = 0.0; 675 t.e = 0.0;
673 t.f = 0.0; 676 t.f = 0.0;
674 t.result = 0; 677 t.result = 0;
675 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 678 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
676 USE(dummy); 679 USE(dummy);
677 CHECK_EQ(1.5e14, t.a); 680 CHECK_EQ(1.5e14, t.a);
678 CHECK_EQ(2.75e11, t.b); 681 CHECK_EQ(2.75e11, t.b);
679 CHECK_EQ(1, t.result); 682 CHECK_EQ(1, t.result);
680 } 683 }
681 684
682 685
683 TEST(MIPS8) { 686 TEST(MIPS8) {
684 // Test ROTR and ROTRV instructions. 687 // Test ROTR and ROTRV instructions.
685 if (IsMipsArchVariant(kMips32r2)) { 688 if (IsMipsArchVariant(kMips32r2)) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 759
757 __ jr(ra); 760 __ jr(ra);
758 __ nop(); 761 __ nop();
759 762
760 CodeDesc desc; 763 CodeDesc desc;
761 assm.GetCode(&desc); 764 assm.GetCode(&desc);
762 Handle<Code> code = isolate->factory()->NewCode( 765 Handle<Code> code = isolate->factory()->NewCode(
763 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 766 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
764 F3 f = FUNCTION_CAST<F3>(code->entry()); 767 F3 f = FUNCTION_CAST<F3>(code->entry());
765 t.input = 0x12345678; 768 t.input = 0x12345678;
766 Object* dummy = CALL_GENERATED_CODE(f, &t, 0x0, 0, 0, 0); 769 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0x0, 0, 0, 0);
767 USE(dummy); 770 USE(dummy);
768 CHECK_EQ(static_cast<int32_t>(0x81234567), t.result_rotr_4); 771 CHECK_EQ(static_cast<int32_t>(0x81234567), t.result_rotr_4);
769 CHECK_EQ(static_cast<int32_t>(0x78123456), t.result_rotr_8); 772 CHECK_EQ(static_cast<int32_t>(0x78123456), t.result_rotr_8);
770 CHECK_EQ(static_cast<int32_t>(0x67812345), t.result_rotr_12); 773 CHECK_EQ(static_cast<int32_t>(0x67812345), t.result_rotr_12);
771 CHECK_EQ(static_cast<int32_t>(0x56781234), t.result_rotr_16); 774 CHECK_EQ(static_cast<int32_t>(0x56781234), t.result_rotr_16);
772 CHECK_EQ(static_cast<int32_t>(0x45678123), t.result_rotr_20); 775 CHECK_EQ(static_cast<int32_t>(0x45678123), t.result_rotr_20);
773 CHECK_EQ(static_cast<int32_t>(0x34567812), t.result_rotr_24); 776 CHECK_EQ(static_cast<int32_t>(0x34567812), t.result_rotr_24);
774 CHECK_EQ(static_cast<int32_t>(0x23456781), t.result_rotr_28); 777 CHECK_EQ(static_cast<int32_t>(0x23456781), t.result_rotr_28);
775 778
776 CHECK_EQ(static_cast<int32_t>(0x81234567), t.result_rotrv_4); 779 CHECK_EQ(static_cast<int32_t>(0x81234567), t.result_rotrv_4);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 __ jr(ra); 867 __ jr(ra);
865 __ nop(); 868 __ nop();
866 869
867 CodeDesc desc; 870 CodeDesc desc;
868 assm.GetCode(&desc); 871 assm.GetCode(&desc);
869 Handle<Code> code = isolate->factory()->NewCode( 872 Handle<Code> code = isolate->factory()->NewCode(
870 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 873 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
871 F3 f = FUNCTION_CAST<F3>(code->entry()); 874 F3 f = FUNCTION_CAST<F3>(code->entry());
872 t.a = 2.147483646e+09; // 0x7FFFFFFE -> 0xFF80000041DFFFFF as double. 875 t.a = 2.147483646e+09; // 0x7FFFFFFE -> 0xFF80000041DFFFFF as double.
873 t.b_word = 0x0ff00ff0; // 0x0FF00FF0 -> 0x as double. 876 t.b_word = 0x0ff00ff0; // 0x0FF00FF0 -> 0x as double.
874 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 877 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
875 USE(dummy); 878 USE(dummy);
876 CHECK_EQ(static_cast<int32_t>(0x41DFFFFF), t.dbl_exp); 879 CHECK_EQ(static_cast<int32_t>(0x41DFFFFF), t.dbl_exp);
877 CHECK_EQ(static_cast<int32_t>(0xFF800000), t.dbl_mant); 880 CHECK_EQ(static_cast<int32_t>(0xFF800000), t.dbl_mant);
878 CHECK_EQ(static_cast<int32_t>(0x7FFFFFFE), t.word); 881 CHECK_EQ(static_cast<int32_t>(0x7FFFFFFE), t.word);
879 // 0x0FF00FF0 -> 2.6739096+e08 882 // 0x0FF00FF0 -> 2.6739096+e08
880 CHECK_EQ(2.6739096e08, t.b); 883 CHECK_EQ(2.6739096e08, t.b);
881 } 884 }
882 885
883 886
884 TEST(MIPS11) { 887 TEST(MIPS11) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 __ nop(); 996 __ nop();
994 997
995 CodeDesc desc; 998 CodeDesc desc;
996 assm.GetCode(&desc); 999 assm.GetCode(&desc);
997 Handle<Code> code = isolate->factory()->NewCode( 1000 Handle<Code> code = isolate->factory()->NewCode(
998 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1001 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
999 F3 f = FUNCTION_CAST<F3>(code->entry()); 1002 F3 f = FUNCTION_CAST<F3>(code->entry());
1000 t.reg_init = 0xaabbccdd; 1003 t.reg_init = 0xaabbccdd;
1001 t.mem_init = 0x11223344; 1004 t.mem_init = 0x11223344;
1002 1005
1003 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 1006 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
1004 USE(dummy); 1007 USE(dummy);
1005 1008
1006 #if __BYTE_ORDER == __LITTLE_ENDIAN 1009 #if __BYTE_ORDER == __LITTLE_ENDIAN
1007 CHECK_EQ(static_cast<int32_t>(0x44bbccdd), t.lwl_0); 1010 CHECK_EQ(static_cast<int32_t>(0x44bbccdd), t.lwl_0);
1008 CHECK_EQ(static_cast<int32_t>(0x3344ccdd), t.lwl_1); 1011 CHECK_EQ(static_cast<int32_t>(0x3344ccdd), t.lwl_1);
1009 CHECK_EQ(static_cast<int32_t>(0x223344dd), t.lwl_2); 1012 CHECK_EQ(static_cast<int32_t>(0x223344dd), t.lwl_2);
1010 CHECK_EQ(static_cast<int32_t>(0x11223344), t.lwl_3); 1013 CHECK_EQ(static_cast<int32_t>(0x11223344), t.lwl_3);
1011 1014
1012 CHECK_EQ(static_cast<int32_t>(0x11223344), t.lwr_0); 1015 CHECK_EQ(static_cast<int32_t>(0x11223344), t.lwr_0);
1013 CHECK_EQ(static_cast<int32_t>(0xaa112233), t.lwr_1); 1016 CHECK_EQ(static_cast<int32_t>(0xaa112233), t.lwr_1);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 Handle<Code> code = isolate->factory()->NewCode( 1126 Handle<Code> code = isolate->factory()->NewCode(
1124 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1127 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1125 F3 f = FUNCTION_CAST<F3>(code->entry()); 1128 F3 f = FUNCTION_CAST<F3>(code->entry());
1126 t.x = 1; 1129 t.x = 1;
1127 t.y = 2; 1130 t.y = 2;
1128 t.y1 = 3; 1131 t.y1 = 3;
1129 t.y2 = 4; 1132 t.y2 = 4;
1130 t.y3 = 0XBABA; 1133 t.y3 = 0XBABA;
1131 t.y4 = 0xDEDA; 1134 t.y4 = 0xDEDA;
1132 1135
1133 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 1136 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
1134 USE(dummy); 1137 USE(dummy);
1135 1138
1136 CHECK_EQ(3, t.y1); 1139 CHECK_EQ(3, t.y1);
1137 } 1140 }
1138 1141
1139 1142
1140 TEST(MIPS13) { 1143 TEST(MIPS13) {
1141 // Test Cvt_d_uw and Trunc_uw_d macros. 1144 // Test Cvt_d_uw and Trunc_uw_d macros.
1142 CcTest::InitializeVM(); 1145 CcTest::InitializeVM();
1143 Isolate* isolate = CcTest::i_isolate(); 1146 Isolate* isolate = CcTest::i_isolate();
(...skipping 30 matching lines...) Expand all
1174 1177
1175 CodeDesc desc; 1178 CodeDesc desc;
1176 assm.GetCode(&desc); 1179 assm.GetCode(&desc);
1177 Handle<Code> code = isolate->factory()->NewCode( 1180 Handle<Code> code = isolate->factory()->NewCode(
1178 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1181 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1179 F3 f = FUNCTION_CAST<F3>(code->entry()); 1182 F3 f = FUNCTION_CAST<F3>(code->entry());
1180 1183
1181 t.cvt_big_in = 0xFFFFFFFF; 1184 t.cvt_big_in = 0xFFFFFFFF;
1182 t.cvt_small_in = 333; 1185 t.cvt_small_in = 333;
1183 1186
1184 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 1187 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
1185 USE(dummy); 1188 USE(dummy);
1186 1189
1187 CHECK_EQ(t.cvt_big_out, static_cast<double>(t.cvt_big_in)); 1190 CHECK_EQ(t.cvt_big_out, static_cast<double>(t.cvt_big_in));
1188 CHECK_EQ(t.cvt_small_out, static_cast<double>(t.cvt_small_in)); 1191 CHECK_EQ(t.cvt_small_out, static_cast<double>(t.cvt_small_in));
1189 1192
1190 CHECK_EQ(static_cast<int>(t.trunc_big_out), static_cast<int>(t.cvt_big_in)); 1193 CHECK_EQ(static_cast<int>(t.trunc_big_out), static_cast<int>(t.cvt_big_in));
1191 CHECK_EQ(static_cast<int>(t.trunc_small_out), 1194 CHECK_EQ(static_cast<int>(t.trunc_small_out),
1192 static_cast<int>(t.cvt_small_in)); 1195 static_cast<int>(t.cvt_small_in));
1193 } 1196 }
1194 1197
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 1301
1299 t.round_up_in = 123.51; 1302 t.round_up_in = 123.51;
1300 t.round_down_in = 123.49; 1303 t.round_down_in = 123.49;
1301 t.neg_round_up_in = -123.5; 1304 t.neg_round_up_in = -123.5;
1302 t.neg_round_down_in = -123.49; 1305 t.neg_round_down_in = -123.49;
1303 t.err1_in = 123.51; 1306 t.err1_in = 123.51;
1304 t.err2_in = 1; 1307 t.err2_in = 1;
1305 t.err3_in = static_cast<double>(1) + 0xFFFFFFFF; 1308 t.err3_in = static_cast<double>(1) + 0xFFFFFFFF;
1306 t.err4_in = NAN; 1309 t.err4_in = NAN;
1307 1310
1308 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 1311 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
1309 USE(dummy); 1312 USE(dummy);
1310 1313
1311 #define GET_FPU_ERR(x) (static_cast<int>(x & kFCSRFlagMask)) 1314 #define GET_FPU_ERR(x) (static_cast<int>(x & kFCSRFlagMask))
1312 #define CHECK_ROUND_RESULT(type) \ 1315 #define CHECK_ROUND_RESULT(type) \
1313 CHECK(GET_FPU_ERR(t.type##_err1_out) & kFCSRInexactFlagMask); \ 1316 CHECK(GET_FPU_ERR(t.type##_err1_out) & kFCSRInexactFlagMask); \
1314 CHECK_EQ(0, GET_FPU_ERR(t.type##_err2_out)); \ 1317 CHECK_EQ(0, GET_FPU_ERR(t.type##_err2_out)); \
1315 CHECK(GET_FPU_ERR(t.type##_err3_out) & kFCSRInvalidOpFlagMask); \ 1318 CHECK(GET_FPU_ERR(t.type##_err3_out) & kFCSRInvalidOpFlagMask); \
1316 CHECK(GET_FPU_ERR(t.type##_err4_out) & kFCSRInvalidOpFlagMask); \ 1319 CHECK(GET_FPU_ERR(t.type##_err4_out) & kFCSRInvalidOpFlagMask); \
1317 CHECK_EQ(kFPUInvalidResult, static_cast<uint>(t.type##_invalid_result)); 1320 CHECK_EQ(kFPUInvalidResult, static_cast<uint>(t.type##_invalid_result));
1318 1321
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 __ swc1(f12, MemOperand(a0, offsetof(Test, k)) ); // src 1391 __ swc1(f12, MemOperand(a0, offsetof(Test, k)) ); // src
1389 __ swc1(f14, MemOperand(a0, offsetof(Test, l)) ); // src 1392 __ swc1(f14, MemOperand(a0, offsetof(Test, l)) ); // src
1390 __ jr(ra); 1393 __ jr(ra);
1391 __ nop(); 1394 __ nop();
1392 CodeDesc desc; 1395 CodeDesc desc;
1393 assm.GetCode(&desc); 1396 assm.GetCode(&desc);
1394 Handle<Code> code = isolate->factory()->NewCode( 1397 Handle<Code> code = isolate->factory()->NewCode(
1395 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1398 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1396 F3 f = FUNCTION_CAST<F3>(code->entry()); 1399 F3 f = FUNCTION_CAST<F3>(code->entry());
1397 1400
1398 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 1401 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
1399 1402
1400 CHECK_EQ(test.a, 1); 1403 CHECK_EQ(test.a, 1);
1401 CHECK_EQ(test.b, 0); 1404 CHECK_EQ(test.b, 0);
1402 CHECK_EQ(test.c, 0); 1405 CHECK_EQ(test.c, 0);
1403 CHECK_EQ(test.d, 1); 1406 CHECK_EQ(test.d, 1);
1404 1407
1405 const int test_size = 3; 1408 const int test_size = 3;
1406 const int input_size = 5; 1409 const int input_size = 5;
1407 1410
1408 double inputs_D[input_size] = {0.0, 65.2, -70.32, 1411 double inputs_D[input_size] = {0.0, 65.2, -70.32,
1409 18446744073709551621.0, -18446744073709551621.0}; 1412 18446744073709551621.0, -18446744073709551621.0};
1410 double outputs_D[input_size] = {0.0, 65.2, -70.32, 1413 double outputs_D[input_size] = {0.0, 65.2, -70.32,
1411 18446744073709551621.0, -18446744073709551621.0}; 1414 18446744073709551621.0, -18446744073709551621.0};
1412 double tests_D[test_size*2] = {2.8, 2.9, -2.8, -2.9, 1415 double tests_D[test_size*2] = {2.8, 2.9, -2.8, -2.9,
1413 18446744073709551616.0, 18446744073709555712.0}; 1416 18446744073709551616.0, 18446744073709555712.0};
1414 float inputs_S[input_size] = {0.0, 65.2, -70.32, 1417 float inputs_S[input_size] = {0.0, 65.2, -70.32,
1415 18446744073709551621.0, -18446744073709551621.0}; 1418 18446744073709551621.0, -18446744073709551621.0};
1416 float outputs_S[input_size] = {0.0, 65.2, -70.32, 1419 float outputs_S[input_size] = {0.0, 65.2, -70.32,
1417 18446744073709551621.0, -18446744073709551621.0}; 1420 18446744073709551621.0, -18446744073709551621.0};
1418 float tests_S[test_size*2] = {2.9, 2.8, -2.9, -2.8, 1421 float tests_S[test_size*2] = {2.9, 2.8, -2.9, -2.8,
1419 18446744073709551616.0, 18446746272732807168.0}; 1422 18446744073709551616.0, 18446746272732807168.0};
1420 for (int j=0; j < test_size; j+=2) { 1423 for (int j=0; j < test_size; j+=2) {
1421 for (int i=0; i < input_size; i++) { 1424 for (int i=0; i < input_size; i++) {
1422 test.e = inputs_D[i]; 1425 test.e = inputs_D[i];
1423 test.f = tests_D[j]; 1426 test.f = tests_D[j];
1424 test.i = inputs_S[i]; 1427 test.i = inputs_S[i];
1425 test.j = tests_S[j]; 1428 test.j = tests_S[j];
1426 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 1429 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
1427 CHECK_EQ(test.g, outputs_D[i]); 1430 CHECK_EQ(test.g, outputs_D[i]);
1428 CHECK_EQ(test.h, 0); 1431 CHECK_EQ(test.h, 0);
1429 CHECK_EQ(test.k, outputs_S[i]); 1432 CHECK_EQ(test.k, outputs_S[i]);
1430 CHECK_EQ(test.l, 0); 1433 CHECK_EQ(test.l, 0);
1431 1434
1432 test.f = tests_D[j+1]; 1435 test.f = tests_D[j+1];
1433 test.j = tests_S[j+1]; 1436 test.j = tests_S[j+1];
1434 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 1437 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
1435 CHECK_EQ(test.g, 0); 1438 CHECK_EQ(test.g, 0);
1436 CHECK_EQ(test.h, outputs_D[i]); 1439 CHECK_EQ(test.h, outputs_D[i]);
1437 CHECK_EQ(test.k, 0); 1440 CHECK_EQ(test.k, 0);
1438 CHECK_EQ(test.l, outputs_S[i]); 1441 CHECK_EQ(test.l, outputs_S[i]);
1439 } 1442 }
1440 } 1443 }
1441 } 1444 }
1442 } 1445 }
1443 1446
1444 1447
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 assm.GetCode(&desc); 1496 assm.GetCode(&desc);
1494 Handle<Code> code = isolate->factory()->NewCode( 1497 Handle<Code> code = isolate->factory()->NewCode(
1495 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1498 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1496 F3 f = FUNCTION_CAST<F3>(code->entry()); 1499 F3 f = FUNCTION_CAST<F3>(code->entry());
1497 for (int i = 0; i < kTableLength; i++) { 1500 for (int i = 0; i < kTableLength; i++) {
1498 test.a = inputsa[i]; 1501 test.a = inputsa[i];
1499 test.b = inputsb[i]; 1502 test.b = inputsb[i];
1500 test.e = inputse[i]; 1503 test.e = inputse[i];
1501 test.f = inputsf[i]; 1504 test.f = inputsf[i];
1502 1505
1503 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 1506 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
1504 1507
1505 if (i < kTableLength - 1) { 1508 if (i < kTableLength - 1) {
1506 CHECK_EQ(test.c, outputsdmin[i]); 1509 CHECK_EQ(test.c, outputsdmin[i]);
1507 CHECK_EQ(test.d, outputsdmax[i]); 1510 CHECK_EQ(test.d, outputsdmax[i]);
1508 CHECK_EQ(test.g, outputsfmin[i]); 1511 CHECK_EQ(test.g, outputsfmin[i]);
1509 CHECK_EQ(test.h, outputsfmax[i]); 1512 CHECK_EQ(test.h, outputsfmax[i]);
1510 } else { 1513 } else {
1511 DCHECK(std::isnan(test.c)); 1514 DCHECK(std::isnan(test.c));
1512 DCHECK(std::isnan(test.d)); 1515 DCHECK(std::isnan(test.d));
1513 DCHECK(std::isnan(test.g)); 1516 DCHECK(std::isnan(test.g));
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 CodeDesc desc; 1612 CodeDesc desc;
1610 assm.GetCode(&desc); 1613 assm.GetCode(&desc);
1611 Handle<Code> code = isolate->factory()->NewCode( 1614 Handle<Code> code = isolate->factory()->NewCode(
1612 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1615 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1613 F3 f = FUNCTION_CAST<F3>(code->entry()); 1616 F3 f = FUNCTION_CAST<F3>(code->entry());
1614 1617
1615 for (int j = 0; j < 4; j++) { 1618 for (int j = 0; j < 4; j++) {
1616 test.fcsr = fcsr_inputs[j]; 1619 test.fcsr = fcsr_inputs[j];
1617 for (int i = 0; i < kTableLength; i++) { 1620 for (int i = 0; i < kTableLength; i++) {
1618 test.a = inputs[i]; 1621 test.a = inputs[i];
1619 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 1622 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
1620 CHECK_EQ(test.b, outputs[j][i]); 1623 CHECK_EQ(test.b, outputs[j][i]);
1621 } 1624 }
1622 } 1625 }
1623 } 1626 }
1624 } 1627 }
1625 1628
1626 1629
1627 TEST(sel) { 1630 TEST(sel) {
1628 if (IsMipsArchVariant(kMips32r6)) { 1631 if (IsMipsArchVariant(kMips32r6)) {
1629 CcTest::InitializeVM(); 1632 CcTest::InitializeVM();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 float tests_S[test_size*2] = {2.9, 2.8, -2.9, -2.8, 1678 float tests_S[test_size*2] = {2.9, 2.8, -2.9, -2.8,
1676 18446744073709551616.0, 18446746272732807168.0}; 1679 18446744073709551616.0, 18446746272732807168.0};
1677 for (int j=0; j < test_size; j+=2) { 1680 for (int j=0; j < test_size; j+=2) {
1678 for (int i=0; i < input_size; i++) { 1681 for (int i=0; i < input_size; i++) {
1679 test.dt = inputs_dt[i]; 1682 test.dt = inputs_dt[i];
1680 test.dd = tests_D[j]; 1683 test.dd = tests_D[j];
1681 test.ds = inputs_ds[i]; 1684 test.ds = inputs_ds[i];
1682 test.ft = inputs_ft[i]; 1685 test.ft = inputs_ft[i];
1683 test.fd = tests_S[j]; 1686 test.fd = tests_S[j];
1684 test.fs = inputs_fs[i]; 1687 test.fs = inputs_fs[i];
1685 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 1688 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
1686 CHECK_EQ(test.dd, inputs_ds[i]); 1689 CHECK_EQ(test.dd, inputs_ds[i]);
1687 CHECK_EQ(test.fd, inputs_fs[i]); 1690 CHECK_EQ(test.fd, inputs_fs[i]);
1688 1691
1689 test.dd = tests_D[j+1]; 1692 test.dd = tests_D[j+1];
1690 test.fd = tests_S[j+1]; 1693 test.fd = tests_S[j+1];
1691 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 1694 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
1692 CHECK_EQ(test.dd, inputs_dt[i]); 1695 CHECK_EQ(test.dd, inputs_dt[i]);
1693 CHECK_EQ(test.fd, inputs_ft[i]); 1696 CHECK_EQ(test.fd, inputs_ft[i]);
1694 } 1697 }
1695 } 1698 }
1696 } 1699 }
1697 } 1700 }
1698 1701
1699 1702
1700 TEST(rint_s) { 1703 TEST(rint_s) {
1701 if (IsMipsArchVariant(kMips32r6)) { 1704 if (IsMipsArchVariant(kMips32r6)) {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 CodeDesc desc; 1791 CodeDesc desc;
1789 assm.GetCode(&desc); 1792 assm.GetCode(&desc);
1790 Handle<Code> code = isolate->factory()->NewCode( 1793 Handle<Code> code = isolate->factory()->NewCode(
1791 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1794 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1792 F3 f = FUNCTION_CAST<F3>(code->entry()); 1795 F3 f = FUNCTION_CAST<F3>(code->entry());
1793 1796
1794 for (int j = 0; j < 4; j++) { 1797 for (int j = 0; j < 4; j++) {
1795 test.fcsr = fcsr_inputs[j]; 1798 test.fcsr = fcsr_inputs[j];
1796 for (int i = 0; i < kTableLength; i++) { 1799 for (int i = 0; i < kTableLength; i++) {
1797 test.a = inputs[i]; 1800 test.a = inputs[i];
1798 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 1801 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
1799 CHECK_EQ(test.b, outputs[j][i]); 1802 CHECK_EQ(test.b, outputs[j][i]);
1800 } 1803 }
1801 } 1804 }
1802 } 1805 }
1803 } 1806 }
1804 1807
1805 1808
1806 TEST(mina_maxa) { 1809 TEST(mina_maxa) {
1807 if (IsMipsArchVariant(kMips32r6)) { 1810 if (IsMipsArchVariant(kMips32r6)) {
1808 const int kTableLength = 15; 1811 const int kTableLength = 15;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 CodeDesc desc; 1879 CodeDesc desc;
1877 assm.GetCode(&desc); 1880 assm.GetCode(&desc);
1878 Handle<Code> code = isolate->factory()->NewCode( 1881 Handle<Code> code = isolate->factory()->NewCode(
1879 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1882 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1880 F3 f = FUNCTION_CAST<F3>(code->entry()); 1883 F3 f = FUNCTION_CAST<F3>(code->entry());
1881 for (int i = 0; i < kTableLength; i++) { 1884 for (int i = 0; i < kTableLength; i++) {
1882 test.a = inputsa[i]; 1885 test.a = inputsa[i];
1883 test.b = inputsb[i]; 1886 test.b = inputsb[i];
1884 test.c = inputsc[i]; 1887 test.c = inputsc[i];
1885 test.d = inputsd[i]; 1888 test.d = inputsd[i];
1886 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 1889 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
1887 if (i < kTableLength - 1) { 1890 if (i < kTableLength - 1) {
1888 CHECK_EQ(test.resd, resd[i]); 1891 CHECK_EQ(test.resd, resd[i]);
1889 CHECK_EQ(test.resf, resf[i]); 1892 CHECK_EQ(test.resf, resf[i]);
1890 CHECK_EQ(test.resd1, resd1[i]); 1893 CHECK_EQ(test.resd1, resd1[i]);
1891 CHECK_EQ(test.resf1, resf1[i]); 1894 CHECK_EQ(test.resf1, resf1[i]);
1892 } else { 1895 } else {
1893 DCHECK(std::isnan(test.resd)); 1896 DCHECK(std::isnan(test.resd));
1894 DCHECK(std::isnan(test.resf)); 1897 DCHECK(std::isnan(test.resf));
1895 DCHECK(std::isnan(test.resd1)); 1898 DCHECK(std::isnan(test.resd1));
1896 DCHECK(std::isnan(test.resf1)); 1899 DCHECK(std::isnan(test.resf1));
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 __ nop(); 1948 __ nop();
1946 Test test; 1949 Test test;
1947 CodeDesc desc; 1950 CodeDesc desc;
1948 assm.GetCode(&desc); 1951 assm.GetCode(&desc);
1949 Handle<Code> code = isolate->factory()->NewCode( 1952 Handle<Code> code = isolate->factory()->NewCode(
1950 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 1953 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
1951 F3 f = FUNCTION_CAST<F3>(code->entry()); 1954 F3 f = FUNCTION_CAST<F3>(code->entry());
1952 for (int i = 0; i < kTableLength; i++) { 1955 for (int i = 0; i < kTableLength; i++) {
1953 test.a = inputs_D[i]; 1956 test.a = inputs_D[i];
1954 test.b = inputs_S[i]; 1957 test.b = inputs_S[i];
1955 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 1958 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
1956 CHECK_EQ(test.c, outputs[i]); 1959 CHECK_EQ(test.c, outputs[i]);
1957 CHECK_EQ(test.d, test.c); 1960 CHECK_EQ(test.d, test.c);
1958 } 1961 }
1959 } 1962 }
1960 } 1963 }
1961 1964
1962 1965
1963 TEST(movz_movn) { 1966 TEST(movz_movn) {
1964 if (IsMipsArchVariant(kMips32r2)) { 1967 if (IsMipsArchVariant(kMips32r2)) {
1965 const int kTableLength = 4; 1968 const int kTableLength = 4;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
2022 CodeDesc desc; 2025 CodeDesc desc;
2023 assm.GetCode(&desc); 2026 assm.GetCode(&desc);
2024 Handle<Code> code = isolate->factory()->NewCode( 2027 Handle<Code> code = isolate->factory()->NewCode(
2025 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2028 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2026 F3 f = FUNCTION_CAST<F3>(code->entry()); 2029 F3 f = FUNCTION_CAST<F3>(code->entry());
2027 for (int i = 0; i < kTableLength; i++) { 2030 for (int i = 0; i < kTableLength; i++) {
2028 test.a = inputs_D[i]; 2031 test.a = inputs_D[i];
2029 test.c = inputs_S[i]; 2032 test.c = inputs_S[i];
2030 2033
2031 test.rt = 1; 2034 test.rt = 1;
2032 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2035 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2033 CHECK_EQ(test.b, test.bold); 2036 CHECK_EQ(test.b, test.bold);
2034 CHECK_EQ(test.d, test.dold); 2037 CHECK_EQ(test.d, test.dold);
2035 CHECK_EQ(test.b1, outputs_D[i]); 2038 CHECK_EQ(test.b1, outputs_D[i]);
2036 CHECK_EQ(test.d1, outputs_S[i]); 2039 CHECK_EQ(test.d1, outputs_S[i]);
2037 2040
2038 test.rt = 0; 2041 test.rt = 0;
2039 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2042 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2040 CHECK_EQ(test.b, outputs_D[i]); 2043 CHECK_EQ(test.b, outputs_D[i]);
2041 CHECK_EQ(test.d, outputs_S[i]); 2044 CHECK_EQ(test.d, outputs_S[i]);
2042 CHECK_EQ(test.b1, test.bold1); 2045 CHECK_EQ(test.b1, test.bold1);
2043 CHECK_EQ(test.d1, test.dold1); 2046 CHECK_EQ(test.d1, test.dold1);
2044 } 2047 }
2045 } 2048 }
2046 } 2049 }
2047 2050
2048 2051
2049 TEST(movt_movd) { 2052 TEST(movt_movd) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
2119 __ ctc1(t0, FCSR); 2122 __ ctc1(t0, FCSR);
2120 __ jr(ra); 2123 __ jr(ra);
2121 __ nop(); 2124 __ nop();
2122 2125
2123 CodeDesc desc; 2126 CodeDesc desc;
2124 assm.GetCode(&desc); 2127 assm.GetCode(&desc);
2125 Handle<Code> code = isolate->factory()->NewCode( 2128 Handle<Code> code = isolate->factory()->NewCode(
2126 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2129 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2127 F3 f = FUNCTION_CAST<F3>(code->entry()); 2130 F3 f = FUNCTION_CAST<F3>(code->entry());
2128 2131
2129 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2132 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2130 CHECK_EQ(test.dstf, outputs_S[i]); 2133 CHECK_EQ(test.dstf, outputs_S[i]);
2131 CHECK_EQ(test.dstd, outputs_D[i]); 2134 CHECK_EQ(test.dstd, outputs_D[i]);
2132 CHECK_EQ(test.dstf1, test.dstfold1); 2135 CHECK_EQ(test.dstf1, test.dstfold1);
2133 CHECK_EQ(test.dstd1, test.dstdold1); 2136 CHECK_EQ(test.dstd1, test.dstdold1);
2134 test.fcsr = 0; 2137 test.fcsr = 0;
2135 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2138 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2136 CHECK_EQ(test.dstf, test.dstfold); 2139 CHECK_EQ(test.dstf, test.dstfold);
2137 CHECK_EQ(test.dstd, test.dstdold); 2140 CHECK_EQ(test.dstd, test.dstdold);
2138 CHECK_EQ(test.dstf1, outputs_S[i]); 2141 CHECK_EQ(test.dstf1, outputs_S[i]);
2139 CHECK_EQ(test.dstd1, outputs_D[i]); 2142 CHECK_EQ(test.dstd1, outputs_D[i]);
2140 } 2143 }
2141 } 2144 }
2142 } 2145 }
2143 } 2146 }
2144 2147
2145 2148
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
2207 Test test; 2210 Test test;
2208 CodeDesc desc; 2211 CodeDesc desc;
2209 assm.GetCode(&desc); 2212 assm.GetCode(&desc);
2210 Handle<Code> code = isolate->factory()->NewCode( 2213 Handle<Code> code = isolate->factory()->NewCode(
2211 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2214 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2212 F3 f = FUNCTION_CAST<F3>(code->entry()); 2215 F3 f = FUNCTION_CAST<F3>(code->entry());
2213 for (int j = 0; j < 4; j++) { 2216 for (int j = 0; j < 4; j++) {
2214 test.fcsr = fcsr_inputs[j]; 2217 test.fcsr = fcsr_inputs[j];
2215 for (int i = 0; i < kTableLength; i++) { 2218 for (int i = 0; i < kTableLength; i++) {
2216 test.a = inputs[i]; 2219 test.a = inputs[i];
2217 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2220 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2218 CHECK_EQ(test.b, outputs[j][i]); 2221 CHECK_EQ(test.b, outputs[j][i]);
2219 } 2222 }
2220 } 2223 }
2221 } 2224 }
2222 2225
2223 2226
2224 TEST(trunc_w) { 2227 TEST(trunc_w) {
2225 CcTest::InitializeVM(); 2228 CcTest::InitializeVM();
2226 Isolate* isolate = CcTest::i_isolate(); 2229 Isolate* isolate = CcTest::i_isolate();
2227 HandleScope scope(isolate); 2230 HandleScope scope(isolate);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 __ nop(); 2267 __ nop();
2265 Test test; 2268 Test test;
2266 CodeDesc desc; 2269 CodeDesc desc;
2267 assm.GetCode(&desc); 2270 assm.GetCode(&desc);
2268 Handle<Code> code = isolate->factory()->NewCode( 2271 Handle<Code> code = isolate->factory()->NewCode(
2269 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2272 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2270 F3 f = FUNCTION_CAST<F3>(code->entry()); 2273 F3 f = FUNCTION_CAST<F3>(code->entry());
2271 for (int i = 0; i < kTableLength; i++) { 2274 for (int i = 0; i < kTableLength; i++) {
2272 test.a = inputs_D[i]; 2275 test.a = inputs_D[i];
2273 test.b = inputs_S[i]; 2276 test.b = inputs_S[i];
2274 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2277 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2275 CHECK_EQ(test.c, outputs[i]); 2278 CHECK_EQ(test.c, outputs[i]);
2276 CHECK_EQ(test.d, test.c); 2279 CHECK_EQ(test.d, test.c);
2277 } 2280 }
2278 } 2281 }
2279 2282
2280 2283
2281 TEST(round_w) { 2284 TEST(round_w) {
2282 CcTest::InitializeVM(); 2285 CcTest::InitializeVM();
2283 Isolate* isolate = CcTest::i_isolate(); 2286 Isolate* isolate = CcTest::i_isolate();
2284 HandleScope scope(isolate); 2287 HandleScope scope(isolate);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2321 __ nop(); 2324 __ nop();
2322 Test test; 2325 Test test;
2323 CodeDesc desc; 2326 CodeDesc desc;
2324 assm.GetCode(&desc); 2327 assm.GetCode(&desc);
2325 Handle<Code> code = isolate->factory()->NewCode( 2328 Handle<Code> code = isolate->factory()->NewCode(
2326 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2329 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2327 F3 f = FUNCTION_CAST<F3>(code->entry()); 2330 F3 f = FUNCTION_CAST<F3>(code->entry());
2328 for (int i = 0; i < kTableLength; i++) { 2331 for (int i = 0; i < kTableLength; i++) {
2329 test.a = inputs_D[i]; 2332 test.a = inputs_D[i];
2330 test.b = inputs_S[i]; 2333 test.b = inputs_S[i];
2331 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2334 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2332 CHECK_EQ(test.c, outputs[i]); 2335 CHECK_EQ(test.c, outputs[i]);
2333 CHECK_EQ(test.d, test.c); 2336 CHECK_EQ(test.d, test.c);
2334 } 2337 }
2335 } 2338 }
2336 2339
2337 2340
2338 TEST(round_l) { 2341 TEST(round_l) {
2339 if (IsFp64Mode()) { 2342 if (IsFp64Mode()) {
2340 CcTest::InitializeVM(); 2343 CcTest::InitializeVM();
2341 Isolate* isolate = CcTest::i_isolate(); 2344 Isolate* isolate = CcTest::i_isolate();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2379 __ nop(); 2382 __ nop();
2380 Test test; 2383 Test test;
2381 CodeDesc desc; 2384 CodeDesc desc;
2382 assm.GetCode(&desc); 2385 assm.GetCode(&desc);
2383 Handle<Code> code = isolate->factory()->NewCode( 2386 Handle<Code> code = isolate->factory()->NewCode(
2384 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2387 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2385 F3 f = FUNCTION_CAST<F3>(code->entry()); 2388 F3 f = FUNCTION_CAST<F3>(code->entry());
2386 for (int i = 0; i < kTableLength; i++) { 2389 for (int i = 0; i < kTableLength; i++) {
2387 test.a = inputs_D[i]; 2390 test.a = inputs_D[i];
2388 test.b = inputs_S[i]; 2391 test.b = inputs_S[i];
2389 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2392 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2390 CHECK_EQ(test.c, outputs[i]); 2393 CHECK_EQ(test.c, outputs[i]);
2391 CHECK_EQ(test.d, test.c); 2394 CHECK_EQ(test.d, test.c);
2392 } 2395 }
2393 } 2396 }
2394 } 2397 }
2395 2398
2396 2399
2397 TEST(sub) { 2400 TEST(sub) {
2398 const int kTableLength = 12; 2401 const int kTableLength = 12;
2399 CcTest::InitializeVM(); 2402 CcTest::InitializeVM();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
2449 CodeDesc desc; 2452 CodeDesc desc;
2450 assm.GetCode(&desc); 2453 assm.GetCode(&desc);
2451 Handle<Code> code = isolate->factory()->NewCode( 2454 Handle<Code> code = isolate->factory()->NewCode(
2452 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2455 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2453 F3 f = FUNCTION_CAST<F3>(code->entry()); 2456 F3 f = FUNCTION_CAST<F3>(code->entry());
2454 for (int i = 0; i < kTableLength; i++) { 2457 for (int i = 0; i < kTableLength; i++) {
2455 test.a = inputfs_S[i]; 2458 test.a = inputfs_S[i];
2456 test.b = inputft_S[i]; 2459 test.b = inputft_S[i];
2457 test.c = inputfs_D[i]; 2460 test.c = inputfs_D[i];
2458 test.d = inputft_D[i]; 2461 test.d = inputft_D[i];
2459 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2462 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2460 CHECK_EQ(test.resultS, outputs_S[i]); 2463 CHECK_EQ(test.resultS, outputs_S[i]);
2461 CHECK_EQ(test.resultD, outputs_D[i]); 2464 CHECK_EQ(test.resultD, outputs_D[i]);
2462 } 2465 }
2463 } 2466 }
2464 2467
2465 2468
2466 TEST(sqrt_rsqrt_recip) { 2469 TEST(sqrt_rsqrt_recip) {
2467 const int kTableLength = 4; 2470 const int kTableLength = 4;
2468 const double deltaDouble = 2E-15; 2471 const double deltaDouble = 2E-15;
2469 const float deltaFloat = 2E-7; 2472 const float deltaFloat = 2E-7;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
2530 Handle<Code> code = isolate->factory()->NewCode( 2533 Handle<Code> code = isolate->factory()->NewCode(
2531 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2534 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2532 F3 f = FUNCTION_CAST<F3>(code->entry()); 2535 F3 f = FUNCTION_CAST<F3>(code->entry());
2533 2536
2534 for (int i = 0; i < kTableLength; i++) { 2537 for (int i = 0; i < kTableLength; i++) {
2535 float f1; 2538 float f1;
2536 double d1; 2539 double d1;
2537 test.a = inputs_S[i]; 2540 test.a = inputs_S[i];
2538 test.c = inputs_D[i]; 2541 test.c = inputs_D[i];
2539 2542
2540 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2543 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2541 2544
2542 CHECK_EQ(test.resultS, outputs_S[i]); 2545 CHECK_EQ(test.resultS, outputs_S[i]);
2543 CHECK_EQ(test.resultD, outputs_D[i]); 2546 CHECK_EQ(test.resultD, outputs_D[i]);
2544 2547
2545 if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) { 2548 if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
2546 if (i != 0) { 2549 if (i != 0) {
2547 f1 = test.resultS1 - 1.0F/outputs_S[i]; 2550 f1 = test.resultS1 - 1.0F/outputs_S[i];
2548 f1 = (f1 < 0) ? f1 : -f1; 2551 f1 = (f1 < 0) ? f1 : -f1;
2549 CHECK(f1 <= deltaFloat); 2552 CHECK(f1 <= deltaFloat);
2550 d1 = test.resultD1 - 1.0L/outputs_D[i]; 2553 d1 = test.resultD1 - 1.0L/outputs_D[i];
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
2606 __ nop(); 2609 __ nop();
2607 2610
2608 CodeDesc desc; 2611 CodeDesc desc;
2609 assm.GetCode(&desc); 2612 assm.GetCode(&desc);
2610 Handle<Code> code = isolate->factory()->NewCode( 2613 Handle<Code> code = isolate->factory()->NewCode(
2611 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2614 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2612 F3 f = FUNCTION_CAST<F3>(code->entry()); 2615 F3 f = FUNCTION_CAST<F3>(code->entry());
2613 for (int i = 0; i < kTableLength; i++) { 2616 for (int i = 0; i < kTableLength; i++) {
2614 test.a = inputs_S[i]; 2617 test.a = inputs_S[i];
2615 test.c = inputs_D[i]; 2618 test.c = inputs_D[i];
2616 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2619 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2617 CHECK_EQ(test.resultS, outputs_S[i]); 2620 CHECK_EQ(test.resultS, outputs_S[i]);
2618 CHECK_EQ(test.resultD, outputs_D[i]); 2621 CHECK_EQ(test.resultD, outputs_D[i]);
2619 } 2622 }
2620 } 2623 }
2621 2624
2622 2625
2623 TEST(mul) { 2626 TEST(mul) {
2624 const int kTableLength = 4; 2627 const int kTableLength = 4;
2625 CcTest::InitializeVM(); 2628 CcTest::InitializeVM();
2626 Isolate* isolate = CcTest::i_isolate(); 2629 Isolate* isolate = CcTest::i_isolate();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2665 CodeDesc desc; 2668 CodeDesc desc;
2666 assm.GetCode(&desc); 2669 assm.GetCode(&desc);
2667 Handle<Code> code = isolate->factory()->NewCode( 2670 Handle<Code> code = isolate->factory()->NewCode(
2668 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2671 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2669 F3 f = FUNCTION_CAST<F3>(code->entry()); 2672 F3 f = FUNCTION_CAST<F3>(code->entry());
2670 for (int i = 0; i < kTableLength; i++) { 2673 for (int i = 0; i < kTableLength; i++) {
2671 test.a = inputfs_S[i]; 2674 test.a = inputfs_S[i];
2672 test.b = inputft_S[i]; 2675 test.b = inputft_S[i];
2673 test.c = inputfs_D[i]; 2676 test.c = inputfs_D[i];
2674 test.d = inputft_D[i]; 2677 test.d = inputft_D[i];
2675 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2678 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2676 CHECK_EQ(test.resultS, inputfs_S[i]*inputft_S[i]); 2679 CHECK_EQ(test.resultS, inputfs_S[i]*inputft_S[i]);
2677 CHECK_EQ(test.resultD, inputfs_D[i]*inputft_D[i]); 2680 CHECK_EQ(test.resultD, inputfs_D[i]*inputft_D[i]);
2678 } 2681 }
2679 } 2682 }
2680 2683
2681 2684
2682 TEST(mov) { 2685 TEST(mov) {
2683 const int kTableLength = 4; 2686 const int kTableLength = 4;
2684 CcTest::InitializeVM(); 2687 CcTest::InitializeVM();
2685 Isolate* isolate = CcTest::i_isolate(); 2688 Isolate* isolate = CcTest::i_isolate();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
2720 2723
2721 CodeDesc desc; 2724 CodeDesc desc;
2722 assm.GetCode(&desc); 2725 assm.GetCode(&desc);
2723 Handle<Code> code = isolate->factory()->NewCode( 2726 Handle<Code> code = isolate->factory()->NewCode(
2724 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2727 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2725 F3 f = FUNCTION_CAST<F3>(code->entry()); 2728 F3 f = FUNCTION_CAST<F3>(code->entry());
2726 for (int i = 0; i < kTableLength; i++) { 2729 for (int i = 0; i < kTableLength; i++) {
2727 test.a = inputs_D[i]; 2730 test.a = inputs_D[i];
2728 test.c = inputs_S[i]; 2731 test.c = inputs_S[i];
2729 2732
2730 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2733 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2731 CHECK_EQ(test.b, outputs_D[i]); 2734 CHECK_EQ(test.b, outputs_D[i]);
2732 CHECK_EQ(test.d, outputs_S[i]); 2735 CHECK_EQ(test.d, outputs_S[i]);
2733 } 2736 }
2734 } 2737 }
2735 2738
2736 2739
2737 TEST(floor_w) { 2740 TEST(floor_w) {
2738 CcTest::InitializeVM(); 2741 CcTest::InitializeVM();
2739 Isolate* isolate = CcTest::i_isolate(); 2742 Isolate* isolate = CcTest::i_isolate();
2740 HandleScope scope(isolate); 2743 HandleScope scope(isolate);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2777 __ nop(); 2780 __ nop();
2778 Test test; 2781 Test test;
2779 CodeDesc desc; 2782 CodeDesc desc;
2780 assm.GetCode(&desc); 2783 assm.GetCode(&desc);
2781 Handle<Code> code = isolate->factory()->NewCode( 2784 Handle<Code> code = isolate->factory()->NewCode(
2782 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2785 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2783 F3 f = FUNCTION_CAST<F3>(code->entry()); 2786 F3 f = FUNCTION_CAST<F3>(code->entry());
2784 for (int i = 0; i < kTableLength; i++) { 2787 for (int i = 0; i < kTableLength; i++) {
2785 test.a = inputs_D[i]; 2788 test.a = inputs_D[i];
2786 test.b = inputs_S[i]; 2789 test.b = inputs_S[i];
2787 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2790 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2788 CHECK_EQ(test.c, outputs[i]); 2791 CHECK_EQ(test.c, outputs[i]);
2789 CHECK_EQ(test.d, test.c); 2792 CHECK_EQ(test.d, test.c);
2790 } 2793 }
2791 } 2794 }
2792 2795
2793 2796
2794 TEST(floor_l) { 2797 TEST(floor_l) {
2795 if (IsFp64Mode()) { 2798 if (IsFp64Mode()) {
2796 CcTest::InitializeVM(); 2799 CcTest::InitializeVM();
2797 Isolate* isolate = CcTest::i_isolate(); 2800 Isolate* isolate = CcTest::i_isolate();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2835 __ nop(); 2838 __ nop();
2836 Test test; 2839 Test test;
2837 CodeDesc desc; 2840 CodeDesc desc;
2838 assm.GetCode(&desc); 2841 assm.GetCode(&desc);
2839 Handle<Code> code = isolate->factory()->NewCode( 2842 Handle<Code> code = isolate->factory()->NewCode(
2840 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2843 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2841 F3 f = FUNCTION_CAST<F3>(code->entry()); 2844 F3 f = FUNCTION_CAST<F3>(code->entry());
2842 for (int i = 0; i < kTableLength; i++) { 2845 for (int i = 0; i < kTableLength; i++) {
2843 test.a = inputs_D[i]; 2846 test.a = inputs_D[i];
2844 test.b = inputs_S[i]; 2847 test.b = inputs_S[i];
2845 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2848 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2846 CHECK_EQ(test.c, outputs[i]); 2849 CHECK_EQ(test.c, outputs[i]);
2847 CHECK_EQ(test.d, test.c); 2850 CHECK_EQ(test.d, test.c);
2848 } 2851 }
2849 } 2852 }
2850 } 2853 }
2851 2854
2852 2855
2853 TEST(ceil_w) { 2856 TEST(ceil_w) {
2854 CcTest::InitializeVM(); 2857 CcTest::InitializeVM();
2855 Isolate* isolate = CcTest::i_isolate(); 2858 Isolate* isolate = CcTest::i_isolate();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2893 __ nop(); 2896 __ nop();
2894 Test test; 2897 Test test;
2895 CodeDesc desc; 2898 CodeDesc desc;
2896 assm.GetCode(&desc); 2899 assm.GetCode(&desc);
2897 Handle<Code> code = isolate->factory()->NewCode( 2900 Handle<Code> code = isolate->factory()->NewCode(
2898 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2901 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2899 F3 f = FUNCTION_CAST<F3>(code->entry()); 2902 F3 f = FUNCTION_CAST<F3>(code->entry());
2900 for (int i = 0; i < kTableLength; i++) { 2903 for (int i = 0; i < kTableLength; i++) {
2901 test.a = inputs_D[i]; 2904 test.a = inputs_D[i];
2902 test.b = inputs_S[i]; 2905 test.b = inputs_S[i];
2903 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2906 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2904 CHECK_EQ(test.c, outputs[i]); 2907 CHECK_EQ(test.c, outputs[i]);
2905 CHECK_EQ(test.d, test.c); 2908 CHECK_EQ(test.d, test.c);
2906 } 2909 }
2907 } 2910 }
2908 2911
2909 2912
2910 TEST(ceil_l) { 2913 TEST(ceil_l) {
2911 if (IsFp64Mode()) { 2914 if (IsFp64Mode()) {
2912 CcTest::InitializeVM(); 2915 CcTest::InitializeVM();
2913 Isolate* isolate = CcTest::i_isolate(); 2916 Isolate* isolate = CcTest::i_isolate();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2951 __ nop(); 2954 __ nop();
2952 Test test; 2955 Test test;
2953 CodeDesc desc; 2956 CodeDesc desc;
2954 assm.GetCode(&desc); 2957 assm.GetCode(&desc);
2955 Handle<Code> code = isolate->factory()->NewCode( 2958 Handle<Code> code = isolate->factory()->NewCode(
2956 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 2959 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
2957 F3 f = FUNCTION_CAST<F3>(code->entry()); 2960 F3 f = FUNCTION_CAST<F3>(code->entry());
2958 for (int i = 0; i < kTableLength; i++) { 2961 for (int i = 0; i < kTableLength; i++) {
2959 test.a = inputs_D[i]; 2962 test.a = inputs_D[i];
2960 test.b = inputs_S[i]; 2963 test.b = inputs_S[i];
2961 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 2964 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
2962 CHECK_EQ(test.c, outputs[i]); 2965 CHECK_EQ(test.c, outputs[i]);
2963 CHECK_EQ(test.d, test.c); 2966 CHECK_EQ(test.d, test.c);
2964 } 2967 }
2965 } 2968 }
2966 } 2969 }
2967 2970
2968 2971
2969 TEST(jump_tables1) { 2972 TEST(jump_tables1) {
2970 // Test jump tables with forward jumps. 2973 // Test jump tables with forward jumps.
2971 CcTest::InitializeVM(); 2974 CcTest::InitializeVM();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
3017 3020
3018 CodeDesc desc; 3021 CodeDesc desc;
3019 assm.GetCode(&desc); 3022 assm.GetCode(&desc);
3020 Handle<Code> code = isolate->factory()->NewCode( 3023 Handle<Code> code = isolate->factory()->NewCode(
3021 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3024 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3022 #ifdef OBJECT_PRINT 3025 #ifdef OBJECT_PRINT
3023 code->Print(std::cout); 3026 code->Print(std::cout);
3024 #endif 3027 #endif
3025 F1 f = FUNCTION_CAST<F1>(code->entry()); 3028 F1 f = FUNCTION_CAST<F1>(code->entry());
3026 for (int i = 0; i < kNumCases; ++i) { 3029 for (int i = 0; i < kNumCases; ++i) {
3027 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0)); 3030 int res = reinterpret_cast<int>(
3031 CALL_GENERATED_CODE(isolate, f, i, 0, 0, 0, 0));
3028 ::printf("f(%d) = %d\n", i, res); 3032 ::printf("f(%d) = %d\n", i, res);
3029 CHECK_EQ(values[i], res); 3033 CHECK_EQ(values[i], res);
3030 } 3034 }
3031 } 3035 }
3032 3036
3033 3037
3034 TEST(jump_tables2) { 3038 TEST(jump_tables2) {
3035 // Test jump tables with backward jumps. 3039 // Test jump tables with backward jumps.
3036 CcTest::InitializeVM(); 3040 CcTest::InitializeVM();
3037 Isolate* isolate = CcTest::i_isolate(); 3041 Isolate* isolate = CcTest::i_isolate();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
3086 3090
3087 CodeDesc desc; 3091 CodeDesc desc;
3088 assm.GetCode(&desc); 3092 assm.GetCode(&desc);
3089 Handle<Code> code = isolate->factory()->NewCode( 3093 Handle<Code> code = isolate->factory()->NewCode(
3090 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3094 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3091 #ifdef OBJECT_PRINT 3095 #ifdef OBJECT_PRINT
3092 code->Print(std::cout); 3096 code->Print(std::cout);
3093 #endif 3097 #endif
3094 F1 f = FUNCTION_CAST<F1>(code->entry()); 3098 F1 f = FUNCTION_CAST<F1>(code->entry());
3095 for (int i = 0; i < kNumCases; ++i) { 3099 for (int i = 0; i < kNumCases; ++i) {
3096 int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0)); 3100 int res = reinterpret_cast<int>(
3101 CALL_GENERATED_CODE(isolate, f, i, 0, 0, 0, 0));
3097 ::printf("f(%d) = %d\n", i, res); 3102 ::printf("f(%d) = %d\n", i, res);
3098 CHECK_EQ(values[i], res); 3103 CHECK_EQ(values[i], res);
3099 } 3104 }
3100 } 3105 }
3101 3106
3102 3107
3103 TEST(jump_tables3) { 3108 TEST(jump_tables3) {
3104 // Test jump tables with backward jumps and embedded heap objects. 3109 // Test jump tables with backward jumps and embedded heap objects.
3105 CcTest::InitializeVM(); 3110 CcTest::InitializeVM();
3106 Isolate* isolate = CcTest::i_isolate(); 3111 Isolate* isolate = CcTest::i_isolate();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
3162 3167
3163 CodeDesc desc; 3168 CodeDesc desc;
3164 assm.GetCode(&desc); 3169 assm.GetCode(&desc);
3165 Handle<Code> code = isolate->factory()->NewCode( 3170 Handle<Code> code = isolate->factory()->NewCode(
3166 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3171 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3167 #ifdef OBJECT_PRINT 3172 #ifdef OBJECT_PRINT
3168 code->Print(std::cout); 3173 code->Print(std::cout);
3169 #endif 3174 #endif
3170 F1 f = FUNCTION_CAST<F1>(code->entry()); 3175 F1 f = FUNCTION_CAST<F1>(code->entry());
3171 for (int i = 0; i < kNumCases; ++i) { 3176 for (int i = 0; i < kNumCases; ++i) {
3172 Handle<Object> result(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0), isolate); 3177 Handle<Object> result(
3178 CALL_GENERATED_CODE(isolate, f, i, 0, 0, 0, 0), isolate);
3173 #ifdef OBJECT_PRINT 3179 #ifdef OBJECT_PRINT
3174 ::printf("f(%d) = ", i); 3180 ::printf("f(%d) = ", i);
3175 result->Print(std::cout); 3181 result->Print(std::cout);
3176 ::printf("\n"); 3182 ::printf("\n");
3177 #endif 3183 #endif
3178 CHECK(values[i].is_identical_to(result)); 3184 CHECK(values[i].is_identical_to(result));
3179 } 3185 }
3180 } 3186 }
3181 3187
3182 3188
(...skipping 27 matching lines...) Expand all
3210 __ jr(ra); 3216 __ jr(ra);
3211 __ nop(); 3217 __ nop();
3212 3218
3213 CodeDesc desc; 3219 CodeDesc desc;
3214 assm.GetCode(&desc); 3220 assm.GetCode(&desc);
3215 Handle<Code> code = isolate->factory()->NewCode( 3221 Handle<Code> code = isolate->factory()->NewCode(
3216 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3222 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3217 F3 f = FUNCTION_CAST<F3>(code->entry()); 3223 F3 f = FUNCTION_CAST<F3>(code->entry());
3218 t.r1 = 0x781A15C3; 3224 t.r1 = 0x781A15C3;
3219 t.r2 = 0x8B71FCDE; 3225 t.r2 = 0x8B71FCDE;
3220 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 3226 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
3221 USE(dummy); 3227 USE(dummy);
3222 3228
3223 CHECK_EQ(static_cast<int32_t>(0x1E58A8C3), t.r1); 3229 CHECK_EQ(static_cast<int32_t>(0x1E58A8C3), t.r1);
3224 CHECK_EQ(static_cast<int32_t>(0xD18E3F7B), t.r2); 3230 CHECK_EQ(static_cast<int32_t>(0xD18E3F7B), t.r2);
3225 } 3231 }
3226 } 3232 }
3227 3233
3228 3234
3229 TEST(class_fmt) { 3235 TEST(class_fmt) {
3230 if (IsMipsArchVariant(kMips32r6)) { 3236 if (IsMipsArchVariant(kMips32r6)) {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
3366 t.fQuietNan = std::numeric_limits<float>::quiet_NaN(); 3372 t.fQuietNan = std::numeric_limits<float>::quiet_NaN();
3367 t.fNegInf = -0.5/0.0; 3373 t.fNegInf = -0.5/0.0;
3368 t.fNegNorm = -FLT_MIN; 3374 t.fNegNorm = -FLT_MIN;
3369 t.fNegSubnorm = -FLT_MIN / 1.5; 3375 t.fNegSubnorm = -FLT_MIN / 1.5;
3370 t.fNegZero = -0.0; 3376 t.fNegZero = -0.0;
3371 t.fPosInf = 100000.0 / 0.0; 3377 t.fPosInf = 100000.0 / 0.0;
3372 t.fPosNorm = FLT_MAX; 3378 t.fPosNorm = FLT_MAX;
3373 t.fPosSubnorm = FLT_MIN / 20.0; 3379 t.fPosSubnorm = FLT_MIN / 20.0;
3374 t.fPosZero = +0.0; 3380 t.fPosZero = +0.0;
3375 3381
3376 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); 3382 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0);
3377 USE(dummy); 3383 USE(dummy);
3378 // Expected double results. 3384 // Expected double results.
3379 CHECK_EQ(bit_cast<int64_t>(t.dSignalingNan), 0x001); 3385 CHECK_EQ(bit_cast<int64_t>(t.dSignalingNan), 0x001);
3380 CHECK_EQ(bit_cast<int64_t>(t.dQuietNan), 0x002); 3386 CHECK_EQ(bit_cast<int64_t>(t.dQuietNan), 0x002);
3381 CHECK_EQ(bit_cast<int64_t>(t.dNegInf), 0x004); 3387 CHECK_EQ(bit_cast<int64_t>(t.dNegInf), 0x004);
3382 CHECK_EQ(bit_cast<int64_t>(t.dNegNorm), 0x008); 3388 CHECK_EQ(bit_cast<int64_t>(t.dNegNorm), 0x008);
3383 CHECK_EQ(bit_cast<int64_t>(t.dNegSubnorm), 0x010); 3389 CHECK_EQ(bit_cast<int64_t>(t.dNegSubnorm), 0x010);
3384 CHECK_EQ(bit_cast<int64_t>(t.dNegZero), 0x020); 3390 CHECK_EQ(bit_cast<int64_t>(t.dNegZero), 0x020);
3385 CHECK_EQ(bit_cast<int64_t>(t.dPosInf), 0x040); 3391 CHECK_EQ(bit_cast<int64_t>(t.dPosInf), 0x040);
3386 CHECK_EQ(bit_cast<int64_t>(t.dPosNorm), 0x080); 3392 CHECK_EQ(bit_cast<int64_t>(t.dPosNorm), 0x080);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
3436 __ jr(ra); 3442 __ jr(ra);
3437 __ nop(); 3443 __ nop();
3438 3444
3439 CodeDesc desc; 3445 CodeDesc desc;
3440 assm.GetCode(&desc); 3446 assm.GetCode(&desc);
3441 Handle<Code> code = isolate->factory()->NewCode( 3447 Handle<Code> code = isolate->factory()->NewCode(
3442 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3448 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3443 F3 f = FUNCTION_CAST<F3>(code->entry()); 3449 F3 f = FUNCTION_CAST<F3>(code->entry());
3444 test.a = -2.0; 3450 test.a = -2.0;
3445 test.b = -2.0; 3451 test.b = -2.0;
3446 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3452 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3447 CHECK_EQ(test.a, 2.0); 3453 CHECK_EQ(test.a, 2.0);
3448 CHECK_EQ(test.b, 2.0); 3454 CHECK_EQ(test.b, 2.0);
3449 3455
3450 test.a = 2.0; 3456 test.a = 2.0;
3451 test.b = 2.0; 3457 test.b = 2.0;
3452 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3458 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3453 CHECK_EQ(test.a, 2.0); 3459 CHECK_EQ(test.a, 2.0);
3454 CHECK_EQ(test.b, 2.0); 3460 CHECK_EQ(test.b, 2.0);
3455 3461
3456 // Testing biggest positive number 3462 // Testing biggest positive number
3457 test.a = std::numeric_limits<double>::max(); 3463 test.a = std::numeric_limits<double>::max();
3458 test.b = std::numeric_limits<float>::max(); 3464 test.b = std::numeric_limits<float>::max();
3459 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3465 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3460 CHECK_EQ(test.a, std::numeric_limits<double>::max()); 3466 CHECK_EQ(test.a, std::numeric_limits<double>::max());
3461 CHECK_EQ(test.b, std::numeric_limits<float>::max()); 3467 CHECK_EQ(test.b, std::numeric_limits<float>::max());
3462 3468
3463 // Testing smallest negative number 3469 // Testing smallest negative number
3464 test.a = -std::numeric_limits<double>::max(); // lowest() 3470 test.a = -std::numeric_limits<double>::max(); // lowest()
3465 test.b = -std::numeric_limits<float>::max(); // lowest() 3471 test.b = -std::numeric_limits<float>::max(); // lowest()
3466 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3472 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3467 CHECK_EQ(test.a, std::numeric_limits<double>::max()); 3473 CHECK_EQ(test.a, std::numeric_limits<double>::max());
3468 CHECK_EQ(test.b, std::numeric_limits<float>::max()); 3474 CHECK_EQ(test.b, std::numeric_limits<float>::max());
3469 3475
3470 // Testing smallest positive number 3476 // Testing smallest positive number
3471 test.a = -std::numeric_limits<double>::min(); 3477 test.a = -std::numeric_limits<double>::min();
3472 test.b = -std::numeric_limits<float>::min(); 3478 test.b = -std::numeric_limits<float>::min();
3473 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3479 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3474 CHECK_EQ(test.a, std::numeric_limits<double>::min()); 3480 CHECK_EQ(test.a, std::numeric_limits<double>::min());
3475 CHECK_EQ(test.b, std::numeric_limits<float>::min()); 3481 CHECK_EQ(test.b, std::numeric_limits<float>::min());
3476 3482
3477 // Testing infinity 3483 // Testing infinity
3478 test.a = -std::numeric_limits<double>::max() 3484 test.a = -std::numeric_limits<double>::max()
3479 / std::numeric_limits<double>::min(); 3485 / std::numeric_limits<double>::min();
3480 test.b = -std::numeric_limits<float>::max() 3486 test.b = -std::numeric_limits<float>::max()
3481 / std::numeric_limits<float>::min(); 3487 / std::numeric_limits<float>::min();
3482 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3488 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3483 CHECK_EQ(test.a, std::numeric_limits<double>::max() 3489 CHECK_EQ(test.a, std::numeric_limits<double>::max()
3484 / std::numeric_limits<double>::min()); 3490 / std::numeric_limits<double>::min());
3485 CHECK_EQ(test.b, std::numeric_limits<float>::max() 3491 CHECK_EQ(test.b, std::numeric_limits<float>::max()
3486 / std::numeric_limits<float>::min()); 3492 / std::numeric_limits<float>::min());
3487 3493
3488 test.a = std::numeric_limits<double>::quiet_NaN(); 3494 test.a = std::numeric_limits<double>::quiet_NaN();
3489 test.b = std::numeric_limits<float>::quiet_NaN(); 3495 test.b = std::numeric_limits<float>::quiet_NaN();
3490 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3496 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3491 CHECK_EQ(std::isnan(test.a), true); 3497 CHECK_EQ(std::isnan(test.a), true);
3492 CHECK_EQ(std::isnan(test.b), true); 3498 CHECK_EQ(std::isnan(test.b), true);
3493 3499
3494 test.a = std::numeric_limits<double>::signaling_NaN(); 3500 test.a = std::numeric_limits<double>::signaling_NaN();
3495 test.b = std::numeric_limits<float>::signaling_NaN(); 3501 test.b = std::numeric_limits<float>::signaling_NaN();
3496 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3502 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3497 CHECK_EQ(std::isnan(test.a), true); 3503 CHECK_EQ(std::isnan(test.a), true);
3498 CHECK_EQ(std::isnan(test.b), true); 3504 CHECK_EQ(std::isnan(test.b), true);
3499 } 3505 }
3500 3506
3501 3507
3502 TEST(ADD_FMT) { 3508 TEST(ADD_FMT) {
3503 CcTest::InitializeVM(); 3509 CcTest::InitializeVM();
3504 Isolate* isolate = CcTest::i_isolate(); 3510 Isolate* isolate = CcTest::i_isolate();
3505 HandleScope scope(isolate); 3511 HandleScope scope(isolate);
3506 MacroAssembler assm(isolate, NULL, 0); 3512 MacroAssembler assm(isolate, NULL, 0);
(...skipping 24 matching lines...) Expand all
3531 3537
3532 CodeDesc desc; 3538 CodeDesc desc;
3533 assm.GetCode(&desc); 3539 assm.GetCode(&desc);
3534 Handle<Code> code = isolate->factory()->NewCode( 3540 Handle<Code> code = isolate->factory()->NewCode(
3535 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3541 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3536 F3 f = FUNCTION_CAST<F3>(code->entry()); 3542 F3 f = FUNCTION_CAST<F3>(code->entry());
3537 test.a = 2.0; 3543 test.a = 2.0;
3538 test.b = 3.0; 3544 test.b = 3.0;
3539 test.fa = 2.0; 3545 test.fa = 2.0;
3540 test.fb = 3.0; 3546 test.fb = 3.0;
3541 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3547 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3542 CHECK_EQ(test.c, 5.0); 3548 CHECK_EQ(test.c, 5.0);
3543 CHECK_EQ(test.fc, 5.0); 3549 CHECK_EQ(test.fc, 5.0);
3544 3550
3545 test.a = std::numeric_limits<double>::max(); 3551 test.a = std::numeric_limits<double>::max();
3546 test.b = -std::numeric_limits<double>::max(); // lowest() 3552 test.b = -std::numeric_limits<double>::max(); // lowest()
3547 test.fa = std::numeric_limits<float>::max(); 3553 test.fa = std::numeric_limits<float>::max();
3548 test.fb = -std::numeric_limits<float>::max(); // lowest() 3554 test.fb = -std::numeric_limits<float>::max(); // lowest()
3549 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3555 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3550 CHECK_EQ(test.c, 0.0); 3556 CHECK_EQ(test.c, 0.0);
3551 CHECK_EQ(test.fc, 0.0); 3557 CHECK_EQ(test.fc, 0.0);
3552 3558
3553 test.a = std::numeric_limits<double>::max(); 3559 test.a = std::numeric_limits<double>::max();
3554 test.b = std::numeric_limits<double>::max(); 3560 test.b = std::numeric_limits<double>::max();
3555 test.fa = std::numeric_limits<float>::max(); 3561 test.fa = std::numeric_limits<float>::max();
3556 test.fb = std::numeric_limits<float>::max(); 3562 test.fb = std::numeric_limits<float>::max();
3557 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3563 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3558 CHECK_EQ(std::isfinite(test.c), false); 3564 CHECK_EQ(std::isfinite(test.c), false);
3559 CHECK_EQ(std::isfinite(test.fc), false); 3565 CHECK_EQ(std::isfinite(test.fc), false);
3560 3566
3561 test.a = 5.0; 3567 test.a = 5.0;
3562 test.b = std::numeric_limits<double>::signaling_NaN(); 3568 test.b = std::numeric_limits<double>::signaling_NaN();
3563 test.fa = 5.0; 3569 test.fa = 5.0;
3564 test.fb = std::numeric_limits<float>::signaling_NaN(); 3570 test.fb = std::numeric_limits<float>::signaling_NaN();
3565 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3571 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3566 CHECK_EQ(std::isnan(test.c), true); 3572 CHECK_EQ(std::isnan(test.c), true);
3567 CHECK_EQ(std::isnan(test.fc), true); 3573 CHECK_EQ(std::isnan(test.fc), true);
3568 } 3574 }
3569 3575
3570 3576
3571 TEST(C_COND_FMT) { 3577 TEST(C_COND_FMT) {
3572 if ((IsMipsArchVariant(kMips32r1)) || (IsMipsArchVariant(kMips32r2))) { 3578 if ((IsMipsArchVariant(kMips32r1)) || (IsMipsArchVariant(kMips32r2))) {
3573 CcTest::InitializeVM(); 3579 CcTest::InitializeVM();
3574 Isolate* isolate = CcTest::i_isolate(); 3580 Isolate* isolate = CcTest::i_isolate();
3575 HandleScope scope(isolate); 3581 HandleScope scope(isolate);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
3685 3691
3686 CodeDesc desc; 3692 CodeDesc desc;
3687 assm.GetCode(&desc); 3693 assm.GetCode(&desc);
3688 Handle<Code> code = isolate->factory()->NewCode( 3694 Handle<Code> code = isolate->factory()->NewCode(
3689 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 3695 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
3690 F3 f = FUNCTION_CAST<F3>(code->entry()); 3696 F3 f = FUNCTION_CAST<F3>(code->entry());
3691 test.dOp1 = 2.0; 3697 test.dOp1 = 2.0;
3692 test.dOp2 = 3.0; 3698 test.dOp2 = 3.0;
3693 test.fOp1 = 2.0; 3699 test.fOp1 = 2.0;
3694 test.fOp2 = 3.0; 3700 test.fOp2 = 3.0;
3695 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3701 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3696 CHECK_EQ(test.dF, 0U); 3702 CHECK_EQ(test.dF, 0U);
3697 CHECK_EQ(test.dUn, 0U); 3703 CHECK_EQ(test.dUn, 0U);
3698 CHECK_EQ(test.dEq, 0U); 3704 CHECK_EQ(test.dEq, 0U);
3699 CHECK_EQ(test.dUeq, 0U); 3705 CHECK_EQ(test.dUeq, 0U);
3700 CHECK_EQ(test.dOlt, 1U); 3706 CHECK_EQ(test.dOlt, 1U);
3701 CHECK_EQ(test.dUlt, 1U); 3707 CHECK_EQ(test.dUlt, 1U);
3702 CHECK_EQ(test.dOle, 1U); 3708 CHECK_EQ(test.dOle, 1U);
3703 CHECK_EQ(test.dUle, 1U); 3709 CHECK_EQ(test.dUle, 1U);
3704 CHECK_EQ(test.fF, 0U); 3710 CHECK_EQ(test.fF, 0U);
3705 CHECK_EQ(test.fUn, 0U); 3711 CHECK_EQ(test.fUn, 0U);
3706 CHECK_EQ(test.fEq, 0U); 3712 CHECK_EQ(test.fEq, 0U);
3707 CHECK_EQ(test.fUeq, 0U); 3713 CHECK_EQ(test.fUeq, 0U);
3708 CHECK_EQ(test.fOlt, 1U); 3714 CHECK_EQ(test.fOlt, 1U);
3709 CHECK_EQ(test.fUlt, 1U); 3715 CHECK_EQ(test.fUlt, 1U);
3710 CHECK_EQ(test.fOle, 1U); 3716 CHECK_EQ(test.fOle, 1U);
3711 CHECK_EQ(test.fUle, 1U); 3717 CHECK_EQ(test.fUle, 1U);
3712 3718
3713 test.dOp1 = std::numeric_limits<double>::max(); 3719 test.dOp1 = std::numeric_limits<double>::max();
3714 test.dOp2 = std::numeric_limits<double>::min(); 3720 test.dOp2 = std::numeric_limits<double>::min();
3715 test.fOp1 = std::numeric_limits<float>::min(); 3721 test.fOp1 = std::numeric_limits<float>::min();
3716 test.fOp2 = -std::numeric_limits<float>::max(); // lowest() 3722 test.fOp2 = -std::numeric_limits<float>::max(); // lowest()
3717 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3723 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3718 CHECK_EQ(test.dF, 0U); 3724 CHECK_EQ(test.dF, 0U);
3719 CHECK_EQ(test.dUn, 0U); 3725 CHECK_EQ(test.dUn, 0U);
3720 CHECK_EQ(test.dEq, 0U); 3726 CHECK_EQ(test.dEq, 0U);
3721 CHECK_EQ(test.dUeq, 0U); 3727 CHECK_EQ(test.dUeq, 0U);
3722 CHECK_EQ(test.dOlt, 0U); 3728 CHECK_EQ(test.dOlt, 0U);
3723 CHECK_EQ(test.dUlt, 0U); 3729 CHECK_EQ(test.dUlt, 0U);
3724 CHECK_EQ(test.dOle, 0U); 3730 CHECK_EQ(test.dOle, 0U);
3725 CHECK_EQ(test.dUle, 0U); 3731 CHECK_EQ(test.dUle, 0U);
3726 CHECK_EQ(test.fF, 0U); 3732 CHECK_EQ(test.fF, 0U);
3727 CHECK_EQ(test.fUn, 0U); 3733 CHECK_EQ(test.fUn, 0U);
3728 CHECK_EQ(test.fEq, 0U); 3734 CHECK_EQ(test.fEq, 0U);
3729 CHECK_EQ(test.fUeq, 0U); 3735 CHECK_EQ(test.fUeq, 0U);
3730 CHECK_EQ(test.fOlt, 0U); 3736 CHECK_EQ(test.fOlt, 0U);
3731 CHECK_EQ(test.fUlt, 0U); 3737 CHECK_EQ(test.fUlt, 0U);
3732 CHECK_EQ(test.fOle, 0U); 3738 CHECK_EQ(test.fOle, 0U);
3733 CHECK_EQ(test.fUle, 0U); 3739 CHECK_EQ(test.fUle, 0U);
3734 3740
3735 test.dOp1 = -std::numeric_limits<double>::max(); // lowest() 3741 test.dOp1 = -std::numeric_limits<double>::max(); // lowest()
3736 test.dOp2 = -std::numeric_limits<double>::max(); // lowest() 3742 test.dOp2 = -std::numeric_limits<double>::max(); // lowest()
3737 test.fOp1 = std::numeric_limits<float>::max(); 3743 test.fOp1 = std::numeric_limits<float>::max();
3738 test.fOp2 = std::numeric_limits<float>::max(); 3744 test.fOp2 = std::numeric_limits<float>::max();
3739 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3745 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3740 CHECK_EQ(test.dF, 0U); 3746 CHECK_EQ(test.dF, 0U);
3741 CHECK_EQ(test.dUn, 0U); 3747 CHECK_EQ(test.dUn, 0U);
3742 CHECK_EQ(test.dEq, 1U); 3748 CHECK_EQ(test.dEq, 1U);
3743 CHECK_EQ(test.dUeq, 1U); 3749 CHECK_EQ(test.dUeq, 1U);
3744 CHECK_EQ(test.dOlt, 0U); 3750 CHECK_EQ(test.dOlt, 0U);
3745 CHECK_EQ(test.dUlt, 0U); 3751 CHECK_EQ(test.dUlt, 0U);
3746 CHECK_EQ(test.dOle, 1U); 3752 CHECK_EQ(test.dOle, 1U);
3747 CHECK_EQ(test.dUle, 1U); 3753 CHECK_EQ(test.dUle, 1U);
3748 CHECK_EQ(test.fF, 0U); 3754 CHECK_EQ(test.fF, 0U);
3749 CHECK_EQ(test.fUn, 0U); 3755 CHECK_EQ(test.fUn, 0U);
3750 CHECK_EQ(test.fEq, 1U); 3756 CHECK_EQ(test.fEq, 1U);
3751 CHECK_EQ(test.fUeq, 1U); 3757 CHECK_EQ(test.fUeq, 1U);
3752 CHECK_EQ(test.fOlt, 0U); 3758 CHECK_EQ(test.fOlt, 0U);
3753 CHECK_EQ(test.fUlt, 0U); 3759 CHECK_EQ(test.fUlt, 0U);
3754 CHECK_EQ(test.fOle, 1U); 3760 CHECK_EQ(test.fOle, 1U);
3755 CHECK_EQ(test.fUle, 1U); 3761 CHECK_EQ(test.fUle, 1U);
3756 3762
3757 test.dOp1 = std::numeric_limits<double>::quiet_NaN(); 3763 test.dOp1 = std::numeric_limits<double>::quiet_NaN();
3758 test.dOp2 = 0.0; 3764 test.dOp2 = 0.0;
3759 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); 3765 test.fOp1 = std::numeric_limits<float>::quiet_NaN();
3760 test.fOp2 = 0.0; 3766 test.fOp2 = 0.0;
3761 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3767 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3762 CHECK_EQ(test.dF, 0U); 3768 CHECK_EQ(test.dF, 0U);
3763 CHECK_EQ(test.dUn, 1U); 3769 CHECK_EQ(test.dUn, 1U);
3764 CHECK_EQ(test.dEq, 0U); 3770 CHECK_EQ(test.dEq, 0U);
3765 CHECK_EQ(test.dUeq, 1U); 3771 CHECK_EQ(test.dUeq, 1U);
3766 CHECK_EQ(test.dOlt, 0U); 3772 CHECK_EQ(test.dOlt, 0U);
3767 CHECK_EQ(test.dUlt, 1U); 3773 CHECK_EQ(test.dUlt, 1U);
3768 CHECK_EQ(test.dOle, 0U); 3774 CHECK_EQ(test.dOle, 0U);
3769 CHECK_EQ(test.dUle, 1U); 3775 CHECK_EQ(test.dUle, 1U);
3770 CHECK_EQ(test.fF, 0U); 3776 CHECK_EQ(test.fF, 0U);
3771 CHECK_EQ(test.fUn, 1U); 3777 CHECK_EQ(test.fUn, 1U);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
3890 F3 f = FUNCTION_CAST<F3>(code->entry()); 3896 F3 f = FUNCTION_CAST<F3>(code->entry());
3891 uint64_t dTrue = 0xFFFFFFFFFFFFFFFF; 3897 uint64_t dTrue = 0xFFFFFFFFFFFFFFFF;
3892 uint64_t dFalse = 0x0000000000000000; 3898 uint64_t dFalse = 0x0000000000000000;
3893 uint32_t fTrue = 0xFFFFFFFF; 3899 uint32_t fTrue = 0xFFFFFFFF;
3894 uint32_t fFalse = 0x00000000; 3900 uint32_t fFalse = 0x00000000;
3895 3901
3896 test.dOp1 = 2.0; 3902 test.dOp1 = 2.0;
3897 test.dOp2 = 3.0; 3903 test.dOp2 = 3.0;
3898 test.fOp1 = 2.0; 3904 test.fOp1 = 2.0;
3899 test.fOp2 = 3.0; 3905 test.fOp2 = 3.0;
3900 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3906 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3901 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); 3907 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse);
3902 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse); 3908 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse);
3903 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse); 3909 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse);
3904 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dFalse); 3910 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dFalse);
3905 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dTrue); 3911 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dTrue);
3906 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dTrue); 3912 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dTrue);
3907 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dTrue); 3913 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dTrue);
3908 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue); 3914 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue);
3909 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue); 3915 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue);
3910 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue); 3916 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue);
3911 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dTrue); 3917 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dTrue);
3912 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse); 3918 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse);
3913 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse); 3919 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse);
3914 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fFalse); 3920 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fFalse);
3915 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fFalse); 3921 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fFalse);
3916 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fTrue); 3922 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fTrue);
3917 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fTrue); 3923 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fTrue);
3918 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fTrue); 3924 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fTrue);
3919 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fTrue); 3925 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fTrue);
3920 3926
3921 test.dOp1 = std::numeric_limits<double>::max(); 3927 test.dOp1 = std::numeric_limits<double>::max();
3922 test.dOp2 = std::numeric_limits<double>::min(); 3928 test.dOp2 = std::numeric_limits<double>::min();
3923 test.fOp1 = std::numeric_limits<float>::min(); 3929 test.fOp1 = std::numeric_limits<float>::min();
3924 test.fOp2 = -std::numeric_limits<float>::max(); // lowest() 3930 test.fOp2 = -std::numeric_limits<float>::max(); // lowest()
3925 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3931 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3926 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); 3932 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse);
3927 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse); 3933 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse);
3928 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse); 3934 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse);
3929 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dFalse); 3935 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dFalse);
3930 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse); 3936 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse);
3931 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dFalse); 3937 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dFalse);
3932 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dFalse); 3938 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dFalse);
3933 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dFalse); 3939 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dFalse);
3934 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue); 3940 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue);
3935 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue); 3941 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue);
3936 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dTrue); 3942 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dTrue);
3937 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse); 3943 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse);
3938 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse); 3944 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse);
3939 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fFalse); 3945 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fFalse);
3940 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fFalse); 3946 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fFalse);
3941 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fFalse); 3947 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fFalse);
3942 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fFalse); 3948 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fFalse);
3943 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fFalse); 3949 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fFalse);
3944 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fFalse); 3950 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fFalse);
3945 3951
3946 test.dOp1 = -std::numeric_limits<double>::max(); // lowest() 3952 test.dOp1 = -std::numeric_limits<double>::max(); // lowest()
3947 test.dOp2 = -std::numeric_limits<double>::max(); // lowest() 3953 test.dOp2 = -std::numeric_limits<double>::max(); // lowest()
3948 test.fOp1 = std::numeric_limits<float>::max(); 3954 test.fOp1 = std::numeric_limits<float>::max();
3949 test.fOp2 = std::numeric_limits<float>::max(); 3955 test.fOp2 = std::numeric_limits<float>::max();
3950 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3956 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3951 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); 3957 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse);
3952 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse); 3958 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse);
3953 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dTrue); 3959 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dTrue);
3954 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dTrue); 3960 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dTrue);
3955 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse); 3961 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse);
3956 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dFalse); 3962 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dFalse);
3957 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dTrue); 3963 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dTrue);
3958 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue); 3964 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue);
3959 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue); 3965 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue);
3960 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dFalse); 3966 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dFalse);
3961 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dFalse); 3967 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dFalse);
3962 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse); 3968 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse);
3963 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse); 3969 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse);
3964 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fTrue); 3970 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fTrue);
3965 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fTrue); 3971 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fTrue);
3966 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fFalse); 3972 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fFalse);
3967 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fFalse); 3973 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fFalse);
3968 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fTrue); 3974 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fTrue);
3969 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fTrue); 3975 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fTrue);
3970 3976
3971 test.dOp1 = std::numeric_limits<double>::quiet_NaN(); 3977 test.dOp1 = std::numeric_limits<double>::quiet_NaN();
3972 test.dOp2 = 0.0; 3978 test.dOp2 = 0.0;
3973 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); 3979 test.fOp1 = std::numeric_limits<float>::quiet_NaN();
3974 test.fOp2 = 0.0; 3980 test.fOp2 = 0.0;
3975 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 3981 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
3976 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); 3982 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse);
3977 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dTrue); 3983 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dTrue);
3978 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse); 3984 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse);
3979 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dTrue); 3985 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dTrue);
3980 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse); 3986 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse);
3981 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dTrue); 3987 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dTrue);
3982 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dFalse); 3988 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dFalse);
3983 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue); 3989 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue);
3984 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dFalse); 3990 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dFalse);
3985 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue); 3991 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
4079 test.cvt_d_w_in = -1; 4085 test.cvt_d_w_in = -1;
4080 test.cvt_d_l_in = -1; 4086 test.cvt_d_l_in = -1;
4081 test.cvt_l_s_in = -0.51; 4087 test.cvt_l_s_in = -0.51;
4082 test.cvt_l_d_in = -0.51; 4088 test.cvt_l_d_in = -0.51;
4083 test.cvt_s_d_in = -0.51; 4089 test.cvt_s_d_in = -0.51;
4084 test.cvt_s_w_in = -1; 4090 test.cvt_s_w_in = -1;
4085 test.cvt_s_l_in = -1; 4091 test.cvt_s_l_in = -1;
4086 test.cvt_w_s_in = -0.51; 4092 test.cvt_w_s_in = -0.51;
4087 test.cvt_w_d_in = -0.51; 4093 test.cvt_w_d_in = -0.51;
4088 4094
4089 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 4095 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
4090 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); 4096 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in));
4091 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); 4097 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in));
4092 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && 4098 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
4093 IsFp64Mode()) { 4099 IsFp64Mode()) {
4094 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); 4100 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in));
4095 } 4101 }
4096 if (IsFp64Mode()) { 4102 if (IsFp64Mode()) {
4097 CHECK_EQ(test.cvt_l_s_out, -1); 4103 CHECK_EQ(test.cvt_l_s_out, -1);
4098 CHECK_EQ(test.cvt_l_d_out, -1); 4104 CHECK_EQ(test.cvt_l_d_out, -1);
4099 } 4105 }
(...skipping 11 matching lines...) Expand all
4111 test.cvt_d_w_in = 1; 4117 test.cvt_d_w_in = 1;
4112 test.cvt_d_l_in = 1; 4118 test.cvt_d_l_in = 1;
4113 test.cvt_l_s_in = 0.49; 4119 test.cvt_l_s_in = 0.49;
4114 test.cvt_l_d_in = 0.49; 4120 test.cvt_l_d_in = 0.49;
4115 test.cvt_s_d_in = 0.49; 4121 test.cvt_s_d_in = 0.49;
4116 test.cvt_s_w_in = 1; 4122 test.cvt_s_w_in = 1;
4117 test.cvt_s_l_in = 1; 4123 test.cvt_s_l_in = 1;
4118 test.cvt_w_s_in = 0.49; 4124 test.cvt_w_s_in = 0.49;
4119 test.cvt_w_d_in = 0.49; 4125 test.cvt_w_d_in = 0.49;
4120 4126
4121 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 4127 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
4122 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); 4128 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in));
4123 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); 4129 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in));
4124 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && 4130 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
4125 IsFp64Mode()) { 4131 IsFp64Mode()) {
4126 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); 4132 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in));
4127 } 4133 }
4128 if (IsFp64Mode()) { 4134 if (IsFp64Mode()) {
4129 CHECK_EQ(test.cvt_l_s_out, 0); 4135 CHECK_EQ(test.cvt_l_s_out, 0);
4130 CHECK_EQ(test.cvt_l_d_out, 0); 4136 CHECK_EQ(test.cvt_l_d_out, 0);
4131 } 4137 }
(...skipping 10 matching lines...) Expand all
4142 test.cvt_d_w_in = std::numeric_limits<int32_t>::max(); 4148 test.cvt_d_w_in = std::numeric_limits<int32_t>::max();
4143 test.cvt_d_l_in = std::numeric_limits<int64_t>::max(); 4149 test.cvt_d_l_in = std::numeric_limits<int64_t>::max();
4144 test.cvt_l_s_in = std::numeric_limits<float>::max(); 4150 test.cvt_l_s_in = std::numeric_limits<float>::max();
4145 test.cvt_l_d_in = std::numeric_limits<double>::max(); 4151 test.cvt_l_d_in = std::numeric_limits<double>::max();
4146 test.cvt_s_d_in = std::numeric_limits<double>::max(); 4152 test.cvt_s_d_in = std::numeric_limits<double>::max();
4147 test.cvt_s_w_in = std::numeric_limits<int32_t>::max(); 4153 test.cvt_s_w_in = std::numeric_limits<int32_t>::max();
4148 test.cvt_s_l_in = std::numeric_limits<int64_t>::max(); 4154 test.cvt_s_l_in = std::numeric_limits<int64_t>::max();
4149 test.cvt_w_s_in = std::numeric_limits<float>::max(); 4155 test.cvt_w_s_in = std::numeric_limits<float>::max();
4150 test.cvt_w_d_in = std::numeric_limits<double>::max(); 4156 test.cvt_w_d_in = std::numeric_limits<double>::max();
4151 4157
4152 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 4158 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
4153 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); 4159 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in));
4154 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); 4160 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in));
4155 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && 4161 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
4156 IsFp64Mode()) { 4162 IsFp64Mode()) {
4157 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); 4163 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in));
4158 } 4164 }
4159 if (IsFp64Mode()) { 4165 if (IsFp64Mode()) {
4160 CHECK_EQ(test.cvt_l_s_out, std::numeric_limits<int64_t>::max()); 4166 CHECK_EQ(test.cvt_l_s_out, std::numeric_limits<int64_t>::max());
4161 CHECK_EQ(test.cvt_l_d_out, std::numeric_limits<int64_t>::max()); 4167 CHECK_EQ(test.cvt_l_d_out, std::numeric_limits<int64_t>::max());
4162 } 4168 }
(...skipping 11 matching lines...) Expand all
4174 test.cvt_d_w_in = std::numeric_limits<int32_t>::min(); // lowest() 4180 test.cvt_d_w_in = std::numeric_limits<int32_t>::min(); // lowest()
4175 test.cvt_d_l_in = std::numeric_limits<int64_t>::min(); // lowest() 4181 test.cvt_d_l_in = std::numeric_limits<int64_t>::min(); // lowest()
4176 test.cvt_l_s_in = -std::numeric_limits<float>::max(); // lowest() 4182 test.cvt_l_s_in = -std::numeric_limits<float>::max(); // lowest()
4177 test.cvt_l_d_in = -std::numeric_limits<double>::max(); // lowest() 4183 test.cvt_l_d_in = -std::numeric_limits<double>::max(); // lowest()
4178 test.cvt_s_d_in = -std::numeric_limits<double>::max(); // lowest() 4184 test.cvt_s_d_in = -std::numeric_limits<double>::max(); // lowest()
4179 test.cvt_s_w_in = std::numeric_limits<int32_t>::min(); // lowest() 4185 test.cvt_s_w_in = std::numeric_limits<int32_t>::min(); // lowest()
4180 test.cvt_s_l_in = std::numeric_limits<int64_t>::min(); // lowest() 4186 test.cvt_s_l_in = std::numeric_limits<int64_t>::min(); // lowest()
4181 test.cvt_w_s_in = -std::numeric_limits<float>::max(); // lowest() 4187 test.cvt_w_s_in = -std::numeric_limits<float>::max(); // lowest()
4182 test.cvt_w_d_in = -std::numeric_limits<double>::max(); // lowest() 4188 test.cvt_w_d_in = -std::numeric_limits<double>::max(); // lowest()
4183 4189
4184 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 4190 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
4185 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); 4191 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in));
4186 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); 4192 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in));
4187 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && 4193 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
4188 IsFp64Mode()) { 4194 IsFp64Mode()) {
4189 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); 4195 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in));
4190 } 4196 }
4191 // The returned value when converting from fixed-point to float-point 4197 // The returned value when converting from fixed-point to float-point
4192 // is not consistent between board, simulator and specification 4198 // is not consistent between board, simulator and specification
4193 // in this test case, therefore modifying the test 4199 // in this test case, therefore modifying the test
4194 if (IsFp64Mode()) { 4200 if (IsFp64Mode()) {
(...skipping 18 matching lines...) Expand all
4213 test.cvt_d_w_in = std::numeric_limits<int32_t>::min(); 4219 test.cvt_d_w_in = std::numeric_limits<int32_t>::min();
4214 test.cvt_d_l_in = std::numeric_limits<int64_t>::min(); 4220 test.cvt_d_l_in = std::numeric_limits<int64_t>::min();
4215 test.cvt_l_s_in = std::numeric_limits<float>::min(); 4221 test.cvt_l_s_in = std::numeric_limits<float>::min();
4216 test.cvt_l_d_in = std::numeric_limits<double>::min(); 4222 test.cvt_l_d_in = std::numeric_limits<double>::min();
4217 test.cvt_s_d_in = std::numeric_limits<double>::min(); 4223 test.cvt_s_d_in = std::numeric_limits<double>::min();
4218 test.cvt_s_w_in = std::numeric_limits<int32_t>::min(); 4224 test.cvt_s_w_in = std::numeric_limits<int32_t>::min();
4219 test.cvt_s_l_in = std::numeric_limits<int64_t>::min(); 4225 test.cvt_s_l_in = std::numeric_limits<int64_t>::min();
4220 test.cvt_w_s_in = std::numeric_limits<float>::min(); 4226 test.cvt_w_s_in = std::numeric_limits<float>::min();
4221 test.cvt_w_d_in = std::numeric_limits<double>::min(); 4227 test.cvt_w_d_in = std::numeric_limits<double>::min();
4222 4228
4223 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 4229 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
4224 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); 4230 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in));
4225 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); 4231 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in));
4226 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && 4232 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
4227 IsFp64Mode()) { 4233 IsFp64Mode()) {
4228 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); 4234 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in));
4229 } 4235 }
4230 if (IsFp64Mode()) { 4236 if (IsFp64Mode()) {
4231 CHECK_EQ(test.cvt_l_s_out, 0); 4237 CHECK_EQ(test.cvt_l_s_out, 0);
4232 CHECK_EQ(test.cvt_l_d_out, 0); 4238 CHECK_EQ(test.cvt_l_d_out, 0);
4233 } 4239 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
4282 __ jr(ra); 4288 __ jr(ra);
4283 __ nop(); 4289 __ nop();
4284 4290
4285 CodeDesc desc; 4291 CodeDesc desc;
4286 assm.GetCode(&desc); 4292 assm.GetCode(&desc);
4287 Handle<Code> code = isolate->factory()->NewCode( 4293 Handle<Code> code = isolate->factory()->NewCode(
4288 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4294 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4289 4295
4290 F3 f = FUNCTION_CAST<F3>(code->entry()); 4296 F3 f = FUNCTION_CAST<F3>(code->entry());
4291 4297
4292 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 4298 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
4293 4299
4294 const int test_size = 3; 4300 const int test_size = 3;
4295 4301
4296 double dOp1[test_size] = { 4302 double dOp1[test_size] = {
4297 5.0, 4303 5.0,
4298 DBL_MAX, 4304 DBL_MAX,
4299 DBL_MAX, 4305 DBL_MAX,
4300 }; 4306 };
4301 double dOp2[test_size] = { 4307 double dOp2[test_size] = {
4302 2.0, 4308 2.0,
(...skipping 20 matching lines...) Expand all
4323 FLT_MAX / 2.0, 4329 FLT_MAX / 2.0,
4324 -1.0, 4330 -1.0,
4325 }; 4331 };
4326 4332
4327 for (int i = 0; i < test_size; i++) { 4333 for (int i = 0; i < test_size; i++) {
4328 test.dOp1 = dOp1[i]; 4334 test.dOp1 = dOp1[i];
4329 test.dOp2 = dOp2[i]; 4335 test.dOp2 = dOp2[i];
4330 test.fOp1 = fOp1[i]; 4336 test.fOp1 = fOp1[i];
4331 test.fOp2 = fOp2[i]; 4337 test.fOp2 = fOp2[i];
4332 4338
4333 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 4339 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
4334 CHECK_EQ(test.dRes, dRes[i]); 4340 CHECK_EQ(test.dRes, dRes[i]);
4335 CHECK_EQ(test.fRes, fRes[i]); 4341 CHECK_EQ(test.fRes, fRes[i]);
4336 } 4342 }
4337 4343
4338 test.dOp1 = DBL_MAX; 4344 test.dOp1 = DBL_MAX;
4339 test.dOp2 = -0.0; 4345 test.dOp2 = -0.0;
4340 test.fOp1 = FLT_MAX; 4346 test.fOp1 = FLT_MAX;
4341 test.fOp2 = -0.0; 4347 test.fOp2 = -0.0;
4342 4348
4343 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 4349 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
4344 CHECK_EQ(false, std::isfinite(test.dRes)); 4350 CHECK_EQ(false, std::isfinite(test.dRes));
4345 CHECK_EQ(false, std::isfinite(test.fRes)); 4351 CHECK_EQ(false, std::isfinite(test.fRes));
4346 4352
4347 test.dOp1 = 0.0; 4353 test.dOp1 = 0.0;
4348 test.dOp2 = -0.0; 4354 test.dOp2 = -0.0;
4349 test.fOp1 = 0.0; 4355 test.fOp1 = 0.0;
4350 test.fOp2 = -0.0; 4356 test.fOp2 = -0.0;
4351 4357
4352 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 4358 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
4353 CHECK_EQ(true, std::isnan(test.dRes)); 4359 CHECK_EQ(true, std::isnan(test.dRes));
4354 CHECK_EQ(true, std::isnan(test.fRes)); 4360 CHECK_EQ(true, std::isnan(test.fRes));
4355 4361
4356 test.dOp1 = std::numeric_limits<double>::quiet_NaN(); 4362 test.dOp1 = std::numeric_limits<double>::quiet_NaN();
4357 test.dOp2 = -5.0; 4363 test.dOp2 = -5.0;
4358 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); 4364 test.fOp1 = std::numeric_limits<float>::quiet_NaN();
4359 test.fOp2 = -5.0; 4365 test.fOp2 = -5.0;
4360 4366
4361 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); 4367 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0));
4362 CHECK_EQ(true, std::isnan(test.dRes)); 4368 CHECK_EQ(true, std::isnan(test.dRes));
4363 CHECK_EQ(true, std::isnan(test.fRes)); 4369 CHECK_EQ(true, std::isnan(test.fRes));
4364 } 4370 }
4365 4371
4366 4372
4367 uint32_t run_align(uint32_t rs_value, uint32_t rt_value, uint8_t bp) { 4373 uint32_t run_align(uint32_t rs_value, uint32_t rt_value, uint8_t bp) {
4368 Isolate* isolate = CcTest::i_isolate(); 4374 Isolate* isolate = CcTest::i_isolate();
4369 HandleScope scope(isolate); 4375 HandleScope scope(isolate);
4370 4376
4371 MacroAssembler assm(isolate, NULL, 0); 4377 MacroAssembler assm(isolate, NULL, 0);
4372 4378
4373 __ align(v0, a0, a1, bp); 4379 __ align(v0, a0, a1, bp);
4374 __ jr(ra); 4380 __ jr(ra);
4375 __ nop(); 4381 __ nop();
4376 4382
4377 CodeDesc desc; 4383 CodeDesc desc;
4378 assm.GetCode(&desc); 4384 assm.GetCode(&desc);
4379 Handle<Code> code = isolate->factory()->NewCode( 4385 Handle<Code> code = isolate->factory()->NewCode(
4380 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4386 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4381 4387
4382 F2 f = FUNCTION_CAST<F2>(code->entry()); 4388 F2 f = FUNCTION_CAST<F2>(code->entry());
4383 4389
4384 uint32_t res = 4390 uint32_t res = reinterpret_cast<uint32_t>(CALL_GENERATED_CODE(
4385 reinterpret_cast<uint32_t>(CALL_GENERATED_CODE(f, rs_value, 4391 isolate, f, rs_value, rt_value, 0, 0, 0));
4386 rt_value,
4387 0, 0, 0));
4388 4392
4389 return res; 4393 return res;
4390 } 4394 }
4391 4395
4392 4396
4393 TEST(r6_align) { 4397 TEST(r6_align) {
4394 if (IsMipsArchVariant(kMips32r6)) { 4398 if (IsMipsArchVariant(kMips32r6)) {
4395 CcTest::InitializeVM(); 4399 CcTest::InitializeVM();
4396 4400
4397 struct TestCaseAlign { 4401 struct TestCaseAlign {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
4430 __ nop(); 4434 __ nop();
4431 4435
4432 CodeDesc desc; 4436 CodeDesc desc;
4433 assm.GetCode(&desc); 4437 assm.GetCode(&desc);
4434 Handle<Code> code = isolate->factory()->NewCode( 4438 Handle<Code> code = isolate->factory()->NewCode(
4435 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4439 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4436 4440
4437 F2 f = FUNCTION_CAST<F2>(code->entry()); 4441 F2 f = FUNCTION_CAST<F2>(code->entry());
4438 PC = (uint32_t) f; // Set the program counter. 4442 PC = (uint32_t) f; // Set the program counter.
4439 4443
4440 uint32_t res = 4444 uint32_t res = reinterpret_cast<uint32_t>(
4441 reinterpret_cast<uint32_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); 4445 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0));
4442 4446
4443 return res; 4447 return res;
4444 } 4448 }
4445 4449
4446 4450
4447 TEST(r6_aluipc) { 4451 TEST(r6_aluipc) {
4448 if (IsMipsArchVariant(kMips32r6)) { 4452 if (IsMipsArchVariant(kMips32r6)) {
4449 CcTest::InitializeVM(); 4453 CcTest::InitializeVM();
4450 4454
4451 struct TestCaseAluipc { 4455 struct TestCaseAluipc {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
4484 __ nop(); 4488 __ nop();
4485 4489
4486 CodeDesc desc; 4490 CodeDesc desc;
4487 assm.GetCode(&desc); 4491 assm.GetCode(&desc);
4488 Handle<Code> code = isolate->factory()->NewCode( 4492 Handle<Code> code = isolate->factory()->NewCode(
4489 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4493 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4490 4494
4491 F2 f = FUNCTION_CAST<F2>(code->entry()); 4495 F2 f = FUNCTION_CAST<F2>(code->entry());
4492 PC = (uint32_t) f; // Set the program counter. 4496 PC = (uint32_t) f; // Set the program counter.
4493 4497
4494 uint32_t res = 4498 uint32_t res = reinterpret_cast<uint32_t>(
4495 reinterpret_cast<uint32_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); 4499 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0));
4496 4500
4497 return res; 4501 return res;
4498 } 4502 }
4499 4503
4500 4504
4501 TEST(r6_auipc) { 4505 TEST(r6_auipc) {
4502 if (IsMipsArchVariant(kMips32r6)) { 4506 if (IsMipsArchVariant(kMips32r6)) {
4503 CcTest::InitializeVM(); 4507 CcTest::InitializeVM();
4504 4508
4505 struct TestCaseAuipc { 4509 struct TestCaseAuipc {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
4559 __ jr(ra); 4563 __ jr(ra);
4560 __ nop(); 4564 __ nop();
4561 4565
4562 CodeDesc desc; 4566 CodeDesc desc;
4563 assm.GetCode(&desc); 4567 assm.GetCode(&desc);
4564 Handle<Code> code = isolate->factory()->NewCode( 4568 Handle<Code> code = isolate->factory()->NewCode(
4565 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4569 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4566 4570
4567 F2 f = FUNCTION_CAST<F2>(code->entry()); 4571 F2 f = FUNCTION_CAST<F2>(code->entry());
4568 4572
4569 uint32_t res = 4573 uint32_t res = reinterpret_cast<uint32_t>(
4570 reinterpret_cast<uint32_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); 4574 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0));
4571 4575
4572 return res; 4576 return res;
4573 } 4577 }
4574 4578
4575 4579
4576 TEST(r6_lwpc) { 4580 TEST(r6_lwpc) {
4577 if (IsMipsArchVariant(kMips32r6)) { 4581 if (IsMipsArchVariant(kMips32r6)) {
4578 CcTest::InitializeVM(); 4582 CcTest::InitializeVM();
4579 4583
4580 struct TestCaseLwpc { 4584 struct TestCaseLwpc {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
4643 __ jr(ra); 4647 __ jr(ra);
4644 __ nop(); 4648 __ nop();
4645 4649
4646 CodeDesc desc; 4650 CodeDesc desc;
4647 assm.GetCode(&desc); 4651 assm.GetCode(&desc);
4648 Handle<Code> code = isolate->factory()->NewCode( 4652 Handle<Code> code = isolate->factory()->NewCode(
4649 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4653 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4650 4654
4651 F2 f = FUNCTION_CAST<F2>(code->entry()); 4655 F2 f = FUNCTION_CAST<F2>(code->entry());
4652 4656
4653 uint32_t res = 4657 uint32_t res = reinterpret_cast<uint32_t>(
4654 reinterpret_cast<uint32_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); 4658 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0));
4655 4659
4656 return res; 4660 return res;
4657 } 4661 }
4658 4662
4659 4663
4660 TEST(r6_jic) { 4664 TEST(r6_jic) {
4661 if (IsMipsArchVariant(kMips32r6)) { 4665 if (IsMipsArchVariant(kMips32r6)) {
4662 CcTest::InitializeVM(); 4666 CcTest::InitializeVM();
4663 4667
4664 struct TestCaseJic { 4668 struct TestCaseJic {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
4715 __ jr(ra); 4719 __ jr(ra);
4716 __ nop(); 4720 __ nop();
4717 4721
4718 CodeDesc desc; 4722 CodeDesc desc;
4719 assm.GetCode(&desc); 4723 assm.GetCode(&desc);
4720 Handle<Code> code = isolate->factory()->NewCode( 4724 Handle<Code> code = isolate->factory()->NewCode(
4721 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4725 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4722 4726
4723 F2 f = FUNCTION_CAST<F2>(code->entry()); 4727 F2 f = FUNCTION_CAST<F2>(code->entry());
4724 4728
4725 uint32_t res = 4729 uint32_t res = reinterpret_cast<uint32_t>(
4726 reinterpret_cast<uint32_t>(CALL_GENERATED_CODE(f, value, 0, 0, 0, 0)); 4730 CALL_GENERATED_CODE(isolate, f, value, 0, 0, 0, 0));
4727 4731
4728 return res; 4732 return res;
4729 } 4733 }
4730 4734
4731 4735
4732 TEST(r6_beqzc) { 4736 TEST(r6_beqzc) {
4733 if (IsMipsArchVariant(kMips32r6)) { 4737 if (IsMipsArchVariant(kMips32r6)) {
4734 CcTest::InitializeVM(); 4738 CcTest::InitializeVM();
4735 4739
4736 struct TestCaseBeqzc { 4740 struct TestCaseBeqzc {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
4809 __ nop(); 4813 __ nop();
4810 4814
4811 4815
4812 CodeDesc desc; 4816 CodeDesc desc;
4813 assm.GetCode(&desc); 4817 assm.GetCode(&desc);
4814 Handle<Code> code = isolate->factory()->NewCode( 4818 Handle<Code> code = isolate->factory()->NewCode(
4815 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4819 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4816 4820
4817 F2 f = FUNCTION_CAST<F2>(code->entry()); 4821 F2 f = FUNCTION_CAST<F2>(code->entry());
4818 4822
4819 uint32_t res = 4823 uint32_t res = reinterpret_cast<uint32_t>(
4820 reinterpret_cast<uint32_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); 4824 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0));
4821 4825
4822 return res; 4826 return res;
4823 } 4827 }
4824 4828
4825 4829
4826 TEST(r6_jialc) { 4830 TEST(r6_jialc) {
4827 if (IsMipsArchVariant(kMips32r6)) { 4831 if (IsMipsArchVariant(kMips32r6)) {
4828 CcTest::InitializeVM(); 4832 CcTest::InitializeVM();
4829 4833
4830 struct TestCaseJialc { 4834 struct TestCaseJialc {
(...skipping 29 matching lines...) Expand all
4860 __ nop(); 4864 __ nop();
4861 4865
4862 CodeDesc desc; 4866 CodeDesc desc;
4863 assm.GetCode(&desc); 4867 assm.GetCode(&desc);
4864 Handle<Code> code = isolate->factory()->NewCode( 4868 Handle<Code> code = isolate->factory()->NewCode(
4865 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4869 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4866 4870
4867 F2 f = FUNCTION_CAST<F2>(code->entry()); 4871 F2 f = FUNCTION_CAST<F2>(code->entry());
4868 PC = (uint32_t) f; // Set the program counter. 4872 PC = (uint32_t) f; // Set the program counter.
4869 4873
4870 uint32_t rs = 4874 uint32_t rs = reinterpret_cast<uint32_t>(
4871 reinterpret_cast<uint32_t>(CALL_GENERATED_CODE(f, imm19, 0, 0, 0, 0)); 4875 CALL_GENERATED_CODE(isolate, f, imm19, 0, 0, 0, 0));
4872 4876
4873 return rs; 4877 return rs;
4874 } 4878 }
4875 4879
4876 4880
4877 TEST(r6_addiupc) { 4881 TEST(r6_addiupc) {
4878 if (IsMipsArchVariant(kMips32r6)) { 4882 if (IsMipsArchVariant(kMips32r6)) {
4879 CcTest::InitializeVM(); 4883 CcTest::InitializeVM();
4880 4884
4881 struct TestCaseAddiupc { 4885 struct TestCaseAddiupc {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
4943 __ jr(ra); 4947 __ jr(ra);
4944 __ nop(); 4948 __ nop();
4945 4949
4946 CodeDesc desc; 4950 CodeDesc desc;
4947 assm.GetCode(&desc); 4951 assm.GetCode(&desc);
4948 Handle<Code> code = isolate->factory()->NewCode( 4952 Handle<Code> code = isolate->factory()->NewCode(
4949 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 4953 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
4950 4954
4951 F2 f = FUNCTION_CAST<F2>(code->entry()); 4955 F2 f = FUNCTION_CAST<F2>(code->entry());
4952 4956
4953 int32_t res = 4957 int32_t res = reinterpret_cast<int32_t>(
4954 reinterpret_cast<int32_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); 4958 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0));
4955 4959
4956 return res; 4960 return res;
4957 } 4961 }
4958 4962
4959 4963
4960 TEST(r6_bc) { 4964 TEST(r6_bc) {
4961 if (IsMipsArchVariant(kMips32r6)) { 4965 if (IsMipsArchVariant(kMips32r6)) {
4962 CcTest::InitializeVM(); 4966 CcTest::InitializeVM();
4963 4967
4964 struct TestCaseBc { 4968 struct TestCaseBc {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
5025 __ jr(ra); 5029 __ jr(ra);
5026 __ nop(); 5030 __ nop();
5027 5031
5028 CodeDesc desc; 5032 CodeDesc desc;
5029 assm.GetCode(&desc); 5033 assm.GetCode(&desc);
5030 Handle<Code> code = isolate->factory()->NewCode( 5034 Handle<Code> code = isolate->factory()->NewCode(
5031 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 5035 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
5032 5036
5033 F2 f = FUNCTION_CAST<F2>(code->entry()); 5037 F2 f = FUNCTION_CAST<F2>(code->entry());
5034 5038
5035 int32_t res = 5039 int32_t res = reinterpret_cast<int32_t>(
5036 reinterpret_cast<int32_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); 5040 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0));
5037 5041
5038 return res; 5042 return res;
5039 } 5043 }
5040 5044
5041 5045
5042 TEST(r6_balc) { 5046 TEST(r6_balc) {
5043 if (IsMipsArchVariant(kMips32r6)) { 5047 if (IsMipsArchVariant(kMips32r6)) {
5044 CcTest::InitializeVM(); 5048 CcTest::InitializeVM();
5045 5049
5046 struct TestCaseBalc { 5050 struct TestCaseBalc {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
5083 __ jr(ra); 5087 __ jr(ra);
5084 __ nop(); 5088 __ nop();
5085 5089
5086 CodeDesc desc; 5090 CodeDesc desc;
5087 assm.GetCode(&desc); 5091 assm.GetCode(&desc);
5088 Handle<Code> code = isolate->factory()->NewCode( 5092 Handle<Code> code = isolate->factory()->NewCode(
5089 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 5093 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
5090 5094
5091 F2 f = FUNCTION_CAST<F2>(code->entry()); 5095 F2 f = FUNCTION_CAST<F2>(code->entry());
5092 5096
5093 uint32_t res = 5097 uint32_t res = reinterpret_cast<uint32_t>(
5094 reinterpret_cast<uint32_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); 5098 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0));
5095 5099
5096 return res; 5100 return res;
5097 } 5101 }
5098 5102
5099 5103
5100 TEST(bal) { 5104 TEST(bal) {
5101 CcTest::InitializeVM(); 5105 CcTest::InitializeVM();
5102 5106
5103 struct TestCaseBal { 5107 struct TestCaseBal {
5104 int16_t offset; 5108 int16_t offset;
(...skipping 30 matching lines...) Expand all
5135 __ bind(&done); 5139 __ bind(&done);
5136 __ Ret(USE_DELAY_SLOT); 5140 __ Ret(USE_DELAY_SLOT);
5137 __ mov(v0, zero_reg); 5141 __ mov(v0, zero_reg);
5138 5142
5139 CodeDesc desc; 5143 CodeDesc desc;
5140 assm.GetCode(&desc); 5144 assm.GetCode(&desc);
5141 Handle<Code> code = isolate->factory()->NewCode( 5145 Handle<Code> code = isolate->factory()->NewCode(
5142 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 5146 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
5143 F2 f = FUNCTION_CAST<F2>(code->entry()); 5147 F2 f = FUNCTION_CAST<F2>(code->entry());
5144 5148
5145 int32_t res = 5149 int32_t res = reinterpret_cast<int32_t>(
5146 reinterpret_cast<int32_t>(CALL_GENERATED_CODE(f, 42, 42, 0, 0, 0)); 5150 CALL_GENERATED_CODE(isolate, f, 42, 42, 0, 0, 0));
5147 CHECK_EQ(res, 0); 5151 CHECK_EQ(res, 0);
5148 } 5152 }
5149 5153
5150 5154
5151 #undef __ 5155 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-assembler-arm.cc ('k') | test/cctest/test-assembler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698