Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: src/mips64/simulator-mips64.h

Issue 1356693002: MIPS64: Optimize simulator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix nit. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips64/disasm-mips64.cc ('k') | src/mips64/simulator-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 void TraceMemRd(int64_t addr, int64_t value); 318 void TraceMemRd(int64_t addr, int64_t value);
319 319
320 // Operations depending on endianness. 320 // Operations depending on endianness.
321 // Get Double Higher / Lower word. 321 // Get Double Higher / Lower word.
322 inline int32_t GetDoubleHIW(double* addr); 322 inline int32_t GetDoubleHIW(double* addr);
323 inline int32_t GetDoubleLOW(double* addr); 323 inline int32_t GetDoubleLOW(double* addr);
324 // Set Double Higher / Lower word. 324 // Set Double Higher / Lower word.
325 inline int32_t SetDoubleHIW(double* addr); 325 inline int32_t SetDoubleHIW(double* addr);
326 inline int32_t SetDoubleLOW(double* addr); 326 inline int32_t SetDoubleLOW(double* addr);
327 327
328 // functions called from DecodeTypeRegister 328 // functions called from DecodeTypeRegister.
329 void DecodeTypeRegisterCOP1(Instruction* instr, const int32_t rs_reg, 329 void DecodeTypeRegisterCOP1();
330 const int64_t rs, const uint64_t rs_u,
331 const int32_t rt_reg, const int64_t rt,
332 const uint64_t rt_u, const int32_t rd_reg,
333 const int32_t fr_reg, const int32_t fs_reg,
334 const int32_t ft_reg, const int32_t fd_reg,
335 int64_t& alu_out);
336 330
337 void DecodeTypeRegisterCOP1X(Instruction* instr, const int32_t fr_reg, 331 void DecodeTypeRegisterCOP1X();
338 const int32_t fs_reg, const int32_t ft_reg,
339 const int32_t fd_reg);
340 332
341 void DecodeTypeRegisterSPECIAL( 333 void DecodeTypeRegisterSPECIAL();
342 Instruction* instr, const int32_t rs_reg, const int64_t rs,
343 const uint64_t rs_u, const int32_t rt_reg, const int64_t rt,
344 const uint64_t rt_u, const int32_t rd_reg, const int32_t fr_reg,
345 const int32_t fs_reg, const int32_t ft_reg, const int32_t fd_reg,
346 const int64_t i64hilo, const uint64_t u64hilo, const int64_t alu_out,
347 const bool do_interrupt, const int64_t current_pc, const int64_t next_pc,
348 const int32_t return_addr_reg, const int64_t i128resultH,
349 const int64_t i128resultL);
350 334
351 335
352 void DecodeTypeRegisterSPECIAL2(Instruction* instr, const int32_t rd_reg, 336 void DecodeTypeRegisterSPECIAL2();
353 const int64_t alu_out);
354 337
355 void DecodeTypeRegisterSPECIAL3(Instruction* instr, const int32_t rt_reg, 338 void DecodeTypeRegisterSPECIAL3();
356 const int32_t rd_reg, const int64_t alu_out);
357 339
358 void DecodeTypeRegisterSRsType(Instruction* instr, const int32_t fs_reg, 340 void DecodeTypeRegisterSRsType();
359 const int32_t ft_reg, const int32_t fd_reg);
360 341
361 void DecodeTypeRegisterDRsType(Instruction* instr, const int32_t fs_reg, 342 void DecodeTypeRegisterDRsType();
362 const int32_t ft_reg, const int32_t fd_reg);
363 343
364 void DecodeTypeRegisterWRsType(Instruction* instr, const int32_t fs_reg, 344 void DecodeTypeRegisterWRsType();
365 const int32_t ft_reg, const int32_t fd_reg,
366 int64_t& alu_out);
367 345
368 void DecodeTypeRegisterLRsType(Instruction* instr, const int32_t fs_reg, 346 void DecodeTypeRegisterLRsType();
369 const int32_t fd_reg, const int32_t ft_reg); 347
370 // Executing is handled based on the instruction type. 348 // Executing is handled based on the instruction type.
371 void DecodeTypeRegister(Instruction* instr); 349 void DecodeTypeRegister(Instruction* instr);
372 350
373 // Helper function for DecodeTypeRegister. 351 Instruction* currentInstr_;
374 void ConfigureTypeRegister(Instruction* instr, int64_t* alu_out, 352 inline Instruction* get_instr() const { return currentInstr_; }
375 int64_t* i64hilo, uint64_t* u64hilo, 353 inline void set_instr(Instruction* instr) { currentInstr_ = instr; }
376 int64_t* next_pc, int* return_addr_reg, 354
377 bool* do_interrupt, int64_t* result128H, 355 inline int32_t rs_reg() const { return currentInstr_->RsValue(); }
378 int64_t* result128L); 356 inline int64_t rs() const { return get_register(rs_reg()); }
357 inline uint64_t rs_u() const {
358 return static_cast<uint64_t>(get_register(rs_reg()));
359 }
360 inline int32_t rt_reg() const { return currentInstr_->RtValue(); }
361 inline int64_t rt() const { return get_register(rt_reg()); }
362 inline uint64_t rt_u() const {
363 return static_cast<uint64_t>(get_register(rt_reg()));
364 }
365 inline int32_t rd_reg() const { return currentInstr_->RdValue(); }
366 inline int32_t fr_reg() const { return currentInstr_->FrValue(); }
367 inline int32_t fs_reg() const { return currentInstr_->FsValue(); }
368 inline int32_t ft_reg() const { return currentInstr_->FtValue(); }
369 inline int32_t fd_reg() const { return currentInstr_->FdValue(); }
370 inline int32_t sa() const { return currentInstr_->SaValue(); }
371
372 inline void SetResult(const int32_t rd_reg, const int64_t alu_out) {
373 set_register(rd_reg, alu_out);
374 TraceRegWr(alu_out);
375 }
379 376
380 void DecodeTypeImmediate(Instruction* instr); 377 void DecodeTypeImmediate(Instruction* instr);
381 void DecodeTypeJump(Instruction* instr); 378 void DecodeTypeJump(Instruction* instr);
382 379
383 // Used for breakpoints and traps. 380 // Used for breakpoints and traps.
384 void SoftwareInterrupt(Instruction* instr); 381 void SoftwareInterrupt(Instruction* instr);
385 382
386 // Stop helper functions. 383 // Stop helper functions.
387 bool IsWatchpoint(uint64_t code); 384 bool IsWatchpoint(uint64_t code);
388 void PrintWatchpoint(uint64_t code); 385 void PrintWatchpoint(uint64_t code);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 size_t size); 417 size_t size);
421 static CachePage* GetCachePage(v8::internal::HashMap* i_cache, void* page); 418 static CachePage* GetCachePage(v8::internal::HashMap* i_cache, void* page);
422 419
423 enum Exception { 420 enum Exception {
424 none, 421 none,
425 kIntegerOverflow, 422 kIntegerOverflow,
426 kIntegerUnderflow, 423 kIntegerUnderflow,
427 kDivideByZero, 424 kDivideByZero,
428 kNumExceptions 425 kNumExceptions
429 }; 426 };
430 int16_t exceptions[kNumExceptions];
431 427
432 // Exceptions. 428 // Exceptions.
433 void SignalExceptions(); 429 void SignalException(Exception e);
434 430
435 // Runtime call support. 431 // Runtime call support.
436 static void* RedirectExternalReference(void* external_function, 432 static void* RedirectExternalReference(void* external_function,
437 ExternalReference::Type type); 433 ExternalReference::Type type);
438 434
439 // Handle arguments and return value for runtime FP functions. 435 // Handle arguments and return value for runtime FP functions.
440 void GetFpArgs(double* x, double* y, int32_t* z); 436 void GetFpArgs(double* x, double* y, int32_t* z);
441 void SetFpResult(const double& result); 437 void SetFpResult(const double& result);
442 438
443 void CallInternal(byte* entry); 439 void CallInternal(byte* entry);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 522
527 static inline void UnregisterCTryCatch() { 523 static inline void UnregisterCTryCatch() {
528 Simulator::current(Isolate::Current())->PopAddress(); 524 Simulator::current(Isolate::Current())->PopAddress();
529 } 525 }
530 }; 526 };
531 527
532 } } // namespace v8::internal 528 } } // namespace v8::internal
533 529
534 #endif // !defined(USE_SIMULATOR) 530 #endif // !defined(USE_SIMULATOR)
535 #endif // V8_MIPS_SIMULATOR_MIPS_H_ 531 #endif // V8_MIPS_SIMULATOR_MIPS_H_
OLDNEW
« no previous file with comments | « src/mips64/disasm-mips64.cc ('k') | src/mips64/simulator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698