Skip to content

Commit

Permalink
pcsx2: Remove unnecessary aMax/aMin macros
Browse files Browse the repository at this point in the history
  • Loading branch information
turtleli committed Apr 30, 2017
1 parent 1d364f1 commit 29eed18
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pcsx2/Vif_Codes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ template<int idx> __fi int _vifCode_Direct(int pass, const u8* data, bool isDire
pass2 {
const char* name = isDirectHL ? "DirectHL" : "Direct";
GIF_TRANSFER_TYPE tranType = isDirectHL ? GIF_TRANS_DIRECTHL : GIF_TRANS_DIRECT;
uint size = aMin(vif1.vifpacketsize, vif1.tag.size) * 4; // Get size in bytes
uint size = std::min(vif1.vifpacketsize, vif1.tag.size) * 4; // Get size in bytes
uint ret = gifUnit.TransferGSPacketData(tranType, (u8*)data, size);

vif1.tag.size -= ret/4; // Convert to u32's
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/x86/microVU_Analyze.inl
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ static void analyzeBranchVI(mV, int xReg, bool& infoVar) {
__fi void analyzeBranchVI(mV, int xReg, bool& infoVar) {
if (!xReg) return;
int i;
int iEnd = aMin(5, (mVUcount+1));
int iEnd = std::min(5, mVUcount + 1);
int bPC = iPC;
incPC2(-2);
for (i = 0; i < iEnd; i++) {
Expand Down
3 changes: 0 additions & 3 deletions pcsx2/x86/newVif.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

using namespace x86Emitter;

#define aMax(x, y) std::max(x,y)
#define aMin(x, y) std::min(x,y)

// newVif_HashBucket.h uses this typedef, so it has to be declared first.
typedef u32 (__fastcall *nVifCall)(void*, const void*);
typedef void (__fastcall *nVifrecCall)(uptr dest, uptr src);
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/x86/newVif_Dynarec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ __fi void VifUnpackSSE_Dynarec::SetMasks(int cS) const {
void VifUnpackSSE_Dynarec::doMaskWrite(const xRegisterSSE& regX) const {
pxAssertDev(regX.Id <= 1, "Reg Overflow! XMM2 thru XMM6 are reserved for masking.");

int cc = aMin(vCL, 3);
int cc = std::min(vCL, 3);
u32 m0 = (vB.mask >> (cc * 8)) & 0xff; //The actual mask example 0xE4 (protect, col, row, clear)
u32 m3 = ((m0 & 0xaa)>>1) & ~m0; //all the upper bits (cols shifted right) cancelling out any write protects 0x10
u32 m2 = (m0 & 0x55) & (~m0>>1); // all the lower bits (rows)cancelling out any write protects 0x04
Expand Down
4 changes: 2 additions & 2 deletions pcsx2/x86/newVif_Unpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ _vifT int nVifUnpack(const u8* data) {
VIFregisters& vifRegs = vifXRegs;

const uint wl = vifRegs.cycle.wl ? vifRegs.cycle.wl : 256;
const uint ret = aMin(vif.vifpacketsize, vif.tag.size);
const uint ret = std::min(vif.vifpacketsize, vif.tag.size);
const bool isFill = (vifRegs.cycle.cl < wl);
s32 size = ret << 2;

Expand Down Expand Up @@ -252,7 +252,7 @@ __ri void __fastcall _nVifUnpackLoop(const u8* data) {
}
else {
//DevCon.WriteLn("SSE Unpack!");
uint cl3 = aMin(vif.cl,3);
uint cl3 = std::min(vif.cl, 3);
fnbase[cl3](dest, data);
}

Expand Down
2 changes: 1 addition & 1 deletion pcsx2/x86/newVif_UnpackSSE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ VifUnpackSSE_Simple::VifUnpackSSE_Simple(bool usn_, bool domask_, int curCycle_)

void VifUnpackSSE_Simple::doMaskWrite(const xRegisterSSE& regX) const {
xMOVAPS(xmm7, ptr[dstIndirect]);
int offX = aMin(curCycle, 3);
int offX = std::min(curCycle, 3);
xPAND(regX, ptr32[nVifMask[0][offX]]);
xPAND(xmm7, ptr32[nVifMask[1][offX]]);
xPOR (regX, ptr32[nVifMask[2][offX]]);
Expand Down

0 comments on commit 29eed18

Please sign in to comment.