OLD | NEW |
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 Loading... |
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 int64_t res = | 75 int64_t res = reinterpret_cast<int64_t>( |
76 reinterpret_cast<int64_t>(CALL_GENERATED_CODE(f, 0xab0, 0xc, 0, 0, 0)); | 76 CALL_GENERATED_CODE(isolate, f, 0xab0, 0xc, 0, 0, 0)); |
77 CHECK_EQ(0xabcL, res); | 77 CHECK_EQ(0xabcL, res); |
78 } | 78 } |
79 | 79 |
80 | 80 |
81 TEST(MIPS1) { | 81 TEST(MIPS1) { |
82 CcTest::InitializeVM(); | 82 CcTest::InitializeVM(); |
83 Isolate* isolate = CcTest::i_isolate(); | 83 Isolate* isolate = CcTest::i_isolate(); |
84 HandleScope scope(isolate); | 84 HandleScope scope(isolate); |
85 | 85 |
86 MacroAssembler assm(isolate, NULL, 0); | 86 MacroAssembler assm(isolate, NULL, 0); |
(...skipping 14 matching lines...) Expand all Loading... |
101 __ nop(); | 101 __ nop(); |
102 | 102 |
103 __ jr(ra); | 103 __ jr(ra); |
104 __ nop(); | 104 __ nop(); |
105 | 105 |
106 CodeDesc desc; | 106 CodeDesc desc; |
107 assm.GetCode(&desc); | 107 assm.GetCode(&desc); |
108 Handle<Code> code = isolate->factory()->NewCode( | 108 Handle<Code> code = isolate->factory()->NewCode( |
109 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 109 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
110 F1 f = FUNCTION_CAST<F1>(code->entry()); | 110 F1 f = FUNCTION_CAST<F1>(code->entry()); |
111 int64_t res = | 111 int64_t res = reinterpret_cast<int64_t>( |
112 reinterpret_cast<int64_t>(CALL_GENERATED_CODE(f, 50, 0, 0, 0, 0)); | 112 CALL_GENERATED_CODE(isolate, f, 50, 0, 0, 0, 0)); |
113 CHECK_EQ(1275L, res); | 113 CHECK_EQ(1275L, res); |
114 } | 114 } |
115 | 115 |
116 | 116 |
117 TEST(MIPS2) { | 117 TEST(MIPS2) { |
118 CcTest::InitializeVM(); | 118 CcTest::InitializeVM(); |
119 Isolate* isolate = CcTest::i_isolate(); | 119 Isolate* isolate = CcTest::i_isolate(); |
120 HandleScope scope(isolate); | 120 HandleScope scope(isolate); |
121 | 121 |
122 MacroAssembler assm(isolate, NULL, 0); | 122 MacroAssembler assm(isolate, NULL, 0); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 __ bind(&exit); | 248 __ bind(&exit); |
249 __ jr(ra); | 249 __ jr(ra); |
250 __ nop(); | 250 __ nop(); |
251 | 251 |
252 CodeDesc desc; | 252 CodeDesc desc; |
253 assm.GetCode(&desc); | 253 assm.GetCode(&desc); |
254 Handle<Code> code = isolate->factory()->NewCode( | 254 Handle<Code> code = isolate->factory()->NewCode( |
255 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 255 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
256 F2 f = FUNCTION_CAST<F2>(code->entry()); | 256 F2 f = FUNCTION_CAST<F2>(code->entry()); |
257 int64_t res = | 257 int64_t res = reinterpret_cast<int64_t>( |
258 reinterpret_cast<int64_t>(CALL_GENERATED_CODE(f, 0xab0, 0xc, 0, 0, 0)); | 258 CALL_GENERATED_CODE(isolate, f, 0xab0, 0xc, 0, 0, 0)); |
259 | 259 |
260 CHECK_EQ(0x31415926L, res); | 260 CHECK_EQ(0x31415926L, res); |
261 } | 261 } |
262 | 262 |
263 | 263 |
264 TEST(MIPS3) { | 264 TEST(MIPS3) { |
265 // Test floating point instructions. | 265 // Test floating point instructions. |
266 CcTest::InitializeVM(); | 266 CcTest::InitializeVM(); |
267 Isolate* isolate = CcTest::i_isolate(); | 267 Isolate* isolate = CcTest::i_isolate(); |
268 HandleScope scope(isolate); | 268 HandleScope scope(isolate); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 t.f = 0.0; | 366 t.f = 0.0; |
367 t.h = 1.5; | 367 t.h = 1.5; |
368 t.i = 2.75; | 368 t.i = 2.75; |
369 // Single test values. | 369 // Single test values. |
370 t.fa = 1.5e6; | 370 t.fa = 1.5e6; |
371 t.fb = 2.75e4; | 371 t.fb = 2.75e4; |
372 t.fc = 0.0; | 372 t.fc = 0.0; |
373 t.fd = 0.0; | 373 t.fd = 0.0; |
374 t.fe = 0.0; | 374 t.fe = 0.0; |
375 t.ff = 0.0; | 375 t.ff = 0.0; |
376 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 376 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
377 USE(dummy); | 377 USE(dummy); |
378 // Expected double results. | 378 // Expected double results. |
379 CHECK_EQ(1.5e14, t.a); | 379 CHECK_EQ(1.5e14, t.a); |
380 CHECK_EQ(1.5e14, t.b); | 380 CHECK_EQ(1.5e14, t.b); |
381 CHECK_EQ(1.50275e14, t.c); | 381 CHECK_EQ(1.50275e14, t.c); |
382 CHECK_EQ(1.50550e14, t.d); | 382 CHECK_EQ(1.50550e14, t.d); |
383 CHECK_EQ(1.8066e16, t.e); | 383 CHECK_EQ(1.8066e16, t.e); |
384 CHECK_EQ(120.44, t.f); | 384 CHECK_EQ(120.44, t.f); |
385 CHECK_EQ(10.97451593465515908537, t.g); | 385 CHECK_EQ(10.97451593465515908537, t.g); |
386 if (kArchVariant == kMips64r2) { | 386 if (kArchVariant == kMips64r2) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 448 |
449 CodeDesc desc; | 449 CodeDesc desc; |
450 assm.GetCode(&desc); | 450 assm.GetCode(&desc); |
451 Handle<Code> code = isolate->factory()->NewCode( | 451 Handle<Code> code = isolate->factory()->NewCode( |
452 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 452 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
453 F3 f = FUNCTION_CAST<F3>(code->entry()); | 453 F3 f = FUNCTION_CAST<F3>(code->entry()); |
454 t.a = 1.5e22; | 454 t.a = 1.5e22; |
455 t.b = 2.75e11; | 455 t.b = 2.75e11; |
456 t.c = 17.17; | 456 t.c = 17.17; |
457 t.d = -2.75e11; | 457 t.d = -2.75e11; |
458 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 458 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
459 USE(dummy); | 459 USE(dummy); |
460 | 460 |
461 CHECK_EQ(2.75e11, t.a); | 461 CHECK_EQ(2.75e11, t.a); |
462 CHECK_EQ(2.75e11, t.b); | 462 CHECK_EQ(2.75e11, t.b); |
463 CHECK_EQ(1.5e22, t.c); | 463 CHECK_EQ(1.5e22, t.c); |
464 CHECK_EQ(static_cast<int64_t>(0xffffffffc25001d1L), t.high); | 464 CHECK_EQ(static_cast<int64_t>(0xffffffffc25001d1L), t.high); |
465 CHECK_EQ(static_cast<int64_t>(0xffffffffbf800000L), t.low); | 465 CHECK_EQ(static_cast<int64_t>(0xffffffffbf800000L), t.low); |
466 } | 466 } |
467 | 467 |
468 | 468 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 514 |
515 CodeDesc desc; | 515 CodeDesc desc; |
516 assm.GetCode(&desc); | 516 assm.GetCode(&desc); |
517 Handle<Code> code = isolate->factory()->NewCode( | 517 Handle<Code> code = isolate->factory()->NewCode( |
518 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 518 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
519 F3 f = FUNCTION_CAST<F3>(code->entry()); | 519 F3 f = FUNCTION_CAST<F3>(code->entry()); |
520 t.a = 1.5e4; | 520 t.a = 1.5e4; |
521 t.b = 2.75e8; | 521 t.b = 2.75e8; |
522 t.i = 12345678; | 522 t.i = 12345678; |
523 t.j = -100000; | 523 t.j = -100000; |
524 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 524 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
525 USE(dummy); | 525 USE(dummy); |
526 | 526 |
527 CHECK_EQ(12345678.0, t.a); | 527 CHECK_EQ(12345678.0, t.a); |
528 CHECK_EQ(-100000.0, t.b); | 528 CHECK_EQ(-100000.0, t.b); |
529 CHECK_EQ(15000, t.i); | 529 CHECK_EQ(15000, t.i); |
530 CHECK_EQ(275000000, t.j); | 530 CHECK_EQ(275000000, t.j); |
531 } | 531 } |
532 | 532 |
533 | 533 |
534 TEST(MIPS6) { | 534 TEST(MIPS6) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 __ jr(ra); | 582 __ jr(ra); |
583 __ nop(); | 583 __ nop(); |
584 | 584 |
585 CodeDesc desc; | 585 CodeDesc desc; |
586 assm.GetCode(&desc); | 586 assm.GetCode(&desc); |
587 Handle<Code> code = isolate->factory()->NewCode( | 587 Handle<Code> code = isolate->factory()->NewCode( |
588 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 588 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
589 F3 f = FUNCTION_CAST<F3>(code->entry()); | 589 F3 f = FUNCTION_CAST<F3>(code->entry()); |
590 t.ui = 0x11223344; | 590 t.ui = 0x11223344; |
591 t.si = 0x99aabbcc; | 591 t.si = 0x99aabbcc; |
592 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 592 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
593 USE(dummy); | 593 USE(dummy); |
594 | 594 |
595 CHECK_EQ(static_cast<int32_t>(0x11223344), t.r1); | 595 CHECK_EQ(static_cast<int32_t>(0x11223344), t.r1); |
596 if (kArchEndian == kLittle) { | 596 if (kArchEndian == kLittle) { |
597 CHECK_EQ(static_cast<int32_t>(0x3344), t.r2); | 597 CHECK_EQ(static_cast<int32_t>(0x3344), t.r2); |
598 CHECK_EQ(static_cast<int32_t>(0xffffbbcc), t.r3); | 598 CHECK_EQ(static_cast<int32_t>(0xffffbbcc), t.r3); |
599 CHECK_EQ(static_cast<int32_t>(0x0000bbcc), t.r4); | 599 CHECK_EQ(static_cast<int32_t>(0x0000bbcc), t.r4); |
600 CHECK_EQ(static_cast<int32_t>(0xffffffcc), t.r5); | 600 CHECK_EQ(static_cast<int32_t>(0xffffffcc), t.r5); |
601 CHECK_EQ(static_cast<int32_t>(0x3333bbcc), t.r6); | 601 CHECK_EQ(static_cast<int32_t>(0x3333bbcc), t.r6); |
602 } else { | 602 } else { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 Handle<Code> code = isolate->factory()->NewCode( | 675 Handle<Code> code = isolate->factory()->NewCode( |
676 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 676 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
677 F3 f = FUNCTION_CAST<F3>(code->entry()); | 677 F3 f = FUNCTION_CAST<F3>(code->entry()); |
678 t.a = 1.5e14; | 678 t.a = 1.5e14; |
679 t.b = 2.75e11; | 679 t.b = 2.75e11; |
680 t.c = 2.0; | 680 t.c = 2.0; |
681 t.d = -4.0; | 681 t.d = -4.0; |
682 t.e = 0.0; | 682 t.e = 0.0; |
683 t.f = 0.0; | 683 t.f = 0.0; |
684 t.result = 0; | 684 t.result = 0; |
685 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 685 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
686 USE(dummy); | 686 USE(dummy); |
687 CHECK_EQ(1.5e14, t.a); | 687 CHECK_EQ(1.5e14, t.a); |
688 CHECK_EQ(2.75e11, t.b); | 688 CHECK_EQ(2.75e11, t.b); |
689 CHECK_EQ(1, t.result); | 689 CHECK_EQ(1, t.result); |
690 } | 690 } |
691 | 691 |
692 | 692 |
693 TEST(MIPS8) { | 693 TEST(MIPS8) { |
694 if (kArchVariant == kMips64r2) { | 694 if (kArchVariant == kMips64r2) { |
695 // Test ROTR and ROTRV instructions. | 695 // Test ROTR and ROTRV instructions. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 | 766 |
767 __ jr(ra); | 767 __ jr(ra); |
768 __ nop(); | 768 __ nop(); |
769 | 769 |
770 CodeDesc desc; | 770 CodeDesc desc; |
771 assm.GetCode(&desc); | 771 assm.GetCode(&desc); |
772 Handle<Code> code = isolate->factory()->NewCode( | 772 Handle<Code> code = isolate->factory()->NewCode( |
773 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 773 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
774 F3 f = FUNCTION_CAST<F3>(code->entry()); | 774 F3 f = FUNCTION_CAST<F3>(code->entry()); |
775 t.input = 0x12345678; | 775 t.input = 0x12345678; |
776 Object* dummy = CALL_GENERATED_CODE(f, &t, 0x0, 0, 0, 0); | 776 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0x0, 0, 0, 0); |
777 USE(dummy); | 777 USE(dummy); |
778 CHECK_EQ(static_cast<int32_t>(0x81234567), t.result_rotr_4); | 778 CHECK_EQ(static_cast<int32_t>(0x81234567), t.result_rotr_4); |
779 CHECK_EQ(static_cast<int32_t>(0x78123456), t.result_rotr_8); | 779 CHECK_EQ(static_cast<int32_t>(0x78123456), t.result_rotr_8); |
780 CHECK_EQ(static_cast<int32_t>(0x67812345), t.result_rotr_12); | 780 CHECK_EQ(static_cast<int32_t>(0x67812345), t.result_rotr_12); |
781 CHECK_EQ(static_cast<int32_t>(0x56781234), t.result_rotr_16); | 781 CHECK_EQ(static_cast<int32_t>(0x56781234), t.result_rotr_16); |
782 CHECK_EQ(static_cast<int32_t>(0x45678123), t.result_rotr_20); | 782 CHECK_EQ(static_cast<int32_t>(0x45678123), t.result_rotr_20); |
783 CHECK_EQ(static_cast<int32_t>(0x34567812), t.result_rotr_24); | 783 CHECK_EQ(static_cast<int32_t>(0x34567812), t.result_rotr_24); |
784 CHECK_EQ(static_cast<int32_t>(0x23456781), t.result_rotr_28); | 784 CHECK_EQ(static_cast<int32_t>(0x23456781), t.result_rotr_28); |
785 | 785 |
786 CHECK_EQ(static_cast<int32_t>(0x81234567), t.result_rotrv_4); | 786 CHECK_EQ(static_cast<int32_t>(0x81234567), t.result_rotrv_4); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 __ nop(); | 892 __ nop(); |
893 | 893 |
894 CodeDesc desc; | 894 CodeDesc desc; |
895 assm.GetCode(&desc); | 895 assm.GetCode(&desc); |
896 Handle<Code> code = isolate->factory()->NewCode( | 896 Handle<Code> code = isolate->factory()->NewCode( |
897 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 897 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
898 F3 f = FUNCTION_CAST<F3>(code->entry()); | 898 F3 f = FUNCTION_CAST<F3>(code->entry()); |
899 t.a = 2.147483647e9; // 0x7fffffff -> 0x41DFFFFFFFC00000 as double. | 899 t.a = 2.147483647e9; // 0x7fffffff -> 0x41DFFFFFFFC00000 as double. |
900 t.b_long_hi = 0x000000ff; // 0xFF00FF00FF -> 0x426FE01FE01FE000 as double. | 900 t.b_long_hi = 0x000000ff; // 0xFF00FF00FF -> 0x426FE01FE01FE000 as double. |
901 t.b_long_lo = 0x00ff00ff; | 901 t.b_long_lo = 0x00ff00ff; |
902 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 902 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
903 USE(dummy); | 903 USE(dummy); |
904 | 904 |
905 CHECK_EQ(static_cast<int32_t>(0x41DFFFFF), t.dbl_exp); | 905 CHECK_EQ(static_cast<int32_t>(0x41DFFFFF), t.dbl_exp); |
906 CHECK_EQ(static_cast<int32_t>(0xFFC00000), t.dbl_mant); | 906 CHECK_EQ(static_cast<int32_t>(0xFFC00000), t.dbl_mant); |
907 CHECK_EQ(0, t.long_hi); | 907 CHECK_EQ(0, t.long_hi); |
908 CHECK_EQ(static_cast<int32_t>(0x7fffffff), t.long_lo); | 908 CHECK_EQ(static_cast<int32_t>(0x7fffffff), t.long_lo); |
909 CHECK_EQ(2.147483647e9, t.a_converted); | 909 CHECK_EQ(2.147483647e9, t.a_converted); |
910 | 910 |
911 // 0xFF00FF00FF -> 1.095233372415e12. | 911 // 0xFF00FF00FF -> 1.095233372415e12. |
912 CHECK_EQ(1.095233372415e12, t.b); | 912 CHECK_EQ(1.095233372415e12, t.b); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 __ nop(); | 1027 __ nop(); |
1028 | 1028 |
1029 CodeDesc desc; | 1029 CodeDesc desc; |
1030 assm.GetCode(&desc); | 1030 assm.GetCode(&desc); |
1031 Handle<Code> code = isolate->factory()->NewCode( | 1031 Handle<Code> code = isolate->factory()->NewCode( |
1032 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1032 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1033 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1033 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1034 t.reg_init = 0xaabbccdd; | 1034 t.reg_init = 0xaabbccdd; |
1035 t.mem_init = 0x11223344; | 1035 t.mem_init = 0x11223344; |
1036 | 1036 |
1037 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 1037 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
1038 USE(dummy); | 1038 USE(dummy); |
1039 | 1039 |
1040 if (kArchEndian == kLittle) { | 1040 if (kArchEndian == kLittle) { |
1041 CHECK_EQ(static_cast<int32_t>(0x44bbccdd), t.lwl_0); | 1041 CHECK_EQ(static_cast<int32_t>(0x44bbccdd), t.lwl_0); |
1042 CHECK_EQ(static_cast<int32_t>(0x3344ccdd), t.lwl_1); | 1042 CHECK_EQ(static_cast<int32_t>(0x3344ccdd), t.lwl_1); |
1043 CHECK_EQ(static_cast<int32_t>(0x223344dd), t.lwl_2); | 1043 CHECK_EQ(static_cast<int32_t>(0x223344dd), t.lwl_2); |
1044 CHECK_EQ(static_cast<int32_t>(0x11223344), t.lwl_3); | 1044 CHECK_EQ(static_cast<int32_t>(0x11223344), t.lwl_3); |
1045 | 1045 |
1046 CHECK_EQ(static_cast<int32_t>(0x11223344), t.lwr_0); | 1046 CHECK_EQ(static_cast<int32_t>(0x11223344), t.lwr_0); |
1047 CHECK_EQ(static_cast<int32_t>(0xaa112233), t.lwr_1); | 1047 CHECK_EQ(static_cast<int32_t>(0xaa112233), t.lwr_1); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 Handle<Code> code = isolate->factory()->NewCode( | 1156 Handle<Code> code = isolate->factory()->NewCode( |
1157 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1157 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1158 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1158 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1159 t.x = 1; | 1159 t.x = 1; |
1160 t.y = 2; | 1160 t.y = 2; |
1161 t.y1 = 3; | 1161 t.y1 = 3; |
1162 t.y2 = 4; | 1162 t.y2 = 4; |
1163 t.y3 = 0XBABA; | 1163 t.y3 = 0XBABA; |
1164 t.y4 = 0xDEDA; | 1164 t.y4 = 0xDEDA; |
1165 | 1165 |
1166 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 1166 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
1167 USE(dummy); | 1167 USE(dummy); |
1168 | 1168 |
1169 CHECK_EQ(3, t.y1); | 1169 CHECK_EQ(3, t.y1); |
1170 } | 1170 } |
1171 | 1171 |
1172 | 1172 |
1173 TEST(MIPS13) { | 1173 TEST(MIPS13) { |
1174 // Test Cvt_d_uw and Trunc_uw_d macros. | 1174 // Test Cvt_d_uw and Trunc_uw_d macros. |
1175 CcTest::InitializeVM(); | 1175 CcTest::InitializeVM(); |
1176 Isolate* isolate = CcTest::i_isolate(); | 1176 Isolate* isolate = CcTest::i_isolate(); |
(...skipping 30 matching lines...) Expand all Loading... |
1207 | 1207 |
1208 CodeDesc desc; | 1208 CodeDesc desc; |
1209 assm.GetCode(&desc); | 1209 assm.GetCode(&desc); |
1210 Handle<Code> code = isolate->factory()->NewCode( | 1210 Handle<Code> code = isolate->factory()->NewCode( |
1211 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1211 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1212 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1212 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1213 | 1213 |
1214 t.cvt_big_in = 0xFFFFFFFF; | 1214 t.cvt_big_in = 0xFFFFFFFF; |
1215 t.cvt_small_in = 333; | 1215 t.cvt_small_in = 333; |
1216 | 1216 |
1217 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 1217 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
1218 USE(dummy); | 1218 USE(dummy); |
1219 | 1219 |
1220 CHECK_EQ(t.cvt_big_out, static_cast<double>(t.cvt_big_in)); | 1220 CHECK_EQ(t.cvt_big_out, static_cast<double>(t.cvt_big_in)); |
1221 CHECK_EQ(t.cvt_small_out, static_cast<double>(t.cvt_small_in)); | 1221 CHECK_EQ(t.cvt_small_out, static_cast<double>(t.cvt_small_in)); |
1222 | 1222 |
1223 CHECK_EQ(static_cast<int>(t.trunc_big_out), static_cast<int>(t.cvt_big_in)); | 1223 CHECK_EQ(static_cast<int>(t.trunc_big_out), static_cast<int>(t.cvt_big_in)); |
1224 CHECK_EQ(static_cast<int>(t.trunc_small_out), | 1224 CHECK_EQ(static_cast<int>(t.trunc_small_out), |
1225 static_cast<int>(t.cvt_small_in)); | 1225 static_cast<int>(t.cvt_small_in)); |
1226 } | 1226 } |
1227 | 1227 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 | 1331 |
1332 t.round_up_in = 123.51; | 1332 t.round_up_in = 123.51; |
1333 t.round_down_in = 123.49; | 1333 t.round_down_in = 123.49; |
1334 t.neg_round_up_in = -123.5; | 1334 t.neg_round_up_in = -123.5; |
1335 t.neg_round_down_in = -123.49; | 1335 t.neg_round_down_in = -123.49; |
1336 t.err1_in = 123.51; | 1336 t.err1_in = 123.51; |
1337 t.err2_in = 1; | 1337 t.err2_in = 1; |
1338 t.err3_in = static_cast<double>(1) + 0xFFFFFFFF; | 1338 t.err3_in = static_cast<double>(1) + 0xFFFFFFFF; |
1339 t.err4_in = NAN; | 1339 t.err4_in = NAN; |
1340 | 1340 |
1341 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 1341 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
1342 USE(dummy); | 1342 USE(dummy); |
1343 | 1343 |
1344 #define GET_FPU_ERR(x) (static_cast<int>(x & kFCSRFlagMask)) | 1344 #define GET_FPU_ERR(x) (static_cast<int>(x & kFCSRFlagMask)) |
1345 #define CHECK_ROUND_RESULT(type) \ | 1345 #define CHECK_ROUND_RESULT(type) \ |
1346 CHECK(GET_FPU_ERR(t.type##_err1_out) & kFCSRInexactFlagMask); \ | 1346 CHECK(GET_FPU_ERR(t.type##_err1_out) & kFCSRInexactFlagMask); \ |
1347 CHECK_EQ(0, GET_FPU_ERR(t.type##_err2_out)); \ | 1347 CHECK_EQ(0, GET_FPU_ERR(t.type##_err2_out)); \ |
1348 CHECK(GET_FPU_ERR(t.type##_err3_out) & kFCSRInvalidOpFlagMask); \ | 1348 CHECK(GET_FPU_ERR(t.type##_err3_out) & kFCSRInvalidOpFlagMask); \ |
1349 CHECK(GET_FPU_ERR(t.type##_err4_out) & kFCSRInvalidOpFlagMask); \ | 1349 CHECK(GET_FPU_ERR(t.type##_err4_out) & kFCSRInvalidOpFlagMask); \ |
1350 CHECK_EQ(static_cast<int32_t>(kFPUInvalidResult), t.type##_invalid_result); | 1350 CHECK_EQ(static_cast<int32_t>(kFPUInvalidResult), t.type##_invalid_result); |
1351 | 1351 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1449 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1450 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1450 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1451 t.ui = 0x44332211; | 1451 t.ui = 0x44332211; |
1452 t.si = 0x99aabbcc; | 1452 t.si = 0x99aabbcc; |
1453 t.r1 = 0x1111111111111111; | 1453 t.r1 = 0x1111111111111111; |
1454 t.r2 = 0x2222222222222222; | 1454 t.r2 = 0x2222222222222222; |
1455 t.r3 = 0x3333333333333333; | 1455 t.r3 = 0x3333333333333333; |
1456 t.r4 = 0x4444444444444444; | 1456 t.r4 = 0x4444444444444444; |
1457 t.r5 = 0x5555555555555555; | 1457 t.r5 = 0x5555555555555555; |
1458 t.r6 = 0x6666666666666666; | 1458 t.r6 = 0x6666666666666666; |
1459 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 1459 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
1460 USE(dummy); | 1460 USE(dummy); |
1461 | 1461 |
1462 // Unsigned data, 32 & 64. | 1462 // Unsigned data, 32 & 64. |
1463 CHECK_EQ(static_cast<int64_t>(0x1111111144332211L), t.r1); | 1463 CHECK_EQ(static_cast<int64_t>(0x1111111144332211L), t.r1); |
1464 CHECK_EQ(static_cast<int64_t>(0x0000000000002211L), t.r2); | 1464 CHECK_EQ(static_cast<int64_t>(0x0000000000002211L), t.r2); |
1465 | 1465 |
1466 // Signed data, 32 & 64. | 1466 // Signed data, 32 & 64. |
1467 CHECK_EQ(static_cast<int64_t>(0x33333333ffffbbccL), t.r3); | 1467 CHECK_EQ(static_cast<int64_t>(0x33333333ffffbbccL), t.r3); |
1468 CHECK_EQ(static_cast<int64_t>(0xffffffff0000bbccL), t.r4); | 1468 CHECK_EQ(static_cast<int64_t>(0xffffffff0000bbccL), t.r4); |
1469 | 1469 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1521 __ swc1(f12, MemOperand(a0, offsetof(Test, k)) ); // src | 1521 __ swc1(f12, MemOperand(a0, offsetof(Test, k)) ); // src |
1522 __ swc1(f14, MemOperand(a0, offsetof(Test, l)) ); // src | 1522 __ swc1(f14, MemOperand(a0, offsetof(Test, l)) ); // src |
1523 __ jr(ra); | 1523 __ jr(ra); |
1524 __ nop(); | 1524 __ nop(); |
1525 CodeDesc desc; | 1525 CodeDesc desc; |
1526 assm.GetCode(&desc); | 1526 assm.GetCode(&desc); |
1527 Handle<Code> code = isolate->factory()->NewCode( | 1527 Handle<Code> code = isolate->factory()->NewCode( |
1528 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1528 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1529 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1529 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1530 | 1530 |
1531 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 1531 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
1532 | 1532 |
1533 CHECK_EQ(test.a, 1); | 1533 CHECK_EQ(test.a, 1); |
1534 CHECK_EQ(test.b, 0); | 1534 CHECK_EQ(test.b, 0); |
1535 CHECK_EQ(test.c, 0); | 1535 CHECK_EQ(test.c, 0); |
1536 CHECK_EQ(test.d, 1); | 1536 CHECK_EQ(test.d, 1); |
1537 | 1537 |
1538 const int test_size = 3; | 1538 const int test_size = 3; |
1539 const int input_size = 5; | 1539 const int input_size = 5; |
1540 | 1540 |
1541 double inputs_D[input_size] = {0.0, 65.2, -70.32, | 1541 double inputs_D[input_size] = {0.0, 65.2, -70.32, |
1542 18446744073709551621.0, -18446744073709551621.0}; | 1542 18446744073709551621.0, -18446744073709551621.0}; |
1543 double outputs_D[input_size] = {0.0, 65.2, -70.32, | 1543 double outputs_D[input_size] = {0.0, 65.2, -70.32, |
1544 18446744073709551621.0, -18446744073709551621.0}; | 1544 18446744073709551621.0, -18446744073709551621.0}; |
1545 double tests_D[test_size*2] = {2.8, 2.9, -2.8, -2.9, | 1545 double tests_D[test_size*2] = {2.8, 2.9, -2.8, -2.9, |
1546 18446744073709551616.0, 18446744073709555712.0}; | 1546 18446744073709551616.0, 18446744073709555712.0}; |
1547 float inputs_S[input_size] = {0.0, 65.2, -70.32, | 1547 float inputs_S[input_size] = {0.0, 65.2, -70.32, |
1548 18446744073709551621.0, -18446744073709551621.0}; | 1548 18446744073709551621.0, -18446744073709551621.0}; |
1549 float outputs_S[input_size] = {0.0, 65.2, -70.32, | 1549 float outputs_S[input_size] = {0.0, 65.2, -70.32, |
1550 18446744073709551621.0, -18446744073709551621.0}; | 1550 18446744073709551621.0, -18446744073709551621.0}; |
1551 float tests_S[test_size*2] = {2.9, 2.8, -2.9, -2.8, | 1551 float tests_S[test_size*2] = {2.9, 2.8, -2.9, -2.8, |
1552 18446744073709551616.0, 18446746272732807168.0}; | 1552 18446744073709551616.0, 18446746272732807168.0}; |
1553 for (int j=0; j < test_size; j+=2) { | 1553 for (int j=0; j < test_size; j+=2) { |
1554 for (int i=0; i < input_size; i++) { | 1554 for (int i=0; i < input_size; i++) { |
1555 test.e = inputs_D[i]; | 1555 test.e = inputs_D[i]; |
1556 test.f = tests_D[j]; | 1556 test.f = tests_D[j]; |
1557 test.i = inputs_S[i]; | 1557 test.i = inputs_S[i]; |
1558 test.j = tests_S[j]; | 1558 test.j = tests_S[j]; |
1559 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 1559 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
1560 CHECK_EQ(test.g, outputs_D[i]); | 1560 CHECK_EQ(test.g, outputs_D[i]); |
1561 CHECK_EQ(test.h, 0); | 1561 CHECK_EQ(test.h, 0); |
1562 CHECK_EQ(test.k, outputs_S[i]); | 1562 CHECK_EQ(test.k, outputs_S[i]); |
1563 CHECK_EQ(test.l, 0); | 1563 CHECK_EQ(test.l, 0); |
1564 | 1564 |
1565 test.f = tests_D[j+1]; | 1565 test.f = tests_D[j+1]; |
1566 test.j = tests_S[j+1]; | 1566 test.j = tests_S[j+1]; |
1567 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 1567 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
1568 CHECK_EQ(test.g, 0); | 1568 CHECK_EQ(test.g, 0); |
1569 CHECK_EQ(test.h, outputs_D[i]); | 1569 CHECK_EQ(test.h, outputs_D[i]); |
1570 CHECK_EQ(test.k, 0); | 1570 CHECK_EQ(test.k, 0); |
1571 CHECK_EQ(test.l, outputs_S[i]); | 1571 CHECK_EQ(test.l, outputs_S[i]); |
1572 } | 1572 } |
1573 } | 1573 } |
1574 } | 1574 } |
1575 } | 1575 } |
1576 | 1576 |
1577 | 1577 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1627 assm.GetCode(&desc); | 1627 assm.GetCode(&desc); |
1628 Handle<Code> code = isolate->factory()->NewCode( | 1628 Handle<Code> code = isolate->factory()->NewCode( |
1629 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1629 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1630 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1630 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1631 for (int i = 0; i < kTableLength; i++) { | 1631 for (int i = 0; i < kTableLength; i++) { |
1632 test.a = inputsa[i]; | 1632 test.a = inputsa[i]; |
1633 test.b = inputsb[i]; | 1633 test.b = inputsb[i]; |
1634 test.e = inputse[i]; | 1634 test.e = inputse[i]; |
1635 test.f = inputsf[i]; | 1635 test.f = inputsf[i]; |
1636 | 1636 |
1637 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 1637 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
1638 | 1638 |
1639 if (i < kTableLength - 1) { | 1639 if (i < kTableLength - 1) { |
1640 CHECK_EQ(test.c, outputsdmin[i]); | 1640 CHECK_EQ(test.c, outputsdmin[i]); |
1641 CHECK_EQ(test.d, outputsdmax[i]); | 1641 CHECK_EQ(test.d, outputsdmax[i]); |
1642 CHECK_EQ(test.g, outputsfmin[i]); | 1642 CHECK_EQ(test.g, outputsfmin[i]); |
1643 CHECK_EQ(test.h, outputsfmax[i]); | 1643 CHECK_EQ(test.h, outputsfmax[i]); |
1644 } else { | 1644 } else { |
1645 DCHECK(std::isnan(test.c)); | 1645 DCHECK(std::isnan(test.c)); |
1646 DCHECK(std::isnan(test.d)); | 1646 DCHECK(std::isnan(test.d)); |
1647 DCHECK(std::isnan(test.g)); | 1647 DCHECK(std::isnan(test.g)); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 CodeDesc desc; | 1741 CodeDesc desc; |
1742 assm.GetCode(&desc); | 1742 assm.GetCode(&desc); |
1743 Handle<Code> code = isolate->factory()->NewCode( | 1743 Handle<Code> code = isolate->factory()->NewCode( |
1744 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1744 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1745 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1745 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1746 | 1746 |
1747 for (int j = 0; j < 4; j++) { | 1747 for (int j = 0; j < 4; j++) { |
1748 test.fcsr = fcsr_inputs[j]; | 1748 test.fcsr = fcsr_inputs[j]; |
1749 for (int i = 0; i < kTableLength; i++) { | 1749 for (int i = 0; i < kTableLength; i++) { |
1750 test.a = inputs[i]; | 1750 test.a = inputs[i]; |
1751 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 1751 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
1752 CHECK_EQ(test.b, outputs[j][i]); | 1752 CHECK_EQ(test.b, outputs[j][i]); |
1753 } | 1753 } |
1754 } | 1754 } |
1755 } | 1755 } |
1756 } | 1756 } |
1757 | 1757 |
1758 | 1758 |
1759 TEST(sel) { | 1759 TEST(sel) { |
1760 if (kArchVariant == kMips64r6) { | 1760 if (kArchVariant == kMips64r6) { |
1761 CcTest::InitializeVM(); | 1761 CcTest::InitializeVM(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 float tests_S[test_size*2] = {2.9, 2.8, -2.9, -2.8, | 1807 float tests_S[test_size*2] = {2.9, 2.8, -2.9, -2.8, |
1808 18446744073709551616.0, 18446746272732807168.0}; | 1808 18446744073709551616.0, 18446746272732807168.0}; |
1809 for (int j=0; j < test_size; j+=2) { | 1809 for (int j=0; j < test_size; j+=2) { |
1810 for (int i=0; i < input_size; i++) { | 1810 for (int i=0; i < input_size; i++) { |
1811 test.dt = inputs_dt[i]; | 1811 test.dt = inputs_dt[i]; |
1812 test.dd = tests_D[j]; | 1812 test.dd = tests_D[j]; |
1813 test.ds = inputs_ds[i]; | 1813 test.ds = inputs_ds[i]; |
1814 test.ft = inputs_ft[i]; | 1814 test.ft = inputs_ft[i]; |
1815 test.fd = tests_S[j]; | 1815 test.fd = tests_S[j]; |
1816 test.fs = inputs_fs[i]; | 1816 test.fs = inputs_fs[i]; |
1817 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 1817 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
1818 CHECK_EQ(test.dd, inputs_ds[i]); | 1818 CHECK_EQ(test.dd, inputs_ds[i]); |
1819 CHECK_EQ(test.fd, inputs_fs[i]); | 1819 CHECK_EQ(test.fd, inputs_fs[i]); |
1820 | 1820 |
1821 test.dd = tests_D[j+1]; | 1821 test.dd = tests_D[j+1]; |
1822 test.fd = tests_S[j+1]; | 1822 test.fd = tests_S[j+1]; |
1823 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 1823 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
1824 CHECK_EQ(test.dd, inputs_dt[i]); | 1824 CHECK_EQ(test.dd, inputs_dt[i]); |
1825 CHECK_EQ(test.fd, inputs_ft[i]); | 1825 CHECK_EQ(test.fd, inputs_ft[i]); |
1826 } | 1826 } |
1827 } | 1827 } |
1828 } | 1828 } |
1829 } | 1829 } |
1830 | 1830 |
1831 | 1831 |
1832 TEST(rint_s) { | 1832 TEST(rint_s) { |
1833 if (kArchVariant == kMips64r6) { | 1833 if (kArchVariant == kMips64r6) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1920 CodeDesc desc; | 1920 CodeDesc desc; |
1921 assm.GetCode(&desc); | 1921 assm.GetCode(&desc); |
1922 Handle<Code> code = isolate->factory()->NewCode( | 1922 Handle<Code> code = isolate->factory()->NewCode( |
1923 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1923 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1924 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1924 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1925 | 1925 |
1926 for (int j = 0; j < 4; j++) { | 1926 for (int j = 0; j < 4; j++) { |
1927 test.fcsr = fcsr_inputs[j]; | 1927 test.fcsr = fcsr_inputs[j]; |
1928 for (int i = 0; i < kTableLength; i++) { | 1928 for (int i = 0; i < kTableLength; i++) { |
1929 test.a = inputs[i]; | 1929 test.a = inputs[i]; |
1930 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 1930 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
1931 CHECK_EQ(test.b, outputs[j][i]); | 1931 CHECK_EQ(test.b, outputs[j][i]); |
1932 } | 1932 } |
1933 } | 1933 } |
1934 } | 1934 } |
1935 } | 1935 } |
1936 | 1936 |
1937 | 1937 |
1938 TEST(mina_maxa) { | 1938 TEST(mina_maxa) { |
1939 if (kArchVariant == kMips64r6) { | 1939 if (kArchVariant == kMips64r6) { |
1940 const int kTableLength = 15; | 1940 const int kTableLength = 15; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2008 CodeDesc desc; | 2008 CodeDesc desc; |
2009 assm.GetCode(&desc); | 2009 assm.GetCode(&desc); |
2010 Handle<Code> code = isolate->factory()->NewCode( | 2010 Handle<Code> code = isolate->factory()->NewCode( |
2011 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2011 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2012 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2012 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2013 for (int i = 0; i < kTableLength; i++) { | 2013 for (int i = 0; i < kTableLength; i++) { |
2014 test.a = inputsa[i]; | 2014 test.a = inputsa[i]; |
2015 test.b = inputsb[i]; | 2015 test.b = inputsb[i]; |
2016 test.c = inputsc[i]; | 2016 test.c = inputsc[i]; |
2017 test.d = inputsd[i]; | 2017 test.d = inputsd[i]; |
2018 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2018 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2019 | 2019 |
2020 if (i < kTableLength - 1) { | 2020 if (i < kTableLength - 1) { |
2021 CHECK_EQ(test.resd, resd[i]); | 2021 CHECK_EQ(test.resd, resd[i]); |
2022 CHECK_EQ(test.resf, resf[i]); | 2022 CHECK_EQ(test.resf, resf[i]); |
2023 CHECK_EQ(test.resd1, resd1[i]); | 2023 CHECK_EQ(test.resd1, resd1[i]); |
2024 CHECK_EQ(test.resf1, resf1[i]); | 2024 CHECK_EQ(test.resf1, resf1[i]); |
2025 } else { | 2025 } else { |
2026 DCHECK(std::isnan(test.resd)); | 2026 DCHECK(std::isnan(test.resd)); |
2027 DCHECK(std::isnan(test.resf)); | 2027 DCHECK(std::isnan(test.resf)); |
2028 DCHECK(std::isnan(test.resd1)); | 2028 DCHECK(std::isnan(test.resd1)); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 __ nop(); | 2079 __ nop(); |
2080 Test test; | 2080 Test test; |
2081 CodeDesc desc; | 2081 CodeDesc desc; |
2082 assm.GetCode(&desc); | 2082 assm.GetCode(&desc); |
2083 Handle<Code> code = isolate->factory()->NewCode( | 2083 Handle<Code> code = isolate->factory()->NewCode( |
2084 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2084 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2085 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2085 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2086 for (int i = 0; i < kTableLength; i++) { | 2086 for (int i = 0; i < kTableLength; i++) { |
2087 test.a = inputs_D[i]; | 2087 test.a = inputs_D[i]; |
2088 test.b = inputs_S[i]; | 2088 test.b = inputs_S[i]; |
2089 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2089 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2090 CHECK_EQ(test.c, outputs[i]); | 2090 CHECK_EQ(test.c, outputs[i]); |
2091 CHECK_EQ(test.d, test.c); | 2091 CHECK_EQ(test.d, test.c); |
2092 } | 2092 } |
2093 } | 2093 } |
2094 } | 2094 } |
2095 | 2095 |
2096 | 2096 |
2097 TEST(movz_movn) { | 2097 TEST(movz_movn) { |
2098 if (kArchVariant == kMips64r2) { | 2098 if (kArchVariant == kMips64r2) { |
2099 const int kTableLength = 4; | 2099 const int kTableLength = 4; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2156 CodeDesc desc; | 2156 CodeDesc desc; |
2157 assm.GetCode(&desc); | 2157 assm.GetCode(&desc); |
2158 Handle<Code> code = isolate->factory()->NewCode( | 2158 Handle<Code> code = isolate->factory()->NewCode( |
2159 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2159 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2160 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2160 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2161 for (int i = 0; i < kTableLength; i++) { | 2161 for (int i = 0; i < kTableLength; i++) { |
2162 test.a = inputs_D[i]; | 2162 test.a = inputs_D[i]; |
2163 test.c = inputs_S[i]; | 2163 test.c = inputs_S[i]; |
2164 | 2164 |
2165 test.rt = 1; | 2165 test.rt = 1; |
2166 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2166 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2167 CHECK_EQ(test.b, test.bold); | 2167 CHECK_EQ(test.b, test.bold); |
2168 CHECK_EQ(test.d, test.dold); | 2168 CHECK_EQ(test.d, test.dold); |
2169 CHECK_EQ(test.b1, outputs_D[i]); | 2169 CHECK_EQ(test.b1, outputs_D[i]); |
2170 CHECK_EQ(test.d1, outputs_S[i]); | 2170 CHECK_EQ(test.d1, outputs_S[i]); |
2171 | 2171 |
2172 test.rt = 0; | 2172 test.rt = 0; |
2173 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2173 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2174 CHECK_EQ(test.b, outputs_D[i]); | 2174 CHECK_EQ(test.b, outputs_D[i]); |
2175 CHECK_EQ(test.d, outputs_S[i]); | 2175 CHECK_EQ(test.d, outputs_S[i]); |
2176 CHECK_EQ(test.b1, test.bold1); | 2176 CHECK_EQ(test.b1, test.bold1); |
2177 CHECK_EQ(test.d1, test.dold1); | 2177 CHECK_EQ(test.d1, test.dold1); |
2178 } | 2178 } |
2179 } | 2179 } |
2180 } | 2180 } |
2181 | 2181 |
2182 | 2182 |
2183 TEST(movt_movd) { | 2183 TEST(movt_movd) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2252 __ ctc1(t0, FCSR); | 2252 __ ctc1(t0, FCSR); |
2253 __ jr(ra); | 2253 __ jr(ra); |
2254 __ nop(); | 2254 __ nop(); |
2255 | 2255 |
2256 CodeDesc desc; | 2256 CodeDesc desc; |
2257 assm.GetCode(&desc); | 2257 assm.GetCode(&desc); |
2258 Handle<Code> code = isolate->factory()->NewCode( | 2258 Handle<Code> code = isolate->factory()->NewCode( |
2259 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2259 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2260 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2260 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2261 | 2261 |
2262 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2262 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2263 CHECK_EQ(test.dstf, outputs_S[i]); | 2263 CHECK_EQ(test.dstf, outputs_S[i]); |
2264 CHECK_EQ(test.dstd, outputs_D[i]); | 2264 CHECK_EQ(test.dstd, outputs_D[i]); |
2265 CHECK_EQ(test.dstf1, test.dstfold1); | 2265 CHECK_EQ(test.dstf1, test.dstfold1); |
2266 CHECK_EQ(test.dstd1, test.dstdold1); | 2266 CHECK_EQ(test.dstd1, test.dstdold1); |
2267 test.fcsr = 0; | 2267 test.fcsr = 0; |
2268 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2268 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2269 CHECK_EQ(test.dstf, test.dstfold); | 2269 CHECK_EQ(test.dstf, test.dstfold); |
2270 CHECK_EQ(test.dstd, test.dstdold); | 2270 CHECK_EQ(test.dstd, test.dstdold); |
2271 CHECK_EQ(test.dstf1, outputs_S[i]); | 2271 CHECK_EQ(test.dstf1, outputs_S[i]); |
2272 CHECK_EQ(test.dstd1, outputs_D[i]); | 2272 CHECK_EQ(test.dstd1, outputs_D[i]); |
2273 } | 2273 } |
2274 } | 2274 } |
2275 } | 2275 } |
2276 } | 2276 } |
2277 | 2277 |
2278 | 2278 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2341 Test test; | 2341 Test test; |
2342 CodeDesc desc; | 2342 CodeDesc desc; |
2343 assm.GetCode(&desc); | 2343 assm.GetCode(&desc); |
2344 Handle<Code> code = isolate->factory()->NewCode( | 2344 Handle<Code> code = isolate->factory()->NewCode( |
2345 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2345 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2346 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2346 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2347 for (int j = 0; j < 4; j++) { | 2347 for (int j = 0; j < 4; j++) { |
2348 test.fcsr = fcsr_inputs[j]; | 2348 test.fcsr = fcsr_inputs[j]; |
2349 for (int i = 0; i < kTableLength; i++) { | 2349 for (int i = 0; i < kTableLength; i++) { |
2350 test.a = inputs[i]; | 2350 test.a = inputs[i]; |
2351 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2351 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2352 CHECK_EQ(test.b, outputs[j][i]); | 2352 CHECK_EQ(test.b, outputs[j][i]); |
2353 } | 2353 } |
2354 } | 2354 } |
2355 } | 2355 } |
2356 | 2356 |
2357 | 2357 |
2358 TEST(trunc_w) { | 2358 TEST(trunc_w) { |
2359 CcTest::InitializeVM(); | 2359 CcTest::InitializeVM(); |
2360 Isolate* isolate = CcTest::i_isolate(); | 2360 Isolate* isolate = CcTest::i_isolate(); |
2361 HandleScope scope(isolate); | 2361 HandleScope scope(isolate); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2398 __ nop(); | 2398 __ nop(); |
2399 Test test; | 2399 Test test; |
2400 CodeDesc desc; | 2400 CodeDesc desc; |
2401 assm.GetCode(&desc); | 2401 assm.GetCode(&desc); |
2402 Handle<Code> code = isolate->factory()->NewCode( | 2402 Handle<Code> code = isolate->factory()->NewCode( |
2403 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2403 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2404 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2404 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2405 for (int i = 0; i < kTableLength; i++) { | 2405 for (int i = 0; i < kTableLength; i++) { |
2406 test.a = inputs_D[i]; | 2406 test.a = inputs_D[i]; |
2407 test.b = inputs_S[i]; | 2407 test.b = inputs_S[i]; |
2408 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2408 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2409 CHECK_EQ(test.c, outputs[i]); | 2409 CHECK_EQ(test.c, outputs[i]); |
2410 CHECK_EQ(test.d, test.c); | 2410 CHECK_EQ(test.d, test.c); |
2411 } | 2411 } |
2412 } | 2412 } |
2413 | 2413 |
2414 | 2414 |
2415 TEST(round_w) { | 2415 TEST(round_w) { |
2416 CcTest::InitializeVM(); | 2416 CcTest::InitializeVM(); |
2417 Isolate* isolate = CcTest::i_isolate(); | 2417 Isolate* isolate = CcTest::i_isolate(); |
2418 HandleScope scope(isolate); | 2418 HandleScope scope(isolate); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 __ nop(); | 2455 __ nop(); |
2456 Test test; | 2456 Test test; |
2457 CodeDesc desc; | 2457 CodeDesc desc; |
2458 assm.GetCode(&desc); | 2458 assm.GetCode(&desc); |
2459 Handle<Code> code = isolate->factory()->NewCode( | 2459 Handle<Code> code = isolate->factory()->NewCode( |
2460 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2460 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2461 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2461 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2462 for (int i = 0; i < kTableLength; i++) { | 2462 for (int i = 0; i < kTableLength; i++) { |
2463 test.a = inputs_D[i]; | 2463 test.a = inputs_D[i]; |
2464 test.b = inputs_S[i]; | 2464 test.b = inputs_S[i]; |
2465 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2465 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2466 CHECK_EQ(test.c, outputs[i]); | 2466 CHECK_EQ(test.c, outputs[i]); |
2467 CHECK_EQ(test.d, test.c); | 2467 CHECK_EQ(test.d, test.c); |
2468 } | 2468 } |
2469 } | 2469 } |
2470 | 2470 |
2471 | 2471 |
2472 TEST(round_l) { | 2472 TEST(round_l) { |
2473 CcTest::InitializeVM(); | 2473 CcTest::InitializeVM(); |
2474 Isolate* isolate = CcTest::i_isolate(); | 2474 Isolate* isolate = CcTest::i_isolate(); |
2475 HandleScope scope(isolate); | 2475 HandleScope scope(isolate); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2513 Test test; | 2513 Test test; |
2514 CodeDesc desc; | 2514 CodeDesc desc; |
2515 assm.GetCode(&desc); | 2515 assm.GetCode(&desc); |
2516 Handle<Code> code = isolate->factory()->NewCode( | 2516 Handle<Code> code = isolate->factory()->NewCode( |
2517 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2517 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2518 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2518 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2519 for (int i = 0; i < kTableLength; i++) { | 2519 for (int i = 0; i < kTableLength; i++) { |
2520 test.a = inputs_D[i]; | 2520 test.a = inputs_D[i]; |
2521 test.b = inputs_S[i]; | 2521 test.b = inputs_S[i]; |
2522 std::cout<< i<< "\n"; | 2522 std::cout<< i<< "\n"; |
2523 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2523 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2524 CHECK_EQ(test.c, outputs[i]); | 2524 CHECK_EQ(test.c, outputs[i]); |
2525 CHECK_EQ(test.d, test.c); | 2525 CHECK_EQ(test.d, test.c); |
2526 } | 2526 } |
2527 } | 2527 } |
2528 | 2528 |
2529 | 2529 |
2530 TEST(sub) { | 2530 TEST(sub) { |
2531 const int kTableLength = 12; | 2531 const int kTableLength = 12; |
2532 CcTest::InitializeVM(); | 2532 CcTest::InitializeVM(); |
2533 Isolate* isolate = CcTest::i_isolate(); | 2533 Isolate* isolate = CcTest::i_isolate(); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2582 CodeDesc desc; | 2582 CodeDesc desc; |
2583 assm.GetCode(&desc); | 2583 assm.GetCode(&desc); |
2584 Handle<Code> code = isolate->factory()->NewCode( | 2584 Handle<Code> code = isolate->factory()->NewCode( |
2585 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2585 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2586 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2586 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2587 for (int i = 0; i < kTableLength; i++) { | 2587 for (int i = 0; i < kTableLength; i++) { |
2588 test.a = inputfs_S[i]; | 2588 test.a = inputfs_S[i]; |
2589 test.b = inputft_S[i]; | 2589 test.b = inputft_S[i]; |
2590 test.c = inputfs_D[i]; | 2590 test.c = inputfs_D[i]; |
2591 test.d = inputft_D[i]; | 2591 test.d = inputft_D[i]; |
2592 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2592 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2593 CHECK_EQ(test.resultS, outputs_S[i]); | 2593 CHECK_EQ(test.resultS, outputs_S[i]); |
2594 CHECK_EQ(test.resultD, outputs_D[i]); | 2594 CHECK_EQ(test.resultD, outputs_D[i]); |
2595 } | 2595 } |
2596 } | 2596 } |
2597 | 2597 |
2598 | 2598 |
2599 TEST(sqrt_rsqrt_recip) { | 2599 TEST(sqrt_rsqrt_recip) { |
2600 const int kTableLength = 4; | 2600 const int kTableLength = 4; |
2601 const double deltaDouble = 2E-15; | 2601 const double deltaDouble = 2E-15; |
2602 const float deltaFloat = 2E-7; | 2602 const float deltaFloat = 2E-7; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2657 Handle<Code> code = isolate->factory()->NewCode( | 2657 Handle<Code> code = isolate->factory()->NewCode( |
2658 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2658 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2659 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2659 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2660 | 2660 |
2661 for (int i = 0; i < kTableLength; i++) { | 2661 for (int i = 0; i < kTableLength; i++) { |
2662 float f1; | 2662 float f1; |
2663 double d1; | 2663 double d1; |
2664 test.a = inputs_S[i]; | 2664 test.a = inputs_S[i]; |
2665 test.c = inputs_D[i]; | 2665 test.c = inputs_D[i]; |
2666 | 2666 |
2667 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2667 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2668 | 2668 |
2669 CHECK_EQ(test.resultS, outputs_S[i]); | 2669 CHECK_EQ(test.resultS, outputs_S[i]); |
2670 CHECK_EQ(test.resultD, outputs_D[i]); | 2670 CHECK_EQ(test.resultD, outputs_D[i]); |
2671 | 2671 |
2672 if (i != 0) { | 2672 if (i != 0) { |
2673 f1 = test.resultS1 - 1.0F/outputs_S[i]; | 2673 f1 = test.resultS1 - 1.0F/outputs_S[i]; |
2674 f1 = (f1 < 0) ? f1 : -f1; | 2674 f1 = (f1 < 0) ? f1 : -f1; |
2675 CHECK(f1 <= deltaFloat); | 2675 CHECK(f1 <= deltaFloat); |
2676 d1 = test.resultD1 - 1.0L/outputs_D[i]; | 2676 d1 = test.resultD1 - 1.0L/outputs_D[i]; |
2677 d1 = (d1 < 0) ? d1 : -d1; | 2677 d1 = (d1 < 0) ? d1 : -d1; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2731 __ nop(); | 2731 __ nop(); |
2732 | 2732 |
2733 CodeDesc desc; | 2733 CodeDesc desc; |
2734 assm.GetCode(&desc); | 2734 assm.GetCode(&desc); |
2735 Handle<Code> code = isolate->factory()->NewCode( | 2735 Handle<Code> code = isolate->factory()->NewCode( |
2736 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2736 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2737 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2737 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2738 for (int i = 0; i < kTableLength; i++) { | 2738 for (int i = 0; i < kTableLength; i++) { |
2739 test.a = inputs_S[i]; | 2739 test.a = inputs_S[i]; |
2740 test.c = inputs_D[i]; | 2740 test.c = inputs_D[i]; |
2741 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2741 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2742 CHECK_EQ(test.resultS, outputs_S[i]); | 2742 CHECK_EQ(test.resultS, outputs_S[i]); |
2743 CHECK_EQ(test.resultD, outputs_D[i]); | 2743 CHECK_EQ(test.resultD, outputs_D[i]); |
2744 } | 2744 } |
2745 } | 2745 } |
2746 | 2746 |
2747 | 2747 |
2748 | 2748 |
2749 TEST(mul) { | 2749 TEST(mul) { |
2750 const int kTableLength = 4; | 2750 const int kTableLength = 4; |
2751 CcTest::InitializeVM(); | 2751 CcTest::InitializeVM(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2791 CodeDesc desc; | 2791 CodeDesc desc; |
2792 assm.GetCode(&desc); | 2792 assm.GetCode(&desc); |
2793 Handle<Code> code = isolate->factory()->NewCode( | 2793 Handle<Code> code = isolate->factory()->NewCode( |
2794 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2794 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2795 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2795 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2796 for (int i = 0; i < kTableLength; i++) { | 2796 for (int i = 0; i < kTableLength; i++) { |
2797 test.a = inputfs_S[i]; | 2797 test.a = inputfs_S[i]; |
2798 test.b = inputft_S[i]; | 2798 test.b = inputft_S[i]; |
2799 test.c = inputfs_D[i]; | 2799 test.c = inputfs_D[i]; |
2800 test.d = inputft_D[i]; | 2800 test.d = inputft_D[i]; |
2801 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2801 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2802 CHECK_EQ(test.resultS, inputfs_S[i]*inputft_S[i]); | 2802 CHECK_EQ(test.resultS, inputfs_S[i]*inputft_S[i]); |
2803 CHECK_EQ(test.resultD, inputfs_D[i]*inputft_D[i]); | 2803 CHECK_EQ(test.resultD, inputfs_D[i]*inputft_D[i]); |
2804 } | 2804 } |
2805 } | 2805 } |
2806 | 2806 |
2807 | 2807 |
2808 TEST(mov) { | 2808 TEST(mov) { |
2809 const int kTableLength = 4; | 2809 const int kTableLength = 4; |
2810 CcTest::InitializeVM(); | 2810 CcTest::InitializeVM(); |
2811 Isolate* isolate = CcTest::i_isolate(); | 2811 Isolate* isolate = CcTest::i_isolate(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2845 | 2845 |
2846 CodeDesc desc; | 2846 CodeDesc desc; |
2847 assm.GetCode(&desc); | 2847 assm.GetCode(&desc); |
2848 Handle<Code> code = isolate->factory()->NewCode( | 2848 Handle<Code> code = isolate->factory()->NewCode( |
2849 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2849 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2850 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2850 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2851 for (int i = 0; i < kTableLength; i++) { | 2851 for (int i = 0; i < kTableLength; i++) { |
2852 test.a = inputs_D[i]; | 2852 test.a = inputs_D[i]; |
2853 test.c = inputs_S[i]; | 2853 test.c = inputs_S[i]; |
2854 | 2854 |
2855 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2855 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2856 CHECK_EQ(test.b, outputs_D[i]); | 2856 CHECK_EQ(test.b, outputs_D[i]); |
2857 CHECK_EQ(test.d, outputs_S[i]); | 2857 CHECK_EQ(test.d, outputs_S[i]); |
2858 } | 2858 } |
2859 } | 2859 } |
2860 | 2860 |
2861 | 2861 |
2862 TEST(floor_w) { | 2862 TEST(floor_w) { |
2863 CcTest::InitializeVM(); | 2863 CcTest::InitializeVM(); |
2864 Isolate* isolate = CcTest::i_isolate(); | 2864 Isolate* isolate = CcTest::i_isolate(); |
2865 HandleScope scope(isolate); | 2865 HandleScope scope(isolate); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2902 __ nop(); | 2902 __ nop(); |
2903 Test test; | 2903 Test test; |
2904 CodeDesc desc; | 2904 CodeDesc desc; |
2905 assm.GetCode(&desc); | 2905 assm.GetCode(&desc); |
2906 Handle<Code> code = isolate->factory()->NewCode( | 2906 Handle<Code> code = isolate->factory()->NewCode( |
2907 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2907 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2908 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2908 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2909 for (int i = 0; i < kTableLength; i++) { | 2909 for (int i = 0; i < kTableLength; i++) { |
2910 test.a = inputs_D[i]; | 2910 test.a = inputs_D[i]; |
2911 test.b = inputs_S[i]; | 2911 test.b = inputs_S[i]; |
2912 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2912 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2913 CHECK_EQ(test.c, outputs[i]); | 2913 CHECK_EQ(test.c, outputs[i]); |
2914 CHECK_EQ(test.d, test.c); | 2914 CHECK_EQ(test.d, test.c); |
2915 } | 2915 } |
2916 } | 2916 } |
2917 | 2917 |
2918 | 2918 |
2919 TEST(floor_l) { | 2919 TEST(floor_l) { |
2920 CcTest::InitializeVM(); | 2920 CcTest::InitializeVM(); |
2921 Isolate* isolate = CcTest::i_isolate(); | 2921 Isolate* isolate = CcTest::i_isolate(); |
2922 HandleScope scope(isolate); | 2922 HandleScope scope(isolate); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2959 __ nop(); | 2959 __ nop(); |
2960 Test test; | 2960 Test test; |
2961 CodeDesc desc; | 2961 CodeDesc desc; |
2962 assm.GetCode(&desc); | 2962 assm.GetCode(&desc); |
2963 Handle<Code> code = isolate->factory()->NewCode( | 2963 Handle<Code> code = isolate->factory()->NewCode( |
2964 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2964 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2965 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2965 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2966 for (int i = 0; i < kTableLength; i++) { | 2966 for (int i = 0; i < kTableLength; i++) { |
2967 test.a = inputs_D[i]; | 2967 test.a = inputs_D[i]; |
2968 test.b = inputs_S[i]; | 2968 test.b = inputs_S[i]; |
2969 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 2969 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
2970 CHECK_EQ(test.c, outputs[i]); | 2970 CHECK_EQ(test.c, outputs[i]); |
2971 CHECK_EQ(test.d, test.c); | 2971 CHECK_EQ(test.d, test.c); |
2972 } | 2972 } |
2973 } | 2973 } |
2974 | 2974 |
2975 | 2975 |
2976 TEST(ceil_w) { | 2976 TEST(ceil_w) { |
2977 CcTest::InitializeVM(); | 2977 CcTest::InitializeVM(); |
2978 Isolate* isolate = CcTest::i_isolate(); | 2978 Isolate* isolate = CcTest::i_isolate(); |
2979 HandleScope scope(isolate); | 2979 HandleScope scope(isolate); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3016 __ nop(); | 3016 __ nop(); |
3017 Test test; | 3017 Test test; |
3018 CodeDesc desc; | 3018 CodeDesc desc; |
3019 assm.GetCode(&desc); | 3019 assm.GetCode(&desc); |
3020 Handle<Code> code = isolate->factory()->NewCode( | 3020 Handle<Code> code = isolate->factory()->NewCode( |
3021 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3021 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
3022 F3 f = FUNCTION_CAST<F3>(code->entry()); | 3022 F3 f = FUNCTION_CAST<F3>(code->entry()); |
3023 for (int i = 0; i < kTableLength; i++) { | 3023 for (int i = 0; i < kTableLength; i++) { |
3024 test.a = inputs_D[i]; | 3024 test.a = inputs_D[i]; |
3025 test.b = inputs_S[i]; | 3025 test.b = inputs_S[i]; |
3026 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3026 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3027 CHECK_EQ(test.c, outputs[i]); | 3027 CHECK_EQ(test.c, outputs[i]); |
3028 CHECK_EQ(test.d, test.c); | 3028 CHECK_EQ(test.d, test.c); |
3029 } | 3029 } |
3030 } | 3030 } |
3031 | 3031 |
3032 | 3032 |
3033 TEST(ceil_l) { | 3033 TEST(ceil_l) { |
3034 CcTest::InitializeVM(); | 3034 CcTest::InitializeVM(); |
3035 Isolate* isolate = CcTest::i_isolate(); | 3035 Isolate* isolate = CcTest::i_isolate(); |
3036 HandleScope scope(isolate); | 3036 HandleScope scope(isolate); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3073 __ nop(); | 3073 __ nop(); |
3074 Test test; | 3074 Test test; |
3075 CodeDesc desc; | 3075 CodeDesc desc; |
3076 assm.GetCode(&desc); | 3076 assm.GetCode(&desc); |
3077 Handle<Code> code = isolate->factory()->NewCode( | 3077 Handle<Code> code = isolate->factory()->NewCode( |
3078 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3078 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
3079 F3 f = FUNCTION_CAST<F3>(code->entry()); | 3079 F3 f = FUNCTION_CAST<F3>(code->entry()); |
3080 for (int i = 0; i < kTableLength; i++) { | 3080 for (int i = 0; i < kTableLength; i++) { |
3081 test.a = inputs_D[i]; | 3081 test.a = inputs_D[i]; |
3082 test.b = inputs_S[i]; | 3082 test.b = inputs_S[i]; |
3083 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3083 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3084 CHECK_EQ(test.c, outputs[i]); | 3084 CHECK_EQ(test.c, outputs[i]); |
3085 CHECK_EQ(test.d, test.c); | 3085 CHECK_EQ(test.d, test.c); |
3086 } | 3086 } |
3087 } | 3087 } |
3088 | 3088 |
3089 | 3089 |
3090 TEST(jump_tables1) { | 3090 TEST(jump_tables1) { |
3091 // Test jump tables with forward jumps. | 3091 // Test jump tables with forward jumps. |
3092 CcTest::InitializeVM(); | 3092 CcTest::InitializeVM(); |
3093 Isolate* isolate = CcTest::i_isolate(); | 3093 Isolate* isolate = CcTest::i_isolate(); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3142 CodeDesc desc; | 3142 CodeDesc desc; |
3143 assm.GetCode(&desc); | 3143 assm.GetCode(&desc); |
3144 Handle<Code> code = isolate->factory()->NewCode( | 3144 Handle<Code> code = isolate->factory()->NewCode( |
3145 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3145 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
3146 #ifdef OBJECT_PRINT | 3146 #ifdef OBJECT_PRINT |
3147 code->Print(std::cout); | 3147 code->Print(std::cout); |
3148 #endif | 3148 #endif |
3149 F1 f = FUNCTION_CAST<F1>(code->entry()); | 3149 F1 f = FUNCTION_CAST<F1>(code->entry()); |
3150 for (int i = 0; i < kNumCases; ++i) { | 3150 for (int i = 0; i < kNumCases; ++i) { |
3151 int64_t res = reinterpret_cast<int64_t>( | 3151 int64_t res = reinterpret_cast<int64_t>( |
3152 CALL_GENERATED_CODE(f, i, 0, 0, 0, 0)); | 3152 CALL_GENERATED_CODE(isolate, f, i, 0, 0, 0, 0)); |
3153 ::printf("f(%d) = %" PRId64 "\n", i, res); | 3153 ::printf("f(%d) = %" PRId64 "\n", i, res); |
3154 CHECK_EQ(values[i], static_cast<int>(res)); | 3154 CHECK_EQ(values[i], static_cast<int>(res)); |
3155 } | 3155 } |
3156 } | 3156 } |
3157 | 3157 |
3158 | 3158 |
3159 TEST(jump_tables2) { | 3159 TEST(jump_tables2) { |
3160 // Test jump tables with backward jumps. | 3160 // Test jump tables with backward jumps. |
3161 CcTest::InitializeVM(); | 3161 CcTest::InitializeVM(); |
3162 Isolate* isolate = CcTest::i_isolate(); | 3162 Isolate* isolate = CcTest::i_isolate(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3215 CodeDesc desc; | 3215 CodeDesc desc; |
3216 assm.GetCode(&desc); | 3216 assm.GetCode(&desc); |
3217 Handle<Code> code = isolate->factory()->NewCode( | 3217 Handle<Code> code = isolate->factory()->NewCode( |
3218 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3218 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
3219 #ifdef OBJECT_PRINT | 3219 #ifdef OBJECT_PRINT |
3220 code->Print(std::cout); | 3220 code->Print(std::cout); |
3221 #endif | 3221 #endif |
3222 F1 f = FUNCTION_CAST<F1>(code->entry()); | 3222 F1 f = FUNCTION_CAST<F1>(code->entry()); |
3223 for (int i = 0; i < kNumCases; ++i) { | 3223 for (int i = 0; i < kNumCases; ++i) { |
3224 int64_t res = reinterpret_cast<int64_t>( | 3224 int64_t res = reinterpret_cast<int64_t>( |
3225 CALL_GENERATED_CODE(f, i, 0, 0, 0, 0)); | 3225 CALL_GENERATED_CODE(isolate, f, i, 0, 0, 0, 0)); |
3226 ::printf("f(%d) = %" PRId64 "\n", i, res); | 3226 ::printf("f(%d) = %" PRId64 "\n", i, res); |
3227 CHECK_EQ(values[i], res); | 3227 CHECK_EQ(values[i], res); |
3228 } | 3228 } |
3229 } | 3229 } |
3230 | 3230 |
3231 | 3231 |
3232 TEST(jump_tables3) { | 3232 TEST(jump_tables3) { |
3233 // Test jump tables with backward jumps and embedded heap objects. | 3233 // Test jump tables with backward jumps and embedded heap objects. |
3234 CcTest::InitializeVM(); | 3234 CcTest::InitializeVM(); |
3235 Isolate* isolate = CcTest::i_isolate(); | 3235 Isolate* isolate = CcTest::i_isolate(); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3297 | 3297 |
3298 CodeDesc desc; | 3298 CodeDesc desc; |
3299 assm.GetCode(&desc); | 3299 assm.GetCode(&desc); |
3300 Handle<Code> code = isolate->factory()->NewCode( | 3300 Handle<Code> code = isolate->factory()->NewCode( |
3301 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3301 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
3302 #ifdef OBJECT_PRINT | 3302 #ifdef OBJECT_PRINT |
3303 code->Print(std::cout); | 3303 code->Print(std::cout); |
3304 #endif | 3304 #endif |
3305 F1 f = FUNCTION_CAST<F1>(code->entry()); | 3305 F1 f = FUNCTION_CAST<F1>(code->entry()); |
3306 for (int i = 0; i < kNumCases; ++i) { | 3306 for (int i = 0; i < kNumCases; ++i) { |
3307 Handle<Object> result(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0), isolate); | 3307 Handle<Object> result( |
| 3308 CALL_GENERATED_CODE(isolate, f, i, 0, 0, 0, 0), isolate); |
3308 #ifdef OBJECT_PRINT | 3309 #ifdef OBJECT_PRINT |
3309 ::printf("f(%d) = ", i); | 3310 ::printf("f(%d) = ", i); |
3310 result->Print(std::cout); | 3311 result->Print(std::cout); |
3311 ::printf("\n"); | 3312 ::printf("\n"); |
3312 #endif | 3313 #endif |
3313 CHECK(values[i].is_identical_to(result)); | 3314 CHECK(values[i].is_identical_to(result)); |
3314 } | 3315 } |
3315 } | 3316 } |
3316 | 3317 |
3317 | 3318 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3371 assm.GetCode(&desc); | 3372 assm.GetCode(&desc); |
3372 Handle<Code> code = isolate->factory()->NewCode( | 3373 Handle<Code> code = isolate->factory()->NewCode( |
3373 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3374 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
3374 F3 f = FUNCTION_CAST<F3>(code->entry()); | 3375 F3 f = FUNCTION_CAST<F3>(code->entry()); |
3375 t.r1 = 0x00102100781A15C3; | 3376 t.r1 = 0x00102100781A15C3; |
3376 t.r2 = 0x001021008B71FCDE; | 3377 t.r2 = 0x001021008B71FCDE; |
3377 t.r3 = 0xFF8017FF781A15C3; | 3378 t.r3 = 0xFF8017FF781A15C3; |
3378 t.r4 = 0xFF8017FF8B71FCDE; | 3379 t.r4 = 0xFF8017FF8B71FCDE; |
3379 t.r5 = 0x10C021098B71FCDE; | 3380 t.r5 = 0x10C021098B71FCDE; |
3380 t.r6 = 0xFB8017FF781A15C3; | 3381 t.r6 = 0xFB8017FF781A15C3; |
3381 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 3382 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
3382 USE(dummy); | 3383 USE(dummy); |
3383 | 3384 |
3384 CHECK_EQ(static_cast<int64_t>(0x000000001E58A8C3L), t.r1); | 3385 CHECK_EQ(static_cast<int64_t>(0x000000001E58A8C3L), t.r1); |
3385 CHECK_EQ(static_cast<int64_t>(0xFFFFFFFFD18E3F7BL), t.r2); | 3386 CHECK_EQ(static_cast<int64_t>(0xFFFFFFFFD18E3F7BL), t.r2); |
3386 CHECK_EQ(static_cast<int64_t>(0x000000001E58A8C3L), t.r3); | 3387 CHECK_EQ(static_cast<int64_t>(0x000000001E58A8C3L), t.r3); |
3387 CHECK_EQ(static_cast<int64_t>(0xFFFFFFFFD18E3F7BL), t.r4); | 3388 CHECK_EQ(static_cast<int64_t>(0xFFFFFFFFD18E3F7BL), t.r4); |
3388 CHECK_EQ(static_cast<int64_t>(0x08038490D18E3F7BL), t.r5); | 3389 CHECK_EQ(static_cast<int64_t>(0x08038490D18E3F7BL), t.r5); |
3389 CHECK_EQ(static_cast<int64_t>(0xDF01E8FF1E58A8C3L), t.r6); | 3390 CHECK_EQ(static_cast<int64_t>(0xDF01E8FF1E58A8C3L), t.r6); |
3390 } | 3391 } |
3391 } | 3392 } |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3532 t.fQuietNan = std::numeric_limits<float>::quiet_NaN(); | 3533 t.fQuietNan = std::numeric_limits<float>::quiet_NaN(); |
3533 t.fNegInf = -0.5/0.0; | 3534 t.fNegInf = -0.5/0.0; |
3534 t.fNegNorm = -FLT_MIN; | 3535 t.fNegNorm = -FLT_MIN; |
3535 t.fNegSubnorm = -FLT_MIN / 1.5; | 3536 t.fNegSubnorm = -FLT_MIN / 1.5; |
3536 t.fNegZero = -0.0; | 3537 t.fNegZero = -0.0; |
3537 t.fPosInf = 100000.0 / 0.0; | 3538 t.fPosInf = 100000.0 / 0.0; |
3538 t.fPosNorm = FLT_MAX; | 3539 t.fPosNorm = FLT_MAX; |
3539 t.fPosSubnorm = FLT_MIN / 20.0; | 3540 t.fPosSubnorm = FLT_MIN / 20.0; |
3540 t.fPosZero = +0.0; | 3541 t.fPosZero = +0.0; |
3541 | 3542 |
3542 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 3543 Object* dummy = CALL_GENERATED_CODE(isolate, f, &t, 0, 0, 0, 0); |
3543 USE(dummy); | 3544 USE(dummy); |
3544 // Expected double results. | 3545 // Expected double results. |
3545 CHECK_EQ(bit_cast<int64_t>(t.dSignalingNan), 0x001); | 3546 CHECK_EQ(bit_cast<int64_t>(t.dSignalingNan), 0x001); |
3546 CHECK_EQ(bit_cast<int64_t>(t.dQuietNan), 0x002); | 3547 CHECK_EQ(bit_cast<int64_t>(t.dQuietNan), 0x002); |
3547 CHECK_EQ(bit_cast<int64_t>(t.dNegInf), 0x004); | 3548 CHECK_EQ(bit_cast<int64_t>(t.dNegInf), 0x004); |
3548 CHECK_EQ(bit_cast<int64_t>(t.dNegNorm), 0x008); | 3549 CHECK_EQ(bit_cast<int64_t>(t.dNegNorm), 0x008); |
3549 CHECK_EQ(bit_cast<int64_t>(t.dNegSubnorm), 0x010); | 3550 CHECK_EQ(bit_cast<int64_t>(t.dNegSubnorm), 0x010); |
3550 CHECK_EQ(bit_cast<int64_t>(t.dNegZero), 0x020); | 3551 CHECK_EQ(bit_cast<int64_t>(t.dNegZero), 0x020); |
3551 CHECK_EQ(bit_cast<int64_t>(t.dPosInf), 0x040); | 3552 CHECK_EQ(bit_cast<int64_t>(t.dPosInf), 0x040); |
3552 CHECK_EQ(bit_cast<int64_t>(t.dPosNorm), 0x080); | 3553 CHECK_EQ(bit_cast<int64_t>(t.dPosNorm), 0x080); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3603 __ jr(ra); | 3604 __ jr(ra); |
3604 __ nop(); | 3605 __ nop(); |
3605 | 3606 |
3606 CodeDesc desc; | 3607 CodeDesc desc; |
3607 assm.GetCode(&desc); | 3608 assm.GetCode(&desc); |
3608 Handle<Code> code = isolate->factory()->NewCode( | 3609 Handle<Code> code = isolate->factory()->NewCode( |
3609 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3610 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
3610 F3 f = FUNCTION_CAST<F3>(code->entry()); | 3611 F3 f = FUNCTION_CAST<F3>(code->entry()); |
3611 test.a = -2.0; | 3612 test.a = -2.0; |
3612 test.b = -2.0; | 3613 test.b = -2.0; |
3613 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3614 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3614 CHECK_EQ(test.a, 2.0); | 3615 CHECK_EQ(test.a, 2.0); |
3615 CHECK_EQ(test.b, 2.0); | 3616 CHECK_EQ(test.b, 2.0); |
3616 | 3617 |
3617 test.a = 2.0; | 3618 test.a = 2.0; |
3618 test.b = 2.0; | 3619 test.b = 2.0; |
3619 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3620 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3620 CHECK_EQ(test.a, 2.0); | 3621 CHECK_EQ(test.a, 2.0); |
3621 CHECK_EQ(test.b, 2.0); | 3622 CHECK_EQ(test.b, 2.0); |
3622 | 3623 |
3623 // Testing biggest positive number | 3624 // Testing biggest positive number |
3624 test.a = std::numeric_limits<double>::max(); | 3625 test.a = std::numeric_limits<double>::max(); |
3625 test.b = std::numeric_limits<float>::max(); | 3626 test.b = std::numeric_limits<float>::max(); |
3626 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3627 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3627 CHECK_EQ(test.a, std::numeric_limits<double>::max()); | 3628 CHECK_EQ(test.a, std::numeric_limits<double>::max()); |
3628 CHECK_EQ(test.b, std::numeric_limits<float>::max()); | 3629 CHECK_EQ(test.b, std::numeric_limits<float>::max()); |
3629 | 3630 |
3630 // Testing smallest negative number | 3631 // Testing smallest negative number |
3631 test.a = -std::numeric_limits<double>::max(); // lowest() | 3632 test.a = -std::numeric_limits<double>::max(); // lowest() |
3632 test.b = -std::numeric_limits<float>::max(); // lowest() | 3633 test.b = -std::numeric_limits<float>::max(); // lowest() |
3633 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3634 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3634 CHECK_EQ(test.a, std::numeric_limits<double>::max()); | 3635 CHECK_EQ(test.a, std::numeric_limits<double>::max()); |
3635 CHECK_EQ(test.b, std::numeric_limits<float>::max()); | 3636 CHECK_EQ(test.b, std::numeric_limits<float>::max()); |
3636 | 3637 |
3637 // Testing smallest positive number | 3638 // Testing smallest positive number |
3638 test.a = -std::numeric_limits<double>::min(); | 3639 test.a = -std::numeric_limits<double>::min(); |
3639 test.b = -std::numeric_limits<float>::min(); | 3640 test.b = -std::numeric_limits<float>::min(); |
3640 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3641 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3641 CHECK_EQ(test.a, std::numeric_limits<double>::min()); | 3642 CHECK_EQ(test.a, std::numeric_limits<double>::min()); |
3642 CHECK_EQ(test.b, std::numeric_limits<float>::min()); | 3643 CHECK_EQ(test.b, std::numeric_limits<float>::min()); |
3643 | 3644 |
3644 // Testing infinity | 3645 // Testing infinity |
3645 test.a = -std::numeric_limits<double>::max() | 3646 test.a = -std::numeric_limits<double>::max() |
3646 / std::numeric_limits<double>::min(); | 3647 / std::numeric_limits<double>::min(); |
3647 test.b = -std::numeric_limits<float>::max() | 3648 test.b = -std::numeric_limits<float>::max() |
3648 / std::numeric_limits<float>::min(); | 3649 / std::numeric_limits<float>::min(); |
3649 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3650 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3650 CHECK_EQ(test.a, std::numeric_limits<double>::max() | 3651 CHECK_EQ(test.a, std::numeric_limits<double>::max() |
3651 / std::numeric_limits<double>::min()); | 3652 / std::numeric_limits<double>::min()); |
3652 CHECK_EQ(test.b, std::numeric_limits<float>::max() | 3653 CHECK_EQ(test.b, std::numeric_limits<float>::max() |
3653 / std::numeric_limits<float>::min()); | 3654 / std::numeric_limits<float>::min()); |
3654 | 3655 |
3655 test.a = std::numeric_limits<double>::quiet_NaN(); | 3656 test.a = std::numeric_limits<double>::quiet_NaN(); |
3656 test.b = std::numeric_limits<float>::quiet_NaN(); | 3657 test.b = std::numeric_limits<float>::quiet_NaN(); |
3657 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3658 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3658 CHECK_EQ(std::isnan(test.a), true); | 3659 CHECK_EQ(std::isnan(test.a), true); |
3659 CHECK_EQ(std::isnan(test.b), true); | 3660 CHECK_EQ(std::isnan(test.b), true); |
3660 | 3661 |
3661 test.a = std::numeric_limits<double>::signaling_NaN(); | 3662 test.a = std::numeric_limits<double>::signaling_NaN(); |
3662 test.b = std::numeric_limits<float>::signaling_NaN(); | 3663 test.b = std::numeric_limits<float>::signaling_NaN(); |
3663 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3664 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3664 CHECK_EQ(std::isnan(test.a), true); | 3665 CHECK_EQ(std::isnan(test.a), true); |
3665 CHECK_EQ(std::isnan(test.b), true); | 3666 CHECK_EQ(std::isnan(test.b), true); |
3666 } | 3667 } |
3667 | 3668 |
3668 | 3669 |
3669 TEST(ADD_FMT) { | 3670 TEST(ADD_FMT) { |
3670 CcTest::InitializeVM(); | 3671 CcTest::InitializeVM(); |
3671 Isolate* isolate = CcTest::i_isolate(); | 3672 Isolate* isolate = CcTest::i_isolate(); |
3672 HandleScope scope(isolate); | 3673 HandleScope scope(isolate); |
3673 MacroAssembler assm(isolate, NULL, 0); | 3674 MacroAssembler assm(isolate, NULL, 0); |
(...skipping 24 matching lines...) Expand all Loading... |
3698 | 3699 |
3699 CodeDesc desc; | 3700 CodeDesc desc; |
3700 assm.GetCode(&desc); | 3701 assm.GetCode(&desc); |
3701 Handle<Code> code = isolate->factory()->NewCode( | 3702 Handle<Code> code = isolate->factory()->NewCode( |
3702 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3703 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
3703 F3 f = FUNCTION_CAST<F3>(code->entry()); | 3704 F3 f = FUNCTION_CAST<F3>(code->entry()); |
3704 test.a = 2.0; | 3705 test.a = 2.0; |
3705 test.b = 3.0; | 3706 test.b = 3.0; |
3706 test.fa = 2.0; | 3707 test.fa = 2.0; |
3707 test.fb = 3.0; | 3708 test.fb = 3.0; |
3708 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3709 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3709 CHECK_EQ(test.c, 5.0); | 3710 CHECK_EQ(test.c, 5.0); |
3710 CHECK_EQ(test.fc, 5.0); | 3711 CHECK_EQ(test.fc, 5.0); |
3711 | 3712 |
3712 test.a = std::numeric_limits<double>::max(); | 3713 test.a = std::numeric_limits<double>::max(); |
3713 test.b = -std::numeric_limits<double>::max(); // lowest() | 3714 test.b = -std::numeric_limits<double>::max(); // lowest() |
3714 test.fa = std::numeric_limits<float>::max(); | 3715 test.fa = std::numeric_limits<float>::max(); |
3715 test.fb = -std::numeric_limits<float>::max(); // lowest() | 3716 test.fb = -std::numeric_limits<float>::max(); // lowest() |
3716 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3717 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3717 CHECK_EQ(test.c, 0.0); | 3718 CHECK_EQ(test.c, 0.0); |
3718 CHECK_EQ(test.fc, 0.0); | 3719 CHECK_EQ(test.fc, 0.0); |
3719 | 3720 |
3720 test.a = std::numeric_limits<double>::max(); | 3721 test.a = std::numeric_limits<double>::max(); |
3721 test.b = std::numeric_limits<double>::max(); | 3722 test.b = std::numeric_limits<double>::max(); |
3722 test.fa = std::numeric_limits<float>::max(); | 3723 test.fa = std::numeric_limits<float>::max(); |
3723 test.fb = std::numeric_limits<float>::max(); | 3724 test.fb = std::numeric_limits<float>::max(); |
3724 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3725 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3725 CHECK_EQ(std::isfinite(test.c), false); | 3726 CHECK_EQ(std::isfinite(test.c), false); |
3726 CHECK_EQ(std::isfinite(test.fc), false); | 3727 CHECK_EQ(std::isfinite(test.fc), false); |
3727 | 3728 |
3728 test.a = 5.0; | 3729 test.a = 5.0; |
3729 test.b = std::numeric_limits<double>::signaling_NaN(); | 3730 test.b = std::numeric_limits<double>::signaling_NaN(); |
3730 test.fa = 5.0; | 3731 test.fa = 5.0; |
3731 test.fb = std::numeric_limits<float>::signaling_NaN(); | 3732 test.fb = std::numeric_limits<float>::signaling_NaN(); |
3732 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3733 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3733 CHECK_EQ(std::isnan(test.c), true); | 3734 CHECK_EQ(std::isnan(test.c), true); |
3734 CHECK_EQ(std::isnan(test.fc), true); | 3735 CHECK_EQ(std::isnan(test.fc), true); |
3735 } | 3736 } |
3736 | 3737 |
3737 | 3738 |
3738 TEST(C_COND_FMT) { | 3739 TEST(C_COND_FMT) { |
3739 if (kArchVariant == kMips64r2) { | 3740 if (kArchVariant == kMips64r2) { |
3740 CcTest::InitializeVM(); | 3741 CcTest::InitializeVM(); |
3741 Isolate* isolate = CcTest::i_isolate(); | 3742 Isolate* isolate = CcTest::i_isolate(); |
3742 HandleScope scope(isolate); | 3743 HandleScope scope(isolate); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3852 | 3853 |
3853 CodeDesc desc; | 3854 CodeDesc desc; |
3854 assm.GetCode(&desc); | 3855 assm.GetCode(&desc); |
3855 Handle<Code> code = isolate->factory()->NewCode( | 3856 Handle<Code> code = isolate->factory()->NewCode( |
3856 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3857 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
3857 F3 f = FUNCTION_CAST<F3>(code->entry()); | 3858 F3 f = FUNCTION_CAST<F3>(code->entry()); |
3858 test.dOp1 = 2.0; | 3859 test.dOp1 = 2.0; |
3859 test.dOp2 = 3.0; | 3860 test.dOp2 = 3.0; |
3860 test.fOp1 = 2.0; | 3861 test.fOp1 = 2.0; |
3861 test.fOp2 = 3.0; | 3862 test.fOp2 = 3.0; |
3862 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3863 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3863 CHECK_EQ(test.dF, 0U); | 3864 CHECK_EQ(test.dF, 0U); |
3864 CHECK_EQ(test.dUn, 0U); | 3865 CHECK_EQ(test.dUn, 0U); |
3865 CHECK_EQ(test.dEq, 0U); | 3866 CHECK_EQ(test.dEq, 0U); |
3866 CHECK_EQ(test.dUeq, 0U); | 3867 CHECK_EQ(test.dUeq, 0U); |
3867 CHECK_EQ(test.dOlt, 1U); | 3868 CHECK_EQ(test.dOlt, 1U); |
3868 CHECK_EQ(test.dUlt, 1U); | 3869 CHECK_EQ(test.dUlt, 1U); |
3869 CHECK_EQ(test.dOle, 1U); | 3870 CHECK_EQ(test.dOle, 1U); |
3870 CHECK_EQ(test.dUle, 1U); | 3871 CHECK_EQ(test.dUle, 1U); |
3871 CHECK_EQ(test.fF, 0U); | 3872 CHECK_EQ(test.fF, 0U); |
3872 CHECK_EQ(test.fUn, 0U); | 3873 CHECK_EQ(test.fUn, 0U); |
3873 CHECK_EQ(test.fEq, 0U); | 3874 CHECK_EQ(test.fEq, 0U); |
3874 CHECK_EQ(test.fUeq, 0U); | 3875 CHECK_EQ(test.fUeq, 0U); |
3875 CHECK_EQ(test.fOlt, 1U); | 3876 CHECK_EQ(test.fOlt, 1U); |
3876 CHECK_EQ(test.fUlt, 1U); | 3877 CHECK_EQ(test.fUlt, 1U); |
3877 CHECK_EQ(test.fOle, 1U); | 3878 CHECK_EQ(test.fOle, 1U); |
3878 CHECK_EQ(test.fUle, 1U); | 3879 CHECK_EQ(test.fUle, 1U); |
3879 | 3880 |
3880 test.dOp1 = std::numeric_limits<double>::max(); | 3881 test.dOp1 = std::numeric_limits<double>::max(); |
3881 test.dOp2 = std::numeric_limits<double>::min(); | 3882 test.dOp2 = std::numeric_limits<double>::min(); |
3882 test.fOp1 = std::numeric_limits<float>::min(); | 3883 test.fOp1 = std::numeric_limits<float>::min(); |
3883 test.fOp2 = -std::numeric_limits<float>::max(); // lowest() | 3884 test.fOp2 = -std::numeric_limits<float>::max(); // lowest() |
3884 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3885 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3885 CHECK_EQ(test.dF, 0U); | 3886 CHECK_EQ(test.dF, 0U); |
3886 CHECK_EQ(test.dUn, 0U); | 3887 CHECK_EQ(test.dUn, 0U); |
3887 CHECK_EQ(test.dEq, 0U); | 3888 CHECK_EQ(test.dEq, 0U); |
3888 CHECK_EQ(test.dUeq, 0U); | 3889 CHECK_EQ(test.dUeq, 0U); |
3889 CHECK_EQ(test.dOlt, 0U); | 3890 CHECK_EQ(test.dOlt, 0U); |
3890 CHECK_EQ(test.dUlt, 0U); | 3891 CHECK_EQ(test.dUlt, 0U); |
3891 CHECK_EQ(test.dOle, 0U); | 3892 CHECK_EQ(test.dOle, 0U); |
3892 CHECK_EQ(test.dUle, 0U); | 3893 CHECK_EQ(test.dUle, 0U); |
3893 CHECK_EQ(test.fF, 0U); | 3894 CHECK_EQ(test.fF, 0U); |
3894 CHECK_EQ(test.fUn, 0U); | 3895 CHECK_EQ(test.fUn, 0U); |
3895 CHECK_EQ(test.fEq, 0U); | 3896 CHECK_EQ(test.fEq, 0U); |
3896 CHECK_EQ(test.fUeq, 0U); | 3897 CHECK_EQ(test.fUeq, 0U); |
3897 CHECK_EQ(test.fOlt, 0U); | 3898 CHECK_EQ(test.fOlt, 0U); |
3898 CHECK_EQ(test.fUlt, 0U); | 3899 CHECK_EQ(test.fUlt, 0U); |
3899 CHECK_EQ(test.fOle, 0U); | 3900 CHECK_EQ(test.fOle, 0U); |
3900 CHECK_EQ(test.fUle, 0U); | 3901 CHECK_EQ(test.fUle, 0U); |
3901 | 3902 |
3902 test.dOp1 = -std::numeric_limits<double>::max(); // lowest() | 3903 test.dOp1 = -std::numeric_limits<double>::max(); // lowest() |
3903 test.dOp2 = -std::numeric_limits<double>::max(); // lowest() | 3904 test.dOp2 = -std::numeric_limits<double>::max(); // lowest() |
3904 test.fOp1 = std::numeric_limits<float>::max(); | 3905 test.fOp1 = std::numeric_limits<float>::max(); |
3905 test.fOp2 = std::numeric_limits<float>::max(); | 3906 test.fOp2 = std::numeric_limits<float>::max(); |
3906 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3907 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3907 CHECK_EQ(test.dF, 0U); | 3908 CHECK_EQ(test.dF, 0U); |
3908 CHECK_EQ(test.dUn, 0U); | 3909 CHECK_EQ(test.dUn, 0U); |
3909 CHECK_EQ(test.dEq, 1U); | 3910 CHECK_EQ(test.dEq, 1U); |
3910 CHECK_EQ(test.dUeq, 1U); | 3911 CHECK_EQ(test.dUeq, 1U); |
3911 CHECK_EQ(test.dOlt, 0U); | 3912 CHECK_EQ(test.dOlt, 0U); |
3912 CHECK_EQ(test.dUlt, 0U); | 3913 CHECK_EQ(test.dUlt, 0U); |
3913 CHECK_EQ(test.dOle, 1U); | 3914 CHECK_EQ(test.dOle, 1U); |
3914 CHECK_EQ(test.dUle, 1U); | 3915 CHECK_EQ(test.dUle, 1U); |
3915 CHECK_EQ(test.fF, 0U); | 3916 CHECK_EQ(test.fF, 0U); |
3916 CHECK_EQ(test.fUn, 0U); | 3917 CHECK_EQ(test.fUn, 0U); |
3917 CHECK_EQ(test.fEq, 1U); | 3918 CHECK_EQ(test.fEq, 1U); |
3918 CHECK_EQ(test.fUeq, 1U); | 3919 CHECK_EQ(test.fUeq, 1U); |
3919 CHECK_EQ(test.fOlt, 0U); | 3920 CHECK_EQ(test.fOlt, 0U); |
3920 CHECK_EQ(test.fUlt, 0U); | 3921 CHECK_EQ(test.fUlt, 0U); |
3921 CHECK_EQ(test.fOle, 1U); | 3922 CHECK_EQ(test.fOle, 1U); |
3922 CHECK_EQ(test.fUle, 1U); | 3923 CHECK_EQ(test.fUle, 1U); |
3923 | 3924 |
3924 test.dOp1 = std::numeric_limits<double>::quiet_NaN(); | 3925 test.dOp1 = std::numeric_limits<double>::quiet_NaN(); |
3925 test.dOp2 = 0.0; | 3926 test.dOp2 = 0.0; |
3926 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); | 3927 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); |
3927 test.fOp2 = 0.0; | 3928 test.fOp2 = 0.0; |
3928 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 3929 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
3929 CHECK_EQ(test.dF, 0U); | 3930 CHECK_EQ(test.dF, 0U); |
3930 CHECK_EQ(test.dUn, 1U); | 3931 CHECK_EQ(test.dUn, 1U); |
3931 CHECK_EQ(test.dEq, 0U); | 3932 CHECK_EQ(test.dEq, 0U); |
3932 CHECK_EQ(test.dUeq, 1U); | 3933 CHECK_EQ(test.dUeq, 1U); |
3933 CHECK_EQ(test.dOlt, 0U); | 3934 CHECK_EQ(test.dOlt, 0U); |
3934 CHECK_EQ(test.dUlt, 1U); | 3935 CHECK_EQ(test.dUlt, 1U); |
3935 CHECK_EQ(test.dOle, 0U); | 3936 CHECK_EQ(test.dOle, 0U); |
3936 CHECK_EQ(test.dUle, 1U); | 3937 CHECK_EQ(test.dUle, 1U); |
3937 CHECK_EQ(test.fF, 0U); | 3938 CHECK_EQ(test.fF, 0U); |
3938 CHECK_EQ(test.fUn, 1U); | 3939 CHECK_EQ(test.fUn, 1U); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4057 F3 f = FUNCTION_CAST<F3>(code->entry()); | 4058 F3 f = FUNCTION_CAST<F3>(code->entry()); |
4058 uint64_t dTrue = 0xFFFFFFFFFFFFFFFF; | 4059 uint64_t dTrue = 0xFFFFFFFFFFFFFFFF; |
4059 uint64_t dFalse = 0x0000000000000000; | 4060 uint64_t dFalse = 0x0000000000000000; |
4060 uint32_t fTrue = 0xFFFFFFFF; | 4061 uint32_t fTrue = 0xFFFFFFFF; |
4061 uint32_t fFalse = 0x00000000; | 4062 uint32_t fFalse = 0x00000000; |
4062 | 4063 |
4063 test.dOp1 = 2.0; | 4064 test.dOp1 = 2.0; |
4064 test.dOp2 = 3.0; | 4065 test.dOp2 = 3.0; |
4065 test.fOp1 = 2.0; | 4066 test.fOp1 = 2.0; |
4066 test.fOp2 = 3.0; | 4067 test.fOp2 = 3.0; |
4067 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4068 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4068 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); | 4069 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); |
4069 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse); | 4070 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse); |
4070 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse); | 4071 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse); |
4071 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dFalse); | 4072 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dFalse); |
4072 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dTrue); | 4073 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dTrue); |
4073 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dTrue); | 4074 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dTrue); |
4074 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dTrue); | 4075 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dTrue); |
4075 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue); | 4076 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue); |
4076 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue); | 4077 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue); |
4077 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue); | 4078 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue); |
4078 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dTrue); | 4079 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dTrue); |
4079 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse); | 4080 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse); |
4080 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse); | 4081 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse); |
4081 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fFalse); | 4082 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fFalse); |
4082 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fFalse); | 4083 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fFalse); |
4083 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fTrue); | 4084 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fTrue); |
4084 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fTrue); | 4085 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fTrue); |
4085 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fTrue); | 4086 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fTrue); |
4086 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fTrue); | 4087 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fTrue); |
4087 | 4088 |
4088 test.dOp1 = std::numeric_limits<double>::max(); | 4089 test.dOp1 = std::numeric_limits<double>::max(); |
4089 test.dOp2 = std::numeric_limits<double>::min(); | 4090 test.dOp2 = std::numeric_limits<double>::min(); |
4090 test.fOp1 = std::numeric_limits<float>::min(); | 4091 test.fOp1 = std::numeric_limits<float>::min(); |
4091 test.fOp2 = -std::numeric_limits<float>::max(); // lowest() | 4092 test.fOp2 = -std::numeric_limits<float>::max(); // lowest() |
4092 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4093 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4093 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); | 4094 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); |
4094 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse); | 4095 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse); |
4095 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse); | 4096 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse); |
4096 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dFalse); | 4097 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dFalse); |
4097 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse); | 4098 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse); |
4098 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dFalse); | 4099 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dFalse); |
4099 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dFalse); | 4100 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dFalse); |
4100 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dFalse); | 4101 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dFalse); |
4101 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue); | 4102 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue); |
4102 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue); | 4103 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue); |
4103 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dTrue); | 4104 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dTrue); |
4104 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse); | 4105 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse); |
4105 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse); | 4106 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse); |
4106 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fFalse); | 4107 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fFalse); |
4107 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fFalse); | 4108 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fFalse); |
4108 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fFalse); | 4109 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fFalse); |
4109 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fFalse); | 4110 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fFalse); |
4110 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fFalse); | 4111 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fFalse); |
4111 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fFalse); | 4112 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fFalse); |
4112 | 4113 |
4113 test.dOp1 = -std::numeric_limits<double>::max(); // lowest() | 4114 test.dOp1 = -std::numeric_limits<double>::max(); // lowest() |
4114 test.dOp2 = -std::numeric_limits<double>::max(); // lowest() | 4115 test.dOp2 = -std::numeric_limits<double>::max(); // lowest() |
4115 test.fOp1 = std::numeric_limits<float>::max(); | 4116 test.fOp1 = std::numeric_limits<float>::max(); |
4116 test.fOp2 = std::numeric_limits<float>::max(); | 4117 test.fOp2 = std::numeric_limits<float>::max(); |
4117 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4118 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4118 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); | 4119 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); |
4119 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse); | 4120 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dFalse); |
4120 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dTrue); | 4121 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dTrue); |
4121 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dTrue); | 4122 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dTrue); |
4122 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse); | 4123 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse); |
4123 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dFalse); | 4124 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dFalse); |
4124 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dTrue); | 4125 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dTrue); |
4125 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue); | 4126 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue); |
4126 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue); | 4127 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dTrue); |
4127 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dFalse); | 4128 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dFalse); |
4128 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dFalse); | 4129 CHECK_EQ(bit_cast<uint64_t>(test.dNe), dFalse); |
4129 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse); | 4130 CHECK_EQ(bit_cast<uint32_t>(test.fF), fFalse); |
4130 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse); | 4131 CHECK_EQ(bit_cast<uint32_t>(test.fUn), fFalse); |
4131 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fTrue); | 4132 CHECK_EQ(bit_cast<uint32_t>(test.fEq), fTrue); |
4132 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fTrue); | 4133 CHECK_EQ(bit_cast<uint32_t>(test.fUeq), fTrue); |
4133 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fFalse); | 4134 CHECK_EQ(bit_cast<uint32_t>(test.fOlt), fFalse); |
4134 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fFalse); | 4135 CHECK_EQ(bit_cast<uint32_t>(test.fUlt), fFalse); |
4135 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fTrue); | 4136 CHECK_EQ(bit_cast<uint32_t>(test.fOle), fTrue); |
4136 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fTrue); | 4137 CHECK_EQ(bit_cast<uint32_t>(test.fUle), fTrue); |
4137 | 4138 |
4138 test.dOp1 = std::numeric_limits<double>::quiet_NaN(); | 4139 test.dOp1 = std::numeric_limits<double>::quiet_NaN(); |
4139 test.dOp2 = 0.0; | 4140 test.dOp2 = 0.0; |
4140 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); | 4141 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); |
4141 test.fOp2 = 0.0; | 4142 test.fOp2 = 0.0; |
4142 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4143 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4143 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); | 4144 CHECK_EQ(bit_cast<uint64_t>(test.dF), dFalse); |
4144 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dTrue); | 4145 CHECK_EQ(bit_cast<uint64_t>(test.dUn), dTrue); |
4145 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse); | 4146 CHECK_EQ(bit_cast<uint64_t>(test.dEq), dFalse); |
4146 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dTrue); | 4147 CHECK_EQ(bit_cast<uint64_t>(test.dUeq), dTrue); |
4147 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse); | 4148 CHECK_EQ(bit_cast<uint64_t>(test.dOlt), dFalse); |
4148 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dTrue); | 4149 CHECK_EQ(bit_cast<uint64_t>(test.dUlt), dTrue); |
4149 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dFalse); | 4150 CHECK_EQ(bit_cast<uint64_t>(test.dOle), dFalse); |
4150 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue); | 4151 CHECK_EQ(bit_cast<uint64_t>(test.dUle), dTrue); |
4151 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dFalse); | 4152 CHECK_EQ(bit_cast<uint64_t>(test.dOr), dFalse); |
4152 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue); | 4153 CHECK_EQ(bit_cast<uint64_t>(test.dUne), dTrue); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4238 test.cvt_d_w_in = -1; | 4239 test.cvt_d_w_in = -1; |
4239 test.cvt_d_l_in = -1; | 4240 test.cvt_d_l_in = -1; |
4240 test.cvt_l_s_in = -0.51; | 4241 test.cvt_l_s_in = -0.51; |
4241 test.cvt_l_d_in = -0.51; | 4242 test.cvt_l_d_in = -0.51; |
4242 test.cvt_s_d_in = -0.51; | 4243 test.cvt_s_d_in = -0.51; |
4243 test.cvt_s_w_in = -1; | 4244 test.cvt_s_w_in = -1; |
4244 test.cvt_s_l_in = -1; | 4245 test.cvt_s_l_in = -1; |
4245 test.cvt_w_s_in = -0.51; | 4246 test.cvt_w_s_in = -0.51; |
4246 test.cvt_w_d_in = -0.51; | 4247 test.cvt_w_d_in = -0.51; |
4247 | 4248 |
4248 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4249 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4249 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); | 4250 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); |
4250 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); | 4251 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); |
4251 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); | 4252 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); |
4252 CHECK_EQ(test.cvt_l_s_out, -1); | 4253 CHECK_EQ(test.cvt_l_s_out, -1); |
4253 CHECK_EQ(test.cvt_l_d_out, -1); | 4254 CHECK_EQ(test.cvt_l_d_out, -1); |
4254 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); | 4255 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); |
4255 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); | 4256 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); |
4256 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); | 4257 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); |
4257 CHECK_EQ(test.cvt_w_s_out, -1); | 4258 CHECK_EQ(test.cvt_w_s_out, -1); |
4258 CHECK_EQ(test.cvt_w_d_out, -1); | 4259 CHECK_EQ(test.cvt_w_d_out, -1); |
4259 | 4260 |
4260 | 4261 |
4261 test.cvt_d_s_in = 0.49; | 4262 test.cvt_d_s_in = 0.49; |
4262 test.cvt_d_w_in = 1; | 4263 test.cvt_d_w_in = 1; |
4263 test.cvt_d_l_in = 1; | 4264 test.cvt_d_l_in = 1; |
4264 test.cvt_l_s_in = 0.49; | 4265 test.cvt_l_s_in = 0.49; |
4265 test.cvt_l_d_in = 0.49; | 4266 test.cvt_l_d_in = 0.49; |
4266 test.cvt_s_d_in = 0.49; | 4267 test.cvt_s_d_in = 0.49; |
4267 test.cvt_s_w_in = 1; | 4268 test.cvt_s_w_in = 1; |
4268 test.cvt_s_l_in = 1; | 4269 test.cvt_s_l_in = 1; |
4269 test.cvt_w_s_in = 0.49; | 4270 test.cvt_w_s_in = 0.49; |
4270 test.cvt_w_d_in = 0.49; | 4271 test.cvt_w_d_in = 0.49; |
4271 | 4272 |
4272 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4273 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4273 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); | 4274 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); |
4274 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); | 4275 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); |
4275 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); | 4276 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); |
4276 CHECK_EQ(test.cvt_l_s_out, 0); | 4277 CHECK_EQ(test.cvt_l_s_out, 0); |
4277 CHECK_EQ(test.cvt_l_d_out, 0); | 4278 CHECK_EQ(test.cvt_l_d_out, 0); |
4278 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); | 4279 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); |
4279 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); | 4280 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); |
4280 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); | 4281 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); |
4281 CHECK_EQ(test.cvt_w_s_out, 0); | 4282 CHECK_EQ(test.cvt_w_s_out, 0); |
4282 CHECK_EQ(test.cvt_w_d_out, 0); | 4283 CHECK_EQ(test.cvt_w_d_out, 0); |
4283 | 4284 |
4284 test.cvt_d_s_in = std::numeric_limits<float>::max(); | 4285 test.cvt_d_s_in = std::numeric_limits<float>::max(); |
4285 test.cvt_d_w_in = std::numeric_limits<int32_t>::max(); | 4286 test.cvt_d_w_in = std::numeric_limits<int32_t>::max(); |
4286 test.cvt_d_l_in = std::numeric_limits<int64_t>::max(); | 4287 test.cvt_d_l_in = std::numeric_limits<int64_t>::max(); |
4287 test.cvt_l_s_in = std::numeric_limits<float>::max(); | 4288 test.cvt_l_s_in = std::numeric_limits<float>::max(); |
4288 test.cvt_l_d_in = std::numeric_limits<double>::max(); | 4289 test.cvt_l_d_in = std::numeric_limits<double>::max(); |
4289 test.cvt_s_d_in = std::numeric_limits<double>::max(); | 4290 test.cvt_s_d_in = std::numeric_limits<double>::max(); |
4290 test.cvt_s_w_in = std::numeric_limits<int32_t>::max(); | 4291 test.cvt_s_w_in = std::numeric_limits<int32_t>::max(); |
4291 test.cvt_s_l_in = std::numeric_limits<int64_t>::max(); | 4292 test.cvt_s_l_in = std::numeric_limits<int64_t>::max(); |
4292 test.cvt_w_s_in = std::numeric_limits<float>::max(); | 4293 test.cvt_w_s_in = std::numeric_limits<float>::max(); |
4293 test.cvt_w_d_in = std::numeric_limits<double>::max(); | 4294 test.cvt_w_d_in = std::numeric_limits<double>::max(); |
4294 | 4295 |
4295 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4296 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4296 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); | 4297 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); |
4297 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); | 4298 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); |
4298 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); | 4299 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); |
4299 CHECK_EQ(test.cvt_l_s_out, std::numeric_limits<int64_t>::max()); | 4300 CHECK_EQ(test.cvt_l_s_out, std::numeric_limits<int64_t>::max()); |
4300 CHECK_EQ(test.cvt_l_d_out, std::numeric_limits<int64_t>::max()); | 4301 CHECK_EQ(test.cvt_l_d_out, std::numeric_limits<int64_t>::max()); |
4301 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); | 4302 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); |
4302 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); | 4303 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); |
4303 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); | 4304 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); |
4304 CHECK_EQ(test.cvt_w_s_out, std::numeric_limits<int32_t>::max()); | 4305 CHECK_EQ(test.cvt_w_s_out, std::numeric_limits<int32_t>::max()); |
4305 CHECK_EQ(test.cvt_w_d_out, std::numeric_limits<int32_t>::max()); | 4306 CHECK_EQ(test.cvt_w_d_out, std::numeric_limits<int32_t>::max()); |
4306 | 4307 |
4307 | 4308 |
4308 test.cvt_d_s_in = -std::numeric_limits<float>::max(); // lowest() | 4309 test.cvt_d_s_in = -std::numeric_limits<float>::max(); // lowest() |
4309 test.cvt_d_w_in = std::numeric_limits<int32_t>::min(); // lowest() | 4310 test.cvt_d_w_in = std::numeric_limits<int32_t>::min(); // lowest() |
4310 test.cvt_d_l_in = std::numeric_limits<int64_t>::min(); // lowest() | 4311 test.cvt_d_l_in = std::numeric_limits<int64_t>::min(); // lowest() |
4311 test.cvt_l_s_in = -std::numeric_limits<float>::max(); // lowest() | 4312 test.cvt_l_s_in = -std::numeric_limits<float>::max(); // lowest() |
4312 test.cvt_l_d_in = -std::numeric_limits<double>::max(); // lowest() | 4313 test.cvt_l_d_in = -std::numeric_limits<double>::max(); // lowest() |
4313 test.cvt_s_d_in = -std::numeric_limits<double>::max(); // lowest() | 4314 test.cvt_s_d_in = -std::numeric_limits<double>::max(); // lowest() |
4314 test.cvt_s_w_in = std::numeric_limits<int32_t>::min(); // lowest() | 4315 test.cvt_s_w_in = std::numeric_limits<int32_t>::min(); // lowest() |
4315 test.cvt_s_l_in = std::numeric_limits<int64_t>::min(); // lowest() | 4316 test.cvt_s_l_in = std::numeric_limits<int64_t>::min(); // lowest() |
4316 test.cvt_w_s_in = -std::numeric_limits<float>::max(); // lowest() | 4317 test.cvt_w_s_in = -std::numeric_limits<float>::max(); // lowest() |
4317 test.cvt_w_d_in = -std::numeric_limits<double>::max(); // lowest() | 4318 test.cvt_w_d_in = -std::numeric_limits<double>::max(); // lowest() |
4318 | 4319 |
4319 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4320 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4320 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); | 4321 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); |
4321 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); | 4322 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); |
4322 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); | 4323 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); |
4323 // The returned value when converting from fixed-point to float-point | 4324 // The returned value when converting from fixed-point to float-point |
4324 // is not consistent between board, simulator and specification | 4325 // is not consistent between board, simulator and specification |
4325 // in this test case, therefore modifying the test | 4326 // in this test case, therefore modifying the test |
4326 CHECK(test.cvt_l_s_out == std::numeric_limits<int64_t>::min() || | 4327 CHECK(test.cvt_l_s_out == std::numeric_limits<int64_t>::min() || |
4327 test.cvt_l_s_out == std::numeric_limits<int64_t>::max()); | 4328 test.cvt_l_s_out == std::numeric_limits<int64_t>::max()); |
4328 CHECK(test.cvt_l_d_out == std::numeric_limits<int64_t>::min() || | 4329 CHECK(test.cvt_l_d_out == std::numeric_limits<int64_t>::min() || |
4329 test.cvt_l_d_out == std::numeric_limits<int64_t>::max()); | 4330 test.cvt_l_d_out == std::numeric_limits<int64_t>::max()); |
(...skipping 10 matching lines...) Expand all Loading... |
4340 test.cvt_d_w_in = std::numeric_limits<int32_t>::min(); | 4341 test.cvt_d_w_in = std::numeric_limits<int32_t>::min(); |
4341 test.cvt_d_l_in = std::numeric_limits<int64_t>::min(); | 4342 test.cvt_d_l_in = std::numeric_limits<int64_t>::min(); |
4342 test.cvt_l_s_in = std::numeric_limits<float>::min(); | 4343 test.cvt_l_s_in = std::numeric_limits<float>::min(); |
4343 test.cvt_l_d_in = std::numeric_limits<double>::min(); | 4344 test.cvt_l_d_in = std::numeric_limits<double>::min(); |
4344 test.cvt_s_d_in = std::numeric_limits<double>::min(); | 4345 test.cvt_s_d_in = std::numeric_limits<double>::min(); |
4345 test.cvt_s_w_in = std::numeric_limits<int32_t>::min(); | 4346 test.cvt_s_w_in = std::numeric_limits<int32_t>::min(); |
4346 test.cvt_s_l_in = std::numeric_limits<int64_t>::min(); | 4347 test.cvt_s_l_in = std::numeric_limits<int64_t>::min(); |
4347 test.cvt_w_s_in = std::numeric_limits<float>::min(); | 4348 test.cvt_w_s_in = std::numeric_limits<float>::min(); |
4348 test.cvt_w_d_in = std::numeric_limits<double>::min(); | 4349 test.cvt_w_d_in = std::numeric_limits<double>::min(); |
4349 | 4350 |
4350 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4351 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4351 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); | 4352 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); |
4352 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); | 4353 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); |
4353 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); | 4354 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); |
4354 CHECK_EQ(test.cvt_l_s_out, 0); | 4355 CHECK_EQ(test.cvt_l_s_out, 0); |
4355 CHECK_EQ(test.cvt_l_d_out, 0); | 4356 CHECK_EQ(test.cvt_l_d_out, 0); |
4356 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); | 4357 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); |
4357 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); | 4358 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); |
4358 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); | 4359 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); |
4359 CHECK_EQ(test.cvt_w_s_out, 0); | 4360 CHECK_EQ(test.cvt_w_s_out, 0); |
4360 CHECK_EQ(test.cvt_w_d_out, 0); | 4361 CHECK_EQ(test.cvt_w_d_out, 0); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4399 __ ctc1(a1, FCSR); | 4400 __ ctc1(a1, FCSR); |
4400 | 4401 |
4401 __ jr(ra); | 4402 __ jr(ra); |
4402 __ nop(); | 4403 __ nop(); |
4403 CodeDesc desc; | 4404 CodeDesc desc; |
4404 assm.GetCode(&desc); | 4405 assm.GetCode(&desc); |
4405 Handle<Code> code = isolate->factory()->NewCode( | 4406 Handle<Code> code = isolate->factory()->NewCode( |
4406 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 4407 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
4407 F3 f = FUNCTION_CAST<F3>(code->entry()); | 4408 F3 f = FUNCTION_CAST<F3>(code->entry()); |
4408 | 4409 |
4409 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4410 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4410 | 4411 |
4411 const int test_size = 3; | 4412 const int test_size = 3; |
4412 | 4413 |
4413 double dOp1[test_size] = { | 4414 double dOp1[test_size] = { |
4414 5.0, | 4415 5.0, |
4415 DBL_MAX, | 4416 DBL_MAX, |
4416 DBL_MAX, | 4417 DBL_MAX, |
4417 }; | 4418 }; |
4418 double dOp2[test_size] = { | 4419 double dOp2[test_size] = { |
4419 2.0, | 4420 2.0, |
(...skipping 20 matching lines...) Expand all Loading... |
4440 FLT_MAX / 2.0, | 4441 FLT_MAX / 2.0, |
4441 -1.0, | 4442 -1.0, |
4442 }; | 4443 }; |
4443 | 4444 |
4444 for (int i = 0; i < test_size; i++) { | 4445 for (int i = 0; i < test_size; i++) { |
4445 test.dOp1 = dOp1[i]; | 4446 test.dOp1 = dOp1[i]; |
4446 test.dOp2 = dOp2[i]; | 4447 test.dOp2 = dOp2[i]; |
4447 test.fOp1 = fOp1[i]; | 4448 test.fOp1 = fOp1[i]; |
4448 test.fOp2 = fOp2[i]; | 4449 test.fOp2 = fOp2[i]; |
4449 | 4450 |
4450 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4451 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4451 CHECK_EQ(test.dRes, dRes[i]); | 4452 CHECK_EQ(test.dRes, dRes[i]); |
4452 CHECK_EQ(test.fRes, fRes[i]); | 4453 CHECK_EQ(test.fRes, fRes[i]); |
4453 } | 4454 } |
4454 | 4455 |
4455 test.dOp1 = DBL_MAX; | 4456 test.dOp1 = DBL_MAX; |
4456 test.dOp2 = -0.0; | 4457 test.dOp2 = -0.0; |
4457 test.fOp1 = FLT_MAX; | 4458 test.fOp1 = FLT_MAX; |
4458 test.fOp2 = -0.0; | 4459 test.fOp2 = -0.0; |
4459 | 4460 |
4460 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4461 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4461 CHECK_EQ(false, std::isfinite(test.dRes)); | 4462 CHECK_EQ(false, std::isfinite(test.dRes)); |
4462 CHECK_EQ(false, std::isfinite(test.fRes)); | 4463 CHECK_EQ(false, std::isfinite(test.fRes)); |
4463 | 4464 |
4464 test.dOp1 = 0.0; | 4465 test.dOp1 = 0.0; |
4465 test.dOp2 = -0.0; | 4466 test.dOp2 = -0.0; |
4466 test.fOp1 = 0.0; | 4467 test.fOp1 = 0.0; |
4467 test.fOp2 = -0.0; | 4468 test.fOp2 = -0.0; |
4468 | 4469 |
4469 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4470 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4470 CHECK_EQ(true, std::isnan(test.dRes)); | 4471 CHECK_EQ(true, std::isnan(test.dRes)); |
4471 CHECK_EQ(true, std::isnan(test.fRes)); | 4472 CHECK_EQ(true, std::isnan(test.fRes)); |
4472 | 4473 |
4473 test.dOp1 = std::numeric_limits<double>::quiet_NaN(); | 4474 test.dOp1 = std::numeric_limits<double>::quiet_NaN(); |
4474 test.dOp2 = -5.0; | 4475 test.dOp2 = -5.0; |
4475 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); | 4476 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); |
4476 test.fOp2 = -5.0; | 4477 test.fOp2 = -5.0; |
4477 | 4478 |
4478 (CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0)); | 4479 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
4479 CHECK_EQ(true, std::isnan(test.dRes)); | 4480 CHECK_EQ(true, std::isnan(test.dRes)); |
4480 CHECK_EQ(true, std::isnan(test.fRes)); | 4481 CHECK_EQ(true, std::isnan(test.fRes)); |
4481 } | 4482 } |
4482 | 4483 |
4483 | 4484 |
4484 uint64_t run_align(uint64_t rs_value, uint64_t rt_value, uint8_t bp) { | 4485 uint64_t run_align(uint64_t rs_value, uint64_t rt_value, uint8_t bp) { |
4485 Isolate* isolate = CcTest::i_isolate(); | 4486 Isolate* isolate = CcTest::i_isolate(); |
4486 HandleScope scope(isolate); | 4487 HandleScope scope(isolate); |
4487 | 4488 |
4488 MacroAssembler assm(isolate, NULL, 0); | 4489 MacroAssembler assm(isolate, NULL, 0); |
4489 | 4490 |
4490 __ align(v0, a0, a1, bp); | 4491 __ align(v0, a0, a1, bp); |
4491 __ jr(ra); | 4492 __ jr(ra); |
4492 __ nop(); | 4493 __ nop(); |
4493 | 4494 |
4494 CodeDesc desc; | 4495 CodeDesc desc; |
4495 assm.GetCode(&desc); | 4496 assm.GetCode(&desc); |
4496 Handle<Code> code = isolate->factory()->NewCode( | 4497 Handle<Code> code = isolate->factory()->NewCode( |
4497 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 4498 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
4498 | 4499 |
4499 F2 f = FUNCTION_CAST<F2>(code->entry()); | 4500 F2 f = FUNCTION_CAST<F2>(code->entry()); |
4500 | 4501 |
4501 uint64_t res = | 4502 uint64_t res = reinterpret_cast<uint64_t>( |
4502 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, rs_value, | 4503 CALL_GENERATED_CODE(isolate, f, rs_value, rt_value, 0, 0, 0)); |
4503 rt_value, | |
4504 0, 0, 0)); | |
4505 | 4504 |
4506 return res; | 4505 return res; |
4507 } | 4506 } |
4508 | 4507 |
4509 | 4508 |
4510 TEST(r6_align) { | 4509 TEST(r6_align) { |
4511 if (kArchVariant == kMips64r6) { | 4510 if (kArchVariant == kMips64r6) { |
4512 CcTest::InitializeVM(); | 4511 CcTest::InitializeVM(); |
4513 | 4512 |
4514 struct TestCaseAlign { | 4513 struct TestCaseAlign { |
(...skipping 30 matching lines...) Expand all Loading... |
4545 __ dalign(v0, a0, a1, bp); | 4544 __ dalign(v0, a0, a1, bp); |
4546 __ jr(ra); | 4545 __ jr(ra); |
4547 __ nop(); | 4546 __ nop(); |
4548 | 4547 |
4549 CodeDesc desc; | 4548 CodeDesc desc; |
4550 assm.GetCode(&desc); | 4549 assm.GetCode(&desc); |
4551 Handle<Code> code = isolate->factory()->NewCode( | 4550 Handle<Code> code = isolate->factory()->NewCode( |
4552 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 4551 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
4553 | 4552 |
4554 F4 f = FUNCTION_CAST<F4>(code->entry()); | 4553 F4 f = FUNCTION_CAST<F4>(code->entry()); |
4555 uint64_t res = | 4554 uint64_t res = reinterpret_cast<uint64_t>( |
4556 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, rs_value, | 4555 CALL_GENERATED_CODE(isolate, f, rs_value, rt_value, 0, 0, 0)); |
4557 rt_value, | |
4558 0, 0, 0)); | |
4559 | 4556 |
4560 return res; | 4557 return res; |
4561 } | 4558 } |
4562 | 4559 |
4563 | 4560 |
4564 TEST(r6_dalign) { | 4561 TEST(r6_dalign) { |
4565 if (kArchVariant == kMips64r6) { | 4562 if (kArchVariant == kMips64r6) { |
4566 CcTest::InitializeVM(); | 4563 CcTest::InitializeVM(); |
4567 | 4564 |
4568 struct TestCaseDalign { | 4565 struct TestCaseDalign { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4607 __ nop(); | 4604 __ nop(); |
4608 | 4605 |
4609 CodeDesc desc; | 4606 CodeDesc desc; |
4610 assm.GetCode(&desc); | 4607 assm.GetCode(&desc); |
4611 Handle<Code> code = isolate->factory()->NewCode( | 4608 Handle<Code> code = isolate->factory()->NewCode( |
4612 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 4609 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
4613 | 4610 |
4614 F2 f = FUNCTION_CAST<F2>(code->entry()); | 4611 F2 f = FUNCTION_CAST<F2>(code->entry()); |
4615 PC = (uint64_t) f; // Set the program counter. | 4612 PC = (uint64_t) f; // Set the program counter. |
4616 | 4613 |
4617 uint64_t res = | 4614 uint64_t res = reinterpret_cast<uint64_t>( |
4618 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 4615 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); |
4619 | 4616 |
4620 return res; | 4617 return res; |
4621 } | 4618 } |
4622 | 4619 |
4623 | 4620 |
4624 TEST(r6_aluipc) { | 4621 TEST(r6_aluipc) { |
4625 if (kArchVariant == kMips64r6) { | 4622 if (kArchVariant == kMips64r6) { |
4626 CcTest::InitializeVM(); | 4623 CcTest::InitializeVM(); |
4627 | 4624 |
4628 struct TestCaseAluipc { | 4625 struct TestCaseAluipc { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4661 __ nop(); | 4658 __ nop(); |
4662 | 4659 |
4663 CodeDesc desc; | 4660 CodeDesc desc; |
4664 assm.GetCode(&desc); | 4661 assm.GetCode(&desc); |
4665 Handle<Code> code = isolate->factory()->NewCode( | 4662 Handle<Code> code = isolate->factory()->NewCode( |
4666 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 4663 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
4667 | 4664 |
4668 F2 f = FUNCTION_CAST<F2>(code->entry()); | 4665 F2 f = FUNCTION_CAST<F2>(code->entry()); |
4669 PC = (uint64_t) f; // Set the program counter. | 4666 PC = (uint64_t) f; // Set the program counter. |
4670 | 4667 |
4671 uint64_t res = | 4668 uint64_t res = reinterpret_cast<uint64_t>( |
4672 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 4669 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); |
4673 | 4670 |
4674 return res; | 4671 return res; |
4675 } | 4672 } |
4676 | 4673 |
4677 | 4674 |
4678 TEST(r6_auipc) { | 4675 TEST(r6_auipc) { |
4679 if (kArchVariant == kMips64r6) { | 4676 if (kArchVariant == kMips64r6) { |
4680 CcTest::InitializeVM(); | 4677 CcTest::InitializeVM(); |
4681 | 4678 |
4682 struct TestCaseAuipc { | 4679 struct TestCaseAuipc { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4736 __ jr(ra); | 4733 __ jr(ra); |
4737 __ nop(); | 4734 __ nop(); |
4738 | 4735 |
4739 CodeDesc desc; | 4736 CodeDesc desc; |
4740 assm.GetCode(&desc); | 4737 assm.GetCode(&desc); |
4741 Handle<Code> code = isolate->factory()->NewCode( | 4738 Handle<Code> code = isolate->factory()->NewCode( |
4742 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 4739 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
4743 | 4740 |
4744 F2 f = FUNCTION_CAST<F2>(code->entry()); | 4741 F2 f = FUNCTION_CAST<F2>(code->entry()); |
4745 | 4742 |
4746 uint64_t res = | 4743 uint64_t res = reinterpret_cast<uint64_t>( |
4747 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 4744 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); |
4748 | 4745 |
4749 return res; | 4746 return res; |
4750 } | 4747 } |
4751 | 4748 |
4752 | 4749 |
4753 TEST(r6_lwpc) { | 4750 TEST(r6_lwpc) { |
4754 if (kArchVariant == kMips64r6) { | 4751 if (kArchVariant == kMips64r6) { |
4755 CcTest::InitializeVM(); | 4752 CcTest::InitializeVM(); |
4756 | 4753 |
4757 struct TestCaseLwpc { | 4754 struct TestCaseLwpc { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4812 __ jr(ra); | 4809 __ jr(ra); |
4813 __ nop(); | 4810 __ nop(); |
4814 | 4811 |
4815 CodeDesc desc; | 4812 CodeDesc desc; |
4816 assm.GetCode(&desc); | 4813 assm.GetCode(&desc); |
4817 Handle<Code> code = isolate->factory()->NewCode( | 4814 Handle<Code> code = isolate->factory()->NewCode( |
4818 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 4815 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
4819 | 4816 |
4820 F2 f = FUNCTION_CAST<F2>(code->entry()); | 4817 F2 f = FUNCTION_CAST<F2>(code->entry()); |
4821 | 4818 |
4822 uint64_t res = | 4819 uint64_t res = reinterpret_cast<uint64_t>( |
4823 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 4820 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); |
4824 | 4821 |
4825 return res; | 4822 return res; |
4826 } | 4823 } |
4827 | 4824 |
4828 | 4825 |
4829 TEST(r6_lwupc) { | 4826 TEST(r6_lwupc) { |
4830 if (kArchVariant == kMips64r6) { | 4827 if (kArchVariant == kMips64r6) { |
4831 CcTest::InitializeVM(); | 4828 CcTest::InitializeVM(); |
4832 | 4829 |
4833 struct TestCaseLwupc { | 4830 struct TestCaseLwupc { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4896 __ jr(ra); | 4893 __ jr(ra); |
4897 __ nop(); | 4894 __ nop(); |
4898 | 4895 |
4899 CodeDesc desc; | 4896 CodeDesc desc; |
4900 assm.GetCode(&desc); | 4897 assm.GetCode(&desc); |
4901 Handle<Code> code = isolate->factory()->NewCode( | 4898 Handle<Code> code = isolate->factory()->NewCode( |
4902 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 4899 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
4903 | 4900 |
4904 F2 f = FUNCTION_CAST<F2>(code->entry()); | 4901 F2 f = FUNCTION_CAST<F2>(code->entry()); |
4905 | 4902 |
4906 uint64_t res = | 4903 uint64_t res = reinterpret_cast<uint64_t>( |
4907 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 4904 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); |
4908 | 4905 |
4909 return res; | 4906 return res; |
4910 } | 4907 } |
4911 | 4908 |
4912 | 4909 |
4913 TEST(r6_jic) { | 4910 TEST(r6_jic) { |
4914 if (kArchVariant == kMips64r6) { | 4911 if (kArchVariant == kMips64r6) { |
4915 CcTest::InitializeVM(); | 4912 CcTest::InitializeVM(); |
4916 | 4913 |
4917 struct TestCaseJic { | 4914 struct TestCaseJic { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4968 __ jr(ra); | 4965 __ jr(ra); |
4969 __ nop(); | 4966 __ nop(); |
4970 | 4967 |
4971 CodeDesc desc; | 4968 CodeDesc desc; |
4972 assm.GetCode(&desc); | 4969 assm.GetCode(&desc); |
4973 Handle<Code> code = isolate->factory()->NewCode( | 4970 Handle<Code> code = isolate->factory()->NewCode( |
4974 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 4971 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
4975 | 4972 |
4976 F2 f = FUNCTION_CAST<F2>(code->entry()); | 4973 F2 f = FUNCTION_CAST<F2>(code->entry()); |
4977 | 4974 |
4978 uint64_t res = | 4975 uint64_t res = reinterpret_cast<uint64_t>( |
4979 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, value, 0, 0, 0, 0)); | 4976 CALL_GENERATED_CODE(isolate, f, value, 0, 0, 0, 0)); |
4980 | 4977 |
4981 return res; | 4978 return res; |
4982 } | 4979 } |
4983 | 4980 |
4984 | 4981 |
4985 TEST(r6_beqzc) { | 4982 TEST(r6_beqzc) { |
4986 if (kArchVariant == kMips64r6) { | 4983 if (kArchVariant == kMips64r6) { |
4987 CcTest::InitializeVM(); | 4984 CcTest::InitializeVM(); |
4988 | 4985 |
4989 struct TestCaseBeqzc { | 4986 struct TestCaseBeqzc { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5062 __ nop(); | 5059 __ nop(); |
5063 | 5060 |
5064 | 5061 |
5065 CodeDesc desc; | 5062 CodeDesc desc; |
5066 assm.GetCode(&desc); | 5063 assm.GetCode(&desc); |
5067 Handle<Code> code = isolate->factory()->NewCode( | 5064 Handle<Code> code = isolate->factory()->NewCode( |
5068 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 5065 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
5069 | 5066 |
5070 F2 f = FUNCTION_CAST<F2>(code->entry()); | 5067 F2 f = FUNCTION_CAST<F2>(code->entry()); |
5071 | 5068 |
5072 uint64_t res = | 5069 uint64_t res = reinterpret_cast<uint64_t>( |
5073 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 5070 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); |
5074 | 5071 |
5075 return res; | 5072 return res; |
5076 } | 5073 } |
5077 | 5074 |
5078 | 5075 |
5079 TEST(r6_jialc) { | 5076 TEST(r6_jialc) { |
5080 if (kArchVariant == kMips64r6) { | 5077 if (kArchVariant == kMips64r6) { |
5081 CcTest::InitializeVM(); | 5078 CcTest::InitializeVM(); |
5082 | 5079 |
5083 struct TestCaseJialc { | 5080 struct TestCaseJialc { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5115 __ nop(); | 5112 __ nop(); |
5116 | 5113 |
5117 CodeDesc desc; | 5114 CodeDesc desc; |
5118 assm.GetCode(&desc); | 5115 assm.GetCode(&desc); |
5119 Handle<Code> code = isolate->factory()->NewCode( | 5116 Handle<Code> code = isolate->factory()->NewCode( |
5120 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 5117 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
5121 | 5118 |
5122 F2 f = FUNCTION_CAST<F2>(code->entry()); | 5119 F2 f = FUNCTION_CAST<F2>(code->entry()); |
5123 PC = (uint64_t) f; // Set the program counter. | 5120 PC = (uint64_t) f; // Set the program counter. |
5124 | 5121 |
5125 uint64_t res = | 5122 uint64_t res = reinterpret_cast<uint64_t>( |
5126 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 5123 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); |
5127 | 5124 |
5128 return res; | 5125 return res; |
5129 } | 5126 } |
5130 | 5127 |
5131 | 5128 |
5132 TEST(r6_addiupc) { | 5129 TEST(r6_addiupc) { |
5133 if (kArchVariant == kMips64r6) { | 5130 if (kArchVariant == kMips64r6) { |
5134 CcTest::InitializeVM(); | 5131 CcTest::InitializeVM(); |
5135 | 5132 |
5136 struct TestCaseAddiupc { | 5133 struct TestCaseAddiupc { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5190 __ jr(ra); | 5187 __ jr(ra); |
5191 __ nop(); | 5188 __ nop(); |
5192 | 5189 |
5193 CodeDesc desc; | 5190 CodeDesc desc; |
5194 assm.GetCode(&desc); | 5191 assm.GetCode(&desc); |
5195 Handle<Code> code = isolate->factory()->NewCode( | 5192 Handle<Code> code = isolate->factory()->NewCode( |
5196 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 5193 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
5197 | 5194 |
5198 F2 f = FUNCTION_CAST<F2>(code->entry()); | 5195 F2 f = FUNCTION_CAST<F2>(code->entry()); |
5199 | 5196 |
5200 uint64_t res = | 5197 uint64_t res = reinterpret_cast<uint64_t>( |
5201 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 5198 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); |
5202 | 5199 |
5203 return res; | 5200 return res; |
5204 } | 5201 } |
5205 | 5202 |
5206 | 5203 |
5207 TEST(r6_ldpc) { | 5204 TEST(r6_ldpc) { |
5208 if (kArchVariant == kMips64r6) { | 5205 if (kArchVariant == kMips64r6) { |
5209 CcTest::InitializeVM(); | 5206 CcTest::InitializeVM(); |
5210 | 5207 |
5211 struct TestCaseLdpc { | 5208 struct TestCaseLdpc { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5273 __ jr(ra); | 5270 __ jr(ra); |
5274 __ nop(); | 5271 __ nop(); |
5275 | 5272 |
5276 CodeDesc desc; | 5273 CodeDesc desc; |
5277 assm.GetCode(&desc); | 5274 assm.GetCode(&desc); |
5278 Handle<Code> code = isolate->factory()->NewCode( | 5275 Handle<Code> code = isolate->factory()->NewCode( |
5279 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 5276 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
5280 | 5277 |
5281 F2 f = FUNCTION_CAST<F2>(code->entry()); | 5278 F2 f = FUNCTION_CAST<F2>(code->entry()); |
5282 | 5279 |
5283 int64_t res = | 5280 int64_t res = reinterpret_cast<int64_t>( |
5284 reinterpret_cast<int64_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 5281 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); |
5285 | 5282 |
5286 return res; | 5283 return res; |
5287 } | 5284 } |
5288 | 5285 |
5289 | 5286 |
5290 TEST(r6_bc) { | 5287 TEST(r6_bc) { |
5291 if (kArchVariant == kMips64r6) { | 5288 if (kArchVariant == kMips64r6) { |
5292 CcTest::InitializeVM(); | 5289 CcTest::InitializeVM(); |
5293 | 5290 |
5294 struct TestCaseBc { | 5291 struct TestCaseBc { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5355 __ jr(ra); | 5352 __ jr(ra); |
5356 __ nop(); | 5353 __ nop(); |
5357 | 5354 |
5358 CodeDesc desc; | 5355 CodeDesc desc; |
5359 assm.GetCode(&desc); | 5356 assm.GetCode(&desc); |
5360 Handle<Code> code = isolate->factory()->NewCode( | 5357 Handle<Code> code = isolate->factory()->NewCode( |
5361 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 5358 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
5362 | 5359 |
5363 F2 f = FUNCTION_CAST<F2>(code->entry()); | 5360 F2 f = FUNCTION_CAST<F2>(code->entry()); |
5364 | 5361 |
5365 int64_t res = | 5362 int64_t res = reinterpret_cast<int64_t>( |
5366 reinterpret_cast<int64_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 5363 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); |
5367 | 5364 |
5368 return res; | 5365 return res; |
5369 } | 5366 } |
5370 | 5367 |
5371 | 5368 |
5372 TEST(r6_balc) { | 5369 TEST(r6_balc) { |
5373 if (kArchVariant == kMips64r6) { | 5370 if (kArchVariant == kMips64r6) { |
5374 CcTest::InitializeVM(); | 5371 CcTest::InitializeVM(); |
5375 | 5372 |
5376 struct TestCaseBalc { | 5373 struct TestCaseBalc { |
(...skipping 28 matching lines...) Expand all Loading... |
5405 __ jr(ra); | 5402 __ jr(ra); |
5406 __ nop(); | 5403 __ nop(); |
5407 | 5404 |
5408 CodeDesc desc; | 5405 CodeDesc desc; |
5409 assm.GetCode(&desc); | 5406 assm.GetCode(&desc); |
5410 Handle<Code> code = isolate->factory()->NewCode( | 5407 Handle<Code> code = isolate->factory()->NewCode( |
5411 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 5408 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
5412 | 5409 |
5413 F2 f = FUNCTION_CAST<F2>(code->entry()); | 5410 F2 f = FUNCTION_CAST<F2>(code->entry()); |
5414 | 5411 |
5415 uint64_t res = | 5412 uint64_t res = reinterpret_cast<uint64_t>( |
5416 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, rt_value, 0, 0, 0, 0)); | 5413 CALL_GENERATED_CODE(isolate, f, rt_value, 0, 0, 0, 0)); |
5417 | 5414 |
5418 return res; | 5415 return res; |
5419 } | 5416 } |
5420 | 5417 |
5421 | 5418 |
5422 TEST(dsll) { | 5419 TEST(dsll) { |
5423 CcTest::InitializeVM(); | 5420 CcTest::InitializeVM(); |
5424 | 5421 |
5425 struct TestCaseDsll { | 5422 struct TestCaseDsll { |
5426 uint64_t rt_value; | 5423 uint64_t rt_value; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5461 __ jr(ra); | 5458 __ jr(ra); |
5462 __ nop(); | 5459 __ nop(); |
5463 | 5460 |
5464 CodeDesc desc; | 5461 CodeDesc desc; |
5465 assm.GetCode(&desc); | 5462 assm.GetCode(&desc); |
5466 Handle<Code> code = isolate->factory()->NewCode( | 5463 Handle<Code> code = isolate->factory()->NewCode( |
5467 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 5464 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
5468 | 5465 |
5469 F2 f = FUNCTION_CAST<F2>(code->entry()); | 5466 F2 f = FUNCTION_CAST<F2>(code->entry()); |
5470 | 5467 |
5471 uint64_t res = | 5468 uint64_t res = reinterpret_cast<uint64_t>( |
5472 reinterpret_cast<uint64_t>(CALL_GENERATED_CODE(f, 0, 0, 0, 0, 0)); | 5469 CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); |
5473 | 5470 |
5474 return res; | 5471 return res; |
5475 } | 5472 } |
5476 | 5473 |
5477 | 5474 |
5478 TEST(bal) { | 5475 TEST(bal) { |
5479 CcTest::InitializeVM(); | 5476 CcTest::InitializeVM(); |
5480 | 5477 |
5481 struct TestCaseBal { | 5478 struct TestCaseBal { |
5482 int16_t offset; | 5479 int16_t offset; |
(...skipping 30 matching lines...) Expand all Loading... |
5513 __ bind(&done); | 5510 __ bind(&done); |
5514 __ Ret(USE_DELAY_SLOT); | 5511 __ Ret(USE_DELAY_SLOT); |
5515 __ mov(v0, zero_reg); | 5512 __ mov(v0, zero_reg); |
5516 | 5513 |
5517 CodeDesc desc; | 5514 CodeDesc desc; |
5518 assm.GetCode(&desc); | 5515 assm.GetCode(&desc); |
5519 Handle<Code> code = isolate->factory()->NewCode( | 5516 Handle<Code> code = isolate->factory()->NewCode( |
5520 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 5517 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
5521 F2 f = FUNCTION_CAST<F2>(code->entry()); | 5518 F2 f = FUNCTION_CAST<F2>(code->entry()); |
5522 | 5519 |
5523 int64_t res = | 5520 int64_t res = reinterpret_cast<int64_t>( |
5524 reinterpret_cast<int64_t>(CALL_GENERATED_CODE(f, 42, 42, 0, 0, 0)); | 5521 CALL_GENERATED_CODE(isolate, f, 42, 42, 0, 0, 0)); |
5525 CHECK_EQ(res, 0); | 5522 CHECK_EQ(res, 0); |
5526 } | 5523 } |
5527 | 5524 |
5528 | 5525 |
5529 #undef __ | 5526 #undef __ |
OLD | NEW |