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

Unified Diff: src/mips64/simulator-mips64.cc

Issue 1481493002: (mips) adding simulator support for AUI/DAUI/DAHI/DATI instructions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix mips64 compilation error. Created 5 years, 1 month 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') | test/cctest/test-assembler-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/simulator-mips64.cc
diff --git a/src/mips64/simulator-mips64.cc b/src/mips64/simulator-mips64.cc
index 2440770b19aad0c1c4583b739dd2b81b59937426..d1d65ac7113539beed08ce140be71933a5e97d5c 100644
--- a/src/mips64/simulator-mips64.cc
+++ b/src/mips64/simulator-mips64.cc
@@ -4025,6 +4025,12 @@ void Simulator::DecodeTypeImmediate(Instruction* instr) {
case BGEZAL:
BranchAndLinkHelper(rs >= 0);
break;
+ case DAHI:
+ SetResult(rs_reg, rs + (se_imm16 << 32));
+ break;
+ case DATI:
+ SetResult(rs_reg, rs + (se_imm16 << 48));
+ break;
default:
UNREACHABLE();
}
@@ -4111,12 +4117,24 @@ void Simulator::DecodeTypeImmediate(Instruction* instr) {
case XORI:
SetResult(rt_reg, rs ^ oe_imm16);
break;
- case LUI: {
- int32_t alu32_out = static_cast<int32_t>(oe_imm16 << 16);
- // Sign-extend result of 32bit operation into 64bit register.
- SetResult(rt_reg, static_cast<int64_t>(alu32_out));
+ case LUI:
+ if (rs_reg != 0) {
+ // AUI instruction.
+ DCHECK(kArchVariant == kMips64r6);
+ int32_t alu32_out = static_cast<int32_t>(rs + (se_imm16 << 16));
+ SetResult(rt_reg, static_cast<int64_t>(alu32_out));
+ } else {
+ // LUI instruction.
+ int32_t alu32_out = static_cast<int32_t>(oe_imm16 << 16);
+ // Sign-extend result of 32bit operation into 64bit register.
+ SetResult(rt_reg, static_cast<int64_t>(alu32_out));
+ }
+ break;
+ case DAUI:
+ DCHECK(kArchVariant == kMips64r6);
+ DCHECK(rs_reg != 0);
+ SetResult(rt_reg, rs + (se_imm16 << 16));
break;
- }
// ------------- Memory instructions.
case LB:
set_register(rt_reg, ReadB(rs + se_imm16));
« no previous file with comments | « src/mips64/disasm-mips64.cc ('k') | test/cctest/test-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698