166,171c166,170
< #if FULL_SYSTEM
< 0x4: syscall({{ fault = new SystemCallFault(); }});
< #else
< 0x4: syscall({{ xc->syscall(R2); }},
< IsSerializeAfter, IsNonSpeculative);
< #endif
---
> 0x4: decode FULL_SYSTEM {
> 0: syscall_se({{ xc->syscall(R2); }},
> IsSerializeAfter, IsNonSpeculative);
> default: syscall({{ fault = new SystemCallFault(); }});
> }
214,230c213,216
< /* More complicated since an ADD can cause
< an arithmetic overflow exception */
< int64_t Src1 = Rs.sw;
< int64_t Src2 = Rt.sw;
< int64_t temp_result;
< #if FULL_SYSTEM
< if (((Src1 >> 31) & 1) == 1)
< Src1 |= 0x100000000LL;
< #endif
< temp_result = Src1 + Src2;
< #if FULL_SYSTEM
< if (bits(temp_result, 31) ==
< bits(temp_result, 32)) {
< #endif
< Rd.sw = temp_result;
< #if FULL_SYSTEM
< } else {
---
> IntReg result;
> Rd = result = Rs + Rt;
> if (FULL_SYSTEM &&
> findOverflow(32, result, Rs, Rt)) {
233d218
< #endif
237,248c222,225
< /* More complicated since an SUB can cause
< an arithmetic overflow exception */
< int64_t Src1 = Rs.sw;
< int64_t Src2 = Rt.sw;
< int64_t temp_result = Src1 - Src2;
< #if FULL_SYSTEM
< if (bits(temp_result, 31) ==
< bits(temp_result, 32)) {
< #endif
< Rd.sw = temp_result;
< #if FULL_SYSTEM
< } else {
---
> IntReg result;
> Rd = result = Rs - Rt;
> if (FULL_SYSTEM &&
> findOverflow(32, result, Rs, ~Rt)) {
251d227
< #endif
350,363c326,329
< int64_t Src1 = Rs.sw;
< int64_t Src2 = imm;
< int64_t temp_result;
< #if FULL_SYSTEM
< if (((Src1 >> 31) & 1) == 1)
< Src1 |= 0x100000000LL;
< #endif
< temp_result = Src1 + Src2;
< #if FULL_SYSTEM
< if (bits(temp_result, 31) == bits(temp_result, 32)) {
< #endif
< Rt.sw = temp_result;
< #if FULL_SYSTEM
< } else {
---
> IntReg result;
> Rt = result = Rs + imm;
> if (FULL_SYSTEM &&
> findOverflow(32, result, Rs, imm)) {
366d331
< #endif
1519,1523c1484,1487
< #if BYTE_ORDER == BIG_ENDIAN
< Fd.ud = Fs.ud<31:0> << 32 | Ft.ud<63:32>;
< #elif BYTE_ORDER == LITTLE_ENDIAN
< Fd.ud = Ft.ud<31:0> << 32 | Fs.ud<63:32>;
< #endif
---
> if (GuestByteOrder == BigEndianByteOrder)
> Fd.ud = Fs.ud<31:0> << 32 | Ft.ud<63:32>;
> else
> Fd.ud = Ft.ud<31:0> << 32 | Fs.ud<63:32>;
2471,2476c2435,2439
< 0x3: decode OP {
< #if FULL_SYSTEM
< 0x0: FailUnimpl::rdhwr();
< #else
< 0x0: decode RD {
< 29: BasicOp::rdhwr({{ Rt = TpValue; }});
---
> 0x3: decode OP default FailUnimpl::rdhwr() {
> 0x0: decode FULL_SYSTEM {
> 0: decode RD {
> 29: BasicOp::rdhwr_se({{ Rt = TpValue; }});
> }
2478d2440
< #endif