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 // Declares a Simulator for S390 instructions if we are not generating a native | 5 // Declares a Simulator for S390 instructions if we are not generating a native |
6 // S390 binary. This Simulator allows us to run and debug S390 code generation | 6 // S390 binary. This Simulator allows us to run and debug S390 code generation |
7 // on regular desktop machines. | 7 // on regular desktop machines. |
8 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, | 8 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, |
9 // which will start execution in the Simulator or forwards to the real entry | 9 // which will start execution in the Simulator or forwards to the real entry |
10 // on a S390 hardware platform. | 10 // on a S390 hardware platform. |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // C code. | 251 // C code. |
252 end_sim_pc = -2 | 252 end_sim_pc = -2 |
253 }; | 253 }; |
254 | 254 |
255 // Unsupported instructions use Format to print an error and stop execution. | 255 // Unsupported instructions use Format to print an error and stop execution. |
256 void Format(Instruction* instr, const char* format); | 256 void Format(Instruction* instr, const char* format); |
257 | 257 |
258 // Helper functions to set the conditional flags in the architecture state. | 258 // Helper functions to set the conditional flags in the architecture state. |
259 bool CarryFrom(int32_t left, int32_t right, int32_t carry = 0); | 259 bool CarryFrom(int32_t left, int32_t right, int32_t carry = 0); |
260 bool BorrowFrom(int32_t left, int32_t right); | 260 bool BorrowFrom(int32_t left, int32_t right); |
261 bool OverflowFrom(int32_t alu_out, int32_t left, int32_t right, | 261 template <typename T1> |
262 bool addition); | 262 inline bool OverflowFromSigned(T1 alu_out, T1 left, T1 right, bool addition); |
263 | 263 |
264 // Helper functions to decode common "addressing" modes | 264 // Helper functions to decode common "addressing" modes |
265 int32_t GetShiftRm(Instruction* instr, bool* carry_out); | 265 int32_t GetShiftRm(Instruction* instr, bool* carry_out); |
266 int32_t GetImm(Instruction* instr, bool* carry_out); | 266 int32_t GetImm(Instruction* instr, bool* carry_out); |
267 void ProcessPUW(Instruction* instr, int num_regs, int operand_size, | 267 void ProcessPUW(Instruction* instr, int num_regs, int operand_size, |
268 intptr_t* start_address, intptr_t* end_address); | 268 intptr_t* start_address, intptr_t* end_address); |
269 void HandleRList(Instruction* instr, bool load); | 269 void HandleRList(Instruction* instr, bool load); |
270 void HandleVList(Instruction* inst); | 270 void HandleVList(Instruction* inst); |
271 void SoftwareInterrupt(Instruction* instr); | 271 void SoftwareInterrupt(Instruction* instr); |
272 | 272 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 static inline void UnregisterCTryCatch(v8::internal::Isolate* isolate) { | 525 static inline void UnregisterCTryCatch(v8::internal::Isolate* isolate) { |
526 Simulator::current(isolate)->PopAddress(); | 526 Simulator::current(isolate)->PopAddress(); |
527 } | 527 } |
528 }; | 528 }; |
529 | 529 |
530 } // namespace internal | 530 } // namespace internal |
531 } // namespace v8 | 531 } // namespace v8 |
532 | 532 |
533 #endif // !defined(USE_SIMULATOR) | 533 #endif // !defined(USE_SIMULATOR) |
534 #endif // V8_S390_SIMULATOR_S390_H_ | 534 #endif // V8_S390_SIMULATOR_S390_H_ |
OLD | NEW |