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

Unified Diff: src/mips/simulator-mips.h

Issue 2603083002: MIPS[64]: Add support for FPR content in simulator trace. (Closed)
Patch Set: Using Set*Result functions. Created 3 years, 11 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 | « no previous file | src/mips/simulator-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/simulator-mips.h
diff --git a/src/mips/simulator-mips.h b/src/mips/simulator-mips.h
index 3795eecc78db661d993dd4174d91b29e7d9cfa76..2785f913c9feda3e2a1585e95bf8723bc500901d 100644
--- a/src/mips/simulator-mips.h
+++ b/src/mips/simulator-mips.h
@@ -293,6 +293,9 @@ class Simulator {
// Unsupported instructions use Format to print an error and stop execution.
void Format(Instruction* instr, const char* format);
+ // Helpers for data value tracing.
+ enum TraceType { BYTE, HALF, WORD, DWORD, FLOAT, DOUBLE, FLOAT_DOUBLE };
+
// Read and write memory.
inline uint32_t ReadBU(int32_t addr);
inline int32_t ReadB(int32_t addr);
@@ -305,24 +308,18 @@ class Simulator {
inline void WriteH(int32_t addr, uint16_t value, Instruction* instr);
inline void WriteH(int32_t addr, int16_t value, Instruction* instr);
- inline int ReadW(int32_t addr, Instruction* instr);
+ inline int ReadW(int32_t addr, Instruction* instr, TraceType t = WORD);
inline void WriteW(int32_t addr, int value, Instruction* instr);
inline double ReadD(int32_t addr, Instruction* instr);
inline void WriteD(int32_t addr, double value, Instruction* instr);
- // Helpers for data value tracing.
- enum TraceType {
- BYTE,
- HALF,
- WORD
- // DWORD,
- // DFLOAT - Floats may have printing issues due to paired lwc1's
- };
-
- void TraceRegWr(int32_t value);
- void TraceMemWr(int32_t addr, int32_t value, TraceType t);
- void TraceMemRd(int32_t addr, int32_t value);
+ void TraceRegWr(int32_t value, TraceType t = WORD);
+ void TraceRegWr(int64_t value, TraceType t = DWORD);
+ void TraceMemWr(int32_t addr, int32_t value, TraceType t = WORD);
+ void TraceMemRd(int32_t addr, int32_t value, TraceType t = WORD);
+ void TraceMemWr(int32_t addr, int64_t value, TraceType t = DWORD);
+ void TraceMemRd(int32_t addr, int64_t value, TraceType t = DWORD);
EmbeddedVector<char, 128> trace_buf_;
// Operations depending on endianness.
@@ -381,6 +378,26 @@ class Simulator {
TraceRegWr(alu_out);
}
+ inline void SetFPUWordResult(int32_t fd_reg, int32_t alu_out) {
+ set_fpu_register_word(fd_reg, alu_out);
+ TraceRegWr(get_fpu_register_word(fd_reg));
+ }
+
+ inline void SetFPUResult(int32_t fd_reg, int64_t alu_out) {
+ set_fpu_register(fd_reg, alu_out);
+ TraceRegWr(get_fpu_register(fd_reg));
+ }
+
+ inline void SetFPUFloatResult(int32_t fd_reg, float alu_out) {
+ set_fpu_register_float(fd_reg, alu_out);
+ TraceRegWr(get_fpu_register_word(fd_reg), FLOAT);
+ }
+
+ inline void SetFPUDoubleResult(int32_t fd_reg, double alu_out) {
+ set_fpu_register_double(fd_reg, alu_out);
+ TraceRegWr(get_fpu_register(fd_reg), DOUBLE);
+ }
+
void DecodeTypeImmediate();
void DecodeTypeJump();
« no previous file with comments | « no previous file | src/mips/simulator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698