format BasicOp {
0x2: movz({{ Rd = (Rt == 0) ? Rs : Rd; }});
0x3: movn({{ Rd = (Rt != 0) ? Rs : Rd; }});
- 0x4: decode FULL_SYSTEM {
- 0: syscall_se({{ xc->syscall(R2); }},
+ 0x4: decode FullSystemInt {
+ 0: syscall_se({{ xc->syscall(R2, &fault); }},
IsSerializeAfter, IsNonSpeculative);
- default: syscall({{ fault = new SystemCallFault(); }});
+ default: syscall({{ fault = std::make_shared<SystemCallFault>(); }});
}
0x7: sync({{ ; }}, IsMemBarrier);
- 0x5: break({{fault = new BreakpointFault();}});
+ 0x5: break({{fault = std::make_shared<BreakpointFault>();}});
}
}
0x0: add({{
IntReg result;
Rd = result = Rs + Rt;
- if (FULL_SYSTEM &&
+ if (FullSystem &&
findOverflow(32, result, Rs, Rt)) {
- fault = new IntegerOverflowFault();
+ fault = std::make_shared<IntegerOverflowFault>();
}
}});
0x1: addu({{ Rd_sw = Rs_sw + Rt_sw;}});
0x2: sub({{
IntReg result;
Rd = result = Rs - Rt;
- if (FULL_SYSTEM &&
+ if (FullSystem &&
findOverflow(32, result, Rs, ~Rt)) {
- fault = new IntegerOverflowFault();
+ fault = std::make_shared<IntegerOverflowFault>();
}
}});
0x3: subu({{ Rd_sw = Rs_sw - Rt_sw; }});
0x0: addi({{
IntReg result;
Rt = result = Rs + imm;
- if (FULL_SYSTEM &&
+ if (FullSystem &&
findOverflow(32, result, Rs, imm)) {
- fault = new IntegerOverflowFault();
+ fault = std::make_shared<IntegerOverflowFault>();
}
}});
0x1: addiu({{ Rt_sw = Rs_sw + imm; }});
Rt &= 0xFFFFE7FF;
}
}});
- 0x4: mtc0({{
+ 0x4: mtc0({{
CP0_RD_SEL = Rt;
CauseReg cause = Cause;
IntCtlReg intCtl = IntCtl;
0x8: decode MT_U {
0x0: mftc0({{
data = xc->readRegOtherThread((RT << 3 | SEL) +
- Ctrl_Base_DepTag);
+ Misc_Reg_Base);
}});
0x1: decode SEL {
0x0: mftgpr({{
}
0x2: decode MT_H {
0x0: mftc1({{ data = xc->readRegOtherThread(RT +
- FP_Base_DepTag);
+ FP_Reg_Base);
}});
0x1: mfthc1({{ data = xc->readRegOtherThread(RT +
- FP_Base_DepTag);
+ FP_Reg_Base);
}});
}
0x3: cftc1({{
uint32_t fcsr_val = xc->readRegOtherThread(FLOATREG_FCSR +
- FP_Base_DepTag);
+ FP_Reg_Base);
switch (RT) {
case 0:
data = xc->readRegOtherThread(FLOATREG_FIR +
- Ctrl_Base_DepTag);
+ Misc_Reg_Base);
break;
case 25:
data = (fcsr_val & 0xFE000000 >> 24) |
format MT_MTTR {
// Decode MIPS MT MTTR instruction into sub-instructions
0xC: decode MT_U {
- 0x0: mttc0({{ xc->setRegOtherThread((RD << 3 | SEL) + Ctrl_Base_DepTag,
+ 0x0: mttc0({{ xc->setRegOtherThread((RD << 3 | SEL) + Misc_Reg_Base,
Rt);
}});
0x1: decode SEL {
}
0x2: mttc1({{
uint64_t data = xc->readRegOtherThread(RD +
- FP_Base_DepTag);
+ FP_Reg_Base);
data = insertBits(data, MT_H ? 63 : 31,
MT_H ? 32 : 0, Rt);
- xc->setRegOtherThread(RD + FP_Base_DepTag,
+ xc->setRegOtherThread(RD + FP_Reg_Base,
data);
}});
0x3: cttc1({{
"Access to Floating Control "
"S""tatus Register", FS);
}
- xc->setRegOtherThread(FLOATREG_FCSR + FP_Base_DepTag, data);
+ xc->setRegOtherThread(FLOATREG_FCSR + FP_Reg_Base, data);
}});
default: CP0Unimpl::unknown();
}
} else {
// Enable this else branch once we
// actually set values for Config on init
- fault = new ReservedInstructionFault();
+ fault = std::make_shared<ReservedInstructionFault>();
}
Status = status;
}});
Rt = status;
status.ie = 1;
} else {
- fault = new ReservedInstructionFault();
+ fault = std::make_shared<ReservedInstructionFault>();
}
}});
default:CP0Unimpl::unknown();
// Rev 2 of the architecture
panic("Shadow Sets Not Fully Implemented.\n");
} else {
- fault = new ReservedInstructionFault();
+ fault = std::make_shared<ReservedInstructionFault>();
}
}});
0xE: wrpgpr({{
// Rev 2 of the architecture
panic("Shadow Sets Not Fully Implemented.\n");
} else {
- fault = new ReservedInstructionFault();
+ fault = std::make_shared<ReservedInstructionFault>();
}
}});
}
0x3: CP1Unimpl::unknown();
0x7: CP1Unimpl::unknown();
- //Table A-16 MIPS32 COP1 Encoding of Function
+ //Table A-16 MIPS32 COP1 Encoding of Function
//Field When rs=W
0x4: decode FUNCTION {
format FloatConvertOp {
- 0x20: cvt_s_w({{ val = Fs_uw; }}, ToSingle);
- 0x21: cvt_d_w({{ val = Fs_uw; }}, ToDouble);
+ 0x20: cvt_s_w({{ val = Fs_sw; }}, ToSingle);
+ 0x21: cvt_d_w({{ val = Fs_sw; }}, ToDouble);
0x26: CP1Unimpl::cvt_ps_w();
}
default: CP1Unimpl::unknown();
//floating point operations are enabled."
0x5: decode FUNCTION {
format FloatConvertOp {
- 0x20: cvt_s_l({{ val = Fs_ud; }}, ToSingle);
- 0x21: cvt_d_l({{ val = Fs_ud; }}, ToDouble);
+ 0x20: cvt_s_l({{ val = Fs_sd; }}, ToSingle);
+ 0x21: cvt_d_l({{ val = Fs_sd; }}, ToDouble);
0x26: CP1Unimpl::cvt_ps_l();
}
default: CP1Unimpl::unknown();
}});
0x7: precr_sra_r_ph_w({{
Rt_uw = dspPrecrSra(Rt_uw, Rs_uw, RD,
- SIMD_FMT_W, ROUND);
+ SIMD_FMT_W, ROUND);
}});
}
}
0x3: decode OP_LO {
format DspHiLoOp {
0x2: shilo({{
- if (sext<6>(HILOSA) < 0) {
+ if ((int64_t)sext<6>(HILOSA) < 0) {
dspac = (uint64_t)dspac <<
-sext<6>(HILOSA);
} else {
}
}});
0x3: shilov({{
- if (sext<6>(Rs_sw<5:0>) < 0) {
+ if ((int64_t)sext<6>(Rs_sw<5:0>) < 0) {
dspac = (uint64_t)dspac <<
-sext<6>(Rs_sw<5:0>);
} else {
}
}
0x3: decode OP default FailUnimpl::rdhwr() {
- 0x0: decode FULL_SYSTEM {
+ 0x0: decode FullSystemInt {
0: decode RD {
29: BasicOp::rdhwr_se({{ Rt = TpValue; }});
}