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 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1812 test.a = inputs[i]; | 1812 test.a = inputs[i]; |
1813 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 1813 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
1814 CHECK_EQ(test.b, outputs[j][i]); | 1814 CHECK_EQ(test.b, outputs[j][i]); |
1815 } | 1815 } |
1816 } | 1816 } |
1817 } | 1817 } |
1818 } | 1818 } |
1819 | 1819 |
1820 | 1820 |
1821 TEST(Cvt_d_uw) { | 1821 TEST(Cvt_d_uw) { |
1822 if (IsMipsArchVariant(kMips32r2)) { | 1822 CcTest::InitializeVM(); |
ivica.bogosavljevic
2015/12/18 15:07:56
Enable tests for both MIPS32R2 and MIPS32R6
| |
1823 CcTest::InitializeVM(); | 1823 Isolate* isolate = CcTest::i_isolate(); |
1824 Isolate* isolate = CcTest::i_isolate(); | 1824 HandleScope scope(isolate); |
1825 HandleScope scope(isolate); | 1825 MacroAssembler assm(isolate, NULL, 0, |
1826 MacroAssembler assm(isolate, NULL, 0, | 1826 v8::internal::CodeObjectRequired::kYes); |
1827 v8::internal::CodeObjectRequired::kYes); | |
1828 | 1827 |
1829 typedef struct test_struct { | 1828 typedef struct test_struct { |
1830 unsigned input; | 1829 unsigned input; |
1831 uint64_t output; | 1830 uint64_t output; |
1832 } TestStruct; | 1831 } TestStruct; |
1833 | 1832 |
1834 unsigned inputs[] = { | 1833 unsigned inputs[] = { |
1835 0x0, 0xffffffff, 0x80000000, 0x7fffffff | 1834 0x0, 0xffffffff, 0x80000000, 0x7fffffff |
1836 }; | 1835 }; |
1837 | 1836 |
1838 uint64_t outputs[] = { | 1837 uint64_t outputs[] = { |
1839 0x0, 0x41efffffffe00000, | 1838 0x0, 0x41efffffffe00000, |
1840 0x41e0000000000000, 0x41dfffffffc00000 | 1839 0x41e0000000000000, 0x41dfffffffc00000 |
1841 }; | 1840 }; |
1842 | 1841 |
1843 int kTableLength = sizeof(inputs)/sizeof(inputs[0]); | 1842 int kTableLength = sizeof(inputs)/sizeof(inputs[0]); |
1844 | 1843 |
1845 TestStruct test; | 1844 TestStruct test; |
1846 | 1845 |
1847 __ lw(t1, MemOperand(a0, offsetof(TestStruct, input))); | 1846 __ lw(t1, MemOperand(a0, offsetof(TestStruct, input))); |
1848 __ Cvt_d_uw(f4, t1, f6); | 1847 __ Cvt_d_uw(f4, t1, f6); |
1849 __ sdc1(f4, MemOperand(a0, offsetof(TestStruct, output))); | 1848 __ sdc1(f4, MemOperand(a0, offsetof(TestStruct, output))); |
1850 __ jr(ra); | 1849 __ jr(ra); |
1851 __ nop(); | 1850 __ nop(); |
1852 | 1851 |
1853 CodeDesc desc; | 1852 CodeDesc desc; |
1854 assm.GetCode(&desc); | 1853 assm.GetCode(&desc); |
1855 Handle<Code> code = isolate->factory()->NewCode( | 1854 Handle<Code> code = isolate->factory()->NewCode( |
1856 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1855 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1857 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1856 F3 f = FUNCTION_CAST<F3>(code->entry()); |
1858 for (int i = 0; i < kTableLength; i++) { | 1857 for (int i = 0; i < kTableLength; i++) { |
1859 test.input = inputs[i]; | 1858 test.input = inputs[i]; |
1860 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 1859 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
1861 // Check outputs | 1860 // Check outputs |
1862 CHECK_EQ(test.output, outputs[i]); | 1861 CHECK_EQ(test.output, outputs[i]); |
1863 } | |
1864 } | 1862 } |
1865 } | 1863 } |
1866 | 1864 |
1867 | 1865 |
1868 TEST(mina_maxa) { | 1866 TEST(mina_maxa) { |
1869 if (IsMipsArchVariant(kMips32r6)) { | 1867 if (IsMipsArchVariant(kMips32r6)) { |
1870 const int kTableLength = 15; | 1868 const int kTableLength = 15; |
1871 CcTest::InitializeVM(); | 1869 CcTest::InitializeVM(); |
1872 Isolate* isolate = CcTest::i_isolate(); | 1870 Isolate* isolate = CcTest::i_isolate(); |
1873 HandleScope scope(isolate); | 1871 HandleScope scope(isolate); |
(...skipping 3507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5381 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 5379 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
5382 F2 f = FUNCTION_CAST<F2>(code->entry()); | 5380 F2 f = FUNCTION_CAST<F2>(code->entry()); |
5383 | 5381 |
5384 int32_t res = reinterpret_cast<int32_t>( | 5382 int32_t res = reinterpret_cast<int32_t>( |
5385 CALL_GENERATED_CODE(isolate, f, 42, 42, 0, 0, 0)); | 5383 CALL_GENERATED_CODE(isolate, f, 42, 42, 0, 0, 0)); |
5386 CHECK_EQ(res, 0); | 5384 CHECK_EQ(res, 0); |
5387 } | 5385 } |
5388 | 5386 |
5389 | 5387 |
5390 #undef __ | 5388 #undef __ |
OLD | NEW |