| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 | 5 |
| 6 // Declares a Simulator for MIPS instructions if we are not generating a native | 6 // Declares a Simulator for MIPS instructions if we are not generating a native |
| 7 // MIPS binary. This Simulator allows us to run and debug MIPS code generation | 7 // MIPS binary. This Simulator allows us to run and debug MIPS code generation |
| 8 // on regular desktop machines. | 8 // on regular desktop machines. |
| 9 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, | 9 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, |
| 10 // which will start execution in the Simulator or forwards to the real entry | 10 // which will start execution in the Simulator or forwards to the real entry |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 void set_fcsr_bit(uint32_t cc, bool value); | 206 void set_fcsr_bit(uint32_t cc, bool value); |
| 207 bool test_fcsr_bit(uint32_t cc); | 207 bool test_fcsr_bit(uint32_t cc); |
| 208 bool set_fcsr_round_error(double original, double rounded); | 208 bool set_fcsr_round_error(double original, double rounded); |
| 209 bool set_fcsr_round64_error(double original, double rounded); | 209 bool set_fcsr_round64_error(double original, double rounded); |
| 210 bool set_fcsr_round_error(float original, float rounded); | 210 bool set_fcsr_round_error(float original, float rounded); |
| 211 bool set_fcsr_round64_error(float original, float rounded); | 211 bool set_fcsr_round64_error(float original, float rounded); |
| 212 void round_according_to_fcsr(double toRound, double& rounded, | 212 void round_according_to_fcsr(double toRound, double& rounded, |
| 213 int32_t& rounded_int, double fs); | 213 int32_t& rounded_int, double fs); |
| 214 void round64_according_to_fcsr(double toRound, double& rounded, | 214 void round64_according_to_fcsr(double toRound, double& rounded, |
| 215 int64_t& rounded_int, double fs); | 215 int64_t& rounded_int, double fs); |
| 216 void round_according_to_fcsr(float toRound, float& rounded, |
| 217 int32_t& rounded_int, float fs); |
| 218 void round64_according_to_fcsr(float toRound, float& rounded, |
| 219 int64_t& rounded_int, float fs); |
| 216 void set_fcsr_rounding_mode(FPURoundingMode mode); | 220 void set_fcsr_rounding_mode(FPURoundingMode mode); |
| 217 unsigned int get_fcsr_rounding_mode(); | 221 unsigned int get_fcsr_rounding_mode(); |
| 218 // Special case of set_register and get_register to access the raw PC value. | 222 // Special case of set_register and get_register to access the raw PC value. |
| 219 void set_pc(int64_t value); | 223 void set_pc(int64_t value); |
| 220 int64_t get_pc() const; | 224 int64_t get_pc() const; |
| 221 | 225 |
| 222 Address get_sp() { | 226 Address get_sp() { |
| 223 return reinterpret_cast<Address>(static_cast<intptr_t>(get_register(sp))); | 227 return reinterpret_cast<Address>(static_cast<intptr_t>(get_register(sp))); |
| 224 } | 228 } |
| 225 | 229 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 const uint64_t& rt_u, const int64_t& rd_reg, const int32_t& fr_reg, | 344 const uint64_t& rt_u, const int64_t& rd_reg, const int32_t& fr_reg, |
| 341 const int32_t& fs_reg, const int32_t& ft_reg, const int64_t& fd_reg, | 345 const int32_t& fs_reg, const int32_t& ft_reg, const int64_t& fd_reg, |
| 342 int64_t& i64hilo, uint64_t& u64hilo, int64_t& alu_out, bool& do_interrupt, | 346 int64_t& i64hilo, uint64_t& u64hilo, int64_t& alu_out, bool& do_interrupt, |
| 343 int64_t& current_pc, int64_t& next_pc, int64_t& return_addr_reg, | 347 int64_t& current_pc, int64_t& next_pc, int64_t& return_addr_reg, |
| 344 int64_t& i128resultH, int64_t& i128resultL); | 348 int64_t& i128resultH, int64_t& i128resultL); |
| 345 | 349 |
| 346 void DecodeTypeRegisterSPECIAL2(Instruction* instr, const int64_t& rd_reg, | 350 void DecodeTypeRegisterSPECIAL2(Instruction* instr, const int64_t& rd_reg, |
| 347 int64_t& alu_out); | 351 int64_t& alu_out); |
| 348 | 352 |
| 349 void DecodeTypeRegisterSPECIAL3(Instruction* instr, const int64_t& rt_reg, | 353 void DecodeTypeRegisterSPECIAL3(Instruction* instr, const int64_t& rt_reg, |
| 350 int64_t& alu_out); | 354 const int64_t& rd_reg, int64_t& alu_out); |
| 351 | 355 |
| 352 void DecodeTypeRegisterSRsType(Instruction* instr, const int32_t& fs_reg, | 356 void DecodeTypeRegisterSRsType(Instruction* instr, const int32_t& fs_reg, |
| 353 const int32_t& ft_reg, const int32_t& fd_reg); | 357 const int32_t& ft_reg, const int32_t& fd_reg); |
| 354 | 358 |
| 355 void DecodeTypeRegisterDRsType(Instruction* instr, const int32_t& fs_reg, | 359 void DecodeTypeRegisterDRsType(Instruction* instr, const int32_t& fs_reg, |
| 356 const int32_t& ft_reg, const int32_t& fd_reg); | 360 const int32_t& ft_reg, const int32_t& fd_reg); |
| 357 | 361 |
| 358 void DecodeTypeRegisterWRsType(Instruction* instr, const int32_t& fs_reg, | 362 void DecodeTypeRegisterWRsType(Instruction* instr, const int32_t& fs_reg, |
| 359 const int32_t& fd_reg, int64_t& alu_out); | 363 const int32_t& ft_reg, const int32_t& fd_reg, |
| 364 int64_t& alu_out); |
| 360 | 365 |
| 361 void DecodeTypeRegisterLRsType(Instruction* instr, const int32_t& fs_reg, | 366 void DecodeTypeRegisterLRsType(Instruction* instr, const int32_t& fs_reg, |
| 362 const int32_t& fd_reg, const int32_t& ft_reg); | 367 const int32_t& fd_reg, const int32_t& ft_reg); |
| 363 // Executing is handled based on the instruction type. | 368 // Executing is handled based on the instruction type. |
| 364 void DecodeTypeRegister(Instruction* instr); | 369 void DecodeTypeRegister(Instruction* instr); |
| 365 | 370 |
| 366 // Helper function for DecodeTypeRegister. | 371 // Helper function for DecodeTypeRegister. |
| 367 void ConfigureTypeRegister(Instruction* instr, | 372 void ConfigureTypeRegister(Instruction* instr, |
| 368 int64_t* alu_out, | 373 int64_t* alu_out, |
| 369 int64_t* i64hilo, | 374 int64_t* i64hilo, |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 | 526 |
| 522 static inline void UnregisterCTryCatch() { | 527 static inline void UnregisterCTryCatch() { |
| 523 Simulator::current(Isolate::Current())->PopAddress(); | 528 Simulator::current(Isolate::Current())->PopAddress(); |
| 524 } | 529 } |
| 525 }; | 530 }; |
| 526 | 531 |
| 527 } } // namespace v8::internal | 532 } } // namespace v8::internal |
| 528 | 533 |
| 529 #endif // !defined(USE_SIMULATOR) | 534 #endif // !defined(USE_SIMULATOR) |
| 530 #endif // V8_MIPS_SIMULATOR_MIPS_H_ | 535 #endif // V8_MIPS_SIMULATOR_MIPS_H_ |
| OLD | NEW |