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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/disasm-mips64.cc ('k') | src/mips64/simulator-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/simulator-mips64.h
diff --git a/src/mips64/simulator-mips64.h b/src/mips64/simulator-mips64.h
index dea9e30adfca7d41c0679858038b8ad394274705..75d4935b74d538f73c8b4661cc2a7a20ab636b91 100644
--- a/src/mips64/simulator-mips64.h
+++ b/src/mips64/simulator-mips64.h
@@ -325,57 +325,54 @@ class Simulator {
inline int32_t SetDoubleHIW(double* addr);
inline int32_t SetDoubleLOW(double* addr);
- // functions called from DecodeTypeRegister
- void DecodeTypeRegisterCOP1(Instruction* instr, const int32_t rs_reg,
- const int64_t rs, const uint64_t rs_u,
- const int32_t rt_reg, const int64_t rt,
- const uint64_t rt_u, const int32_t rd_reg,
- const int32_t fr_reg, const int32_t fs_reg,
- const int32_t ft_reg, const int32_t fd_reg,
- int64_t& alu_out);
-
- void DecodeTypeRegisterCOP1X(Instruction* instr, const int32_t fr_reg,
- const int32_t fs_reg, const int32_t ft_reg,
- const int32_t fd_reg);
-
- void DecodeTypeRegisterSPECIAL(
- Instruction* instr, const int32_t rs_reg, const int64_t rs,
- const uint64_t rs_u, const int32_t rt_reg, const int64_t rt,
- const uint64_t rt_u, const int32_t rd_reg, const int32_t fr_reg,
- const int32_t fs_reg, const int32_t ft_reg, const int32_t fd_reg,
- const int64_t i64hilo, const uint64_t u64hilo, const int64_t alu_out,
- const bool do_interrupt, const int64_t current_pc, const int64_t next_pc,
- const int32_t return_addr_reg, const int64_t i128resultH,
- const int64_t i128resultL);
-
-
- void DecodeTypeRegisterSPECIAL2(Instruction* instr, const int32_t rd_reg,
- const int64_t alu_out);
-
- void DecodeTypeRegisterSPECIAL3(Instruction* instr, const int32_t rt_reg,
- const int32_t rd_reg, const int64_t alu_out);
-
- void DecodeTypeRegisterSRsType(Instruction* instr, const int32_t fs_reg,
- const int32_t ft_reg, const int32_t fd_reg);
-
- void DecodeTypeRegisterDRsType(Instruction* instr, const int32_t fs_reg,
- const int32_t ft_reg, const int32_t fd_reg);
-
- void DecodeTypeRegisterWRsType(Instruction* instr, const int32_t fs_reg,
- const int32_t ft_reg, const int32_t fd_reg,
- int64_t& alu_out);
-
- void DecodeTypeRegisterLRsType(Instruction* instr, const int32_t fs_reg,
- const int32_t fd_reg, const int32_t ft_reg);
+ // functions called from DecodeTypeRegister.
+ void DecodeTypeRegisterCOP1();
+
+ void DecodeTypeRegisterCOP1X();
+
+ void DecodeTypeRegisterSPECIAL();
+
+
+ void DecodeTypeRegisterSPECIAL2();
+
+ void DecodeTypeRegisterSPECIAL3();
+
+ void DecodeTypeRegisterSRsType();
+
+ void DecodeTypeRegisterDRsType();
+
+ void DecodeTypeRegisterWRsType();
+
+ void DecodeTypeRegisterLRsType();
+
// Executing is handled based on the instruction type.
void DecodeTypeRegister(Instruction* instr);
- // Helper function for DecodeTypeRegister.
- void ConfigureTypeRegister(Instruction* instr, int64_t* alu_out,
- int64_t* i64hilo, uint64_t* u64hilo,
- int64_t* next_pc, int* return_addr_reg,
- bool* do_interrupt, int64_t* result128H,
- int64_t* result128L);
+ Instruction* currentInstr_;
+ inline Instruction* get_instr() const { return currentInstr_; }
+ inline void set_instr(Instruction* instr) { currentInstr_ = instr; }
+
+ inline int32_t rs_reg() const { return currentInstr_->RsValue(); }
+ inline int64_t rs() const { return get_register(rs_reg()); }
+ inline uint64_t rs_u() const {
+ return static_cast<uint64_t>(get_register(rs_reg()));
+ }
+ inline int32_t rt_reg() const { return currentInstr_->RtValue(); }
+ inline int64_t rt() const { return get_register(rt_reg()); }
+ inline uint64_t rt_u() const {
+ return static_cast<uint64_t>(get_register(rt_reg()));
+ }
+ inline int32_t rd_reg() const { return currentInstr_->RdValue(); }
+ inline int32_t fr_reg() const { return currentInstr_->FrValue(); }
+ inline int32_t fs_reg() const { return currentInstr_->FsValue(); }
+ inline int32_t ft_reg() const { return currentInstr_->FtValue(); }
+ inline int32_t fd_reg() const { return currentInstr_->FdValue(); }
+ inline int32_t sa() const { return currentInstr_->SaValue(); }
+
+ inline void SetResult(const int32_t rd_reg, const int64_t alu_out) {
+ set_register(rd_reg, alu_out);
+ TraceRegWr(alu_out);
+ }
void DecodeTypeImmediate(Instruction* instr);
void DecodeTypeJump(Instruction* instr);
@@ -427,10 +424,9 @@ class Simulator {
kDivideByZero,
kNumExceptions
};
- int16_t exceptions[kNumExceptions];
// Exceptions.
- void SignalExceptions();
+ void SignalException(Exception e);
// Runtime call support.
static void* RedirectExternalReference(void* external_function,
« 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