MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / DSUB

Function DSUB

pcsx2/R5900OpcodeImpl.cpp:356–362  ·  view source on GitHub ↗

Rd = Rs - Rt (Exception on Integer Overflow)

Source from the content-addressed store, hash-verified

354
355// Rd = Rs - Rt (Exception on Integer Overflow)
356void DSUB()
357{
358 s64 result;
359 bool overflow = _add64_Overflow( cpuRegs.GPR.r[_Rs_].SD[0], -cpuRegs.GPR.r[_Rt_].SD[0], result );
360 if (overflow || !_Rd_) return;
361 cpuRegs.GPR.r[_Rd_].SD[0] = result;
362}
363
364void ADDU() { if (!_Rd_) return; cpuRegs.GPR.r[_Rd_].UD[0] = u64(s64(s32(cpuRegs.GPR.r[_Rs_].UL[0] + cpuRegs.GPR.r[_Rt_].UL[0]))); } // Rd = Rs + Rt
365void DADDU() { if (!_Rd_) return; cpuRegs.GPR.r[_Rd_].UD[0] = cpuRegs.GPR.r[_Rs_].UD[0] + cpuRegs.GPR.r[_Rt_].UD[0]; }

Callers

nothing calls this directly

Calls 1

_add64_OverflowFunction · 0.85

Tested by

no test coverage detected