OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdarg.h> | 5 #include <stdarg.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #if V8_TARGET_ARCH_S390 | 9 #if V8_TARGET_ARCH_S390 |
10 | 10 |
(...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 } | 1841 } |
1842 | 1842 |
1843 /** | 1843 /** |
1844 * Reads a double value from memory at given address. | 1844 * Reads a double value from memory at given address. |
1845 */ | 1845 */ |
1846 double Simulator::ReadDouble(intptr_t addr) { | 1846 double Simulator::ReadDouble(intptr_t addr) { |
1847 double* ptr = reinterpret_cast<double*>(addr); | 1847 double* ptr = reinterpret_cast<double*>(addr); |
1848 return *ptr; | 1848 return *ptr; |
1849 } | 1849 } |
1850 | 1850 |
| 1851 float Simulator::ReadFloat(intptr_t addr) { |
| 1852 float* ptr = reinterpret_cast<float*>(addr); |
| 1853 return *ptr; |
| 1854 } |
| 1855 |
1851 // Returns the limit of the stack area to enable checking for stack overflows. | 1856 // Returns the limit of the stack area to enable checking for stack overflows. |
1852 uintptr_t Simulator::StackLimit(uintptr_t c_limit) const { | 1857 uintptr_t Simulator::StackLimit(uintptr_t c_limit) const { |
1853 // The simulator uses a separate JS stack. If we have exhausted the C stack, | 1858 // The simulator uses a separate JS stack. If we have exhausted the C stack, |
1854 // we also drop down the JS limit to reflect the exhaustion on the JS stack. | 1859 // we also drop down the JS limit to reflect the exhaustion on the JS stack. |
1855 if (GetCurrentStackPosition() < c_limit) { | 1860 if (GetCurrentStackPosition() < c_limit) { |
1856 return reinterpret_cast<uintptr_t>(get_sp()); | 1861 return reinterpret_cast<uintptr_t>(get_sp()); |
1857 } | 1862 } |
1858 | 1863 |
1859 // Otherwise the limit is the JS stack. Leave a safety margin to prevent | 1864 // Otherwise the limit is the JS stack. Leave a safety margin to prevent |
1860 // overrunning the stack when pushing values. | 1865 // overrunning the stack when pushing values. |
(...skipping 10643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12504 return 0; | 12509 return 0; |
12505 } | 12510 } |
12506 | 12511 |
12507 EVALUATE(KEB) { | 12512 EVALUATE(KEB) { |
12508 UNIMPLEMENTED(); | 12513 UNIMPLEMENTED(); |
12509 USE(instr); | 12514 USE(instr); |
12510 return 0; | 12515 return 0; |
12511 } | 12516 } |
12512 | 12517 |
12513 EVALUATE(CEB) { | 12518 EVALUATE(CEB) { |
12514 UNIMPLEMENTED(); | 12519 DCHECK_OPCODE(CEB); |
12515 USE(instr); | 12520 |
12516 return 0; | 12521 DECODE_RXE_INSTRUCTION(r1, b2, x2, d2); |
| 12522 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); |
| 12523 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); |
| 12524 intptr_t d2_val = d2; |
| 12525 float r1_val = get_float32_from_d_register(r1); |
| 12526 float fval = ReadFloat(b2_val + x2_val + d2_val); |
| 12527 SetS390ConditionCode<float>(r1_val, fval); |
| 12528 return length; |
12517 } | 12529 } |
12518 | 12530 |
12519 EVALUATE(AEB) { | 12531 EVALUATE(AEB) { |
12520 UNIMPLEMENTED(); | 12532 UNIMPLEMENTED(); |
12521 USE(instr); | 12533 USE(instr); |
12522 return 0; | 12534 return 0; |
12523 } | 12535 } |
12524 | 12536 |
12525 EVALUATE(SEB) { | 12537 EVALUATE(SEB) { |
12526 UNIMPLEMENTED(); | 12538 UNIMPLEMENTED(); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12815 return 0; | 12827 return 0; |
12816 } | 12828 } |
12817 | 12829 |
12818 #undef EVALUATE | 12830 #undef EVALUATE |
12819 | 12831 |
12820 } // namespace internal | 12832 } // namespace internal |
12821 } // namespace v8 | 12833 } // namespace v8 |
12822 | 12834 |
12823 #endif // USE_SIMULATOR | 12835 #endif // USE_SIMULATOR |
12824 #endif // V8_TARGET_ARCH_S390 | 12836 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |