From 8737db97e7d965e380383e95d97fb4e6a14edf35 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 26 Nov 2015 19:15:40 +0100 Subject: [PATCH] core: remove allocation error check 1/ Allocation can't fail anymore 2/ Avoid to convert it to new register syntax --- pcsx2/x86/iFPU.cpp | 15 --------------- pcsx2/x86/iFPUd.cpp | 10 ---------- 2 files changed, 25 deletions(-) diff --git a/pcsx2/x86/iFPU.cpp b/pcsx2/x86/iFPU.cpp index 12d78d7bd1..7c1813c9ac 100644 --- a/pcsx2/x86/iFPU.cpp +++ b/pcsx2/x86/iFPU.cpp @@ -437,9 +437,6 @@ void FPU_ADD_SUB(int regd, int regt, int issub) int temp2 = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); //receives regt int xmmtemp = _allocTempXMMreg(XMMT_FPS, -1); //temporary for anding with regd/regt - if (tempecx != ECX) { Console.Error("FPU: ADD/SUB Allocation Error!"); tempecx = ECX;} - if (temp2 == -1) { Console.Error("FPU: ADD/SUB Allocation Error!"); temp2 = EAX;} - xMOVD(xRegister32(tempecx), xRegisterSSE(regd)); xMOVD(xRegister32(temp2), xRegisterSSE(regt)); @@ -585,7 +582,6 @@ static void (*recComOpXMM_to_XMM_REV[] )(x86SSERegType, x86SSERegType) = { //rev int recCommutativeOp(int info, int regd, int op) { int t0reg = _allocTempXMMreg(XMMT_FPS, -1); - //if (t0reg == -1) {Console.WriteLn("FPU: CommutativeOp Allocation Error!");} switch(info & (PROCESS_EE_S|PROCESS_EE_T) ) { case PROCESS_EE_S: @@ -742,7 +738,6 @@ void recC_EQ_xmm(int info) default: Console.WriteLn(Color_Magenta, "recC_EQ_xmm: Default"); tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - if (tempReg < 0) {Console.Error("FPU: DIV Allocation Error!"); tempReg = EAX;} xMOV(xRegister32(tempReg), ptr[&fpuRegs.fpr[_Fs_]]); xCMP(xRegister32(tempReg), ptr[&fpuRegs.fpr[_Ft_]]); @@ -822,7 +817,6 @@ void recC_LE_xmm(int info ) default: // Untested and incorrect, but this case is never reached AFAIK (cottonvibes) Console.WriteLn(Color_Magenta, "recC_LE_xmm: Default"); tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - if (tempReg < 0) {Console.Error("FPU: DIV Allocation Error!"); tempReg = EAX;} xMOV(xRegister32(tempReg), ptr[&fpuRegs.fpr[_Fs_]]); xCMP(xRegister32(tempReg), ptr[&fpuRegs.fpr[_Ft_]]); @@ -898,7 +892,6 @@ void recC_LT_xmm(int info) default: Console.WriteLn(Color_Magenta, "recC_LT_xmm: Default"); tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - if (tempReg < 0) {Console.Error("FPU: DIV Allocation Error!"); tempReg = EAX;} xMOV(xRegister32(tempReg), ptr[&fpuRegs.fpr[_Fs_]]); xCMP(xRegister32(tempReg), ptr[&fpuRegs.fpr[_Ft_]]); @@ -988,8 +981,6 @@ void recDIVhelper1(int regd, int regt) // Sets flags u32 *ajmp32, *bjmp32; int t1reg = _allocTempXMMreg(XMMT_FPS, -1); int tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - //if (t1reg == -1) {Console.Error("FPU: DIV Allocation Error!");} - if (tempReg == -1) {Console.Error("FPU: DIV Allocation Error!"); tempReg = EAX;} xAND(ptr32[&fpuRegs.fprc[31]], ~(FPUflagI|FPUflagD)); // Clear I and D flags @@ -1045,7 +1036,6 @@ void recDIV_S_xmm(int info) { bool roundmodeFlag = false; int t0reg = _allocTempXMMreg(XMMT_FPS, -1); - //if (t0reg == -1) {Console.Error("FPU: DIV Allocation Error!");} //Console.WriteLn("DIV"); if( CHECK_FPUNEGDIVHACK ) @@ -1548,7 +1538,6 @@ void recSUBhelper(int regd, int regt) void recSUBop(int info, int regd) { int t0reg = _allocTempXMMreg(XMMT_FPS, -1); - //if (t0reg == -1) {Console.Error("FPU: SUB Allocation Error!");} //xAND(ptr32[&fpuRegs.fprc[31]], ~(FPUflagO|FPUflagU)); // Clear O and U flags @@ -1636,7 +1625,6 @@ void recSQRT_S_xmm(int info) if (CHECK_FPU_EXTRA_FLAGS) { int tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - if (tempReg == -1) {Console.Error("FPU: SQRT Allocation Error!"); tempReg = EAX;} xAND(ptr32[&fpuRegs.fprc[31]], ~(FPUflagI|FPUflagD)); // Clear I and D flags @@ -1673,8 +1661,6 @@ void recRSQRThelper1(int regd, int t0reg) // Preforms the RSQRT function when re u8 *qjmp1, *qjmp2; int t1reg = _allocTempXMMreg(XMMT_FPS, -1); int tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - //if (t1reg == -1) {Console.Error("FPU: RSQRT Allocation Error!");} - if (tempReg == -1) {Console.Error("FPU: RSQRT Allocation Error!"); tempReg = EAX;} xAND(ptr32[&fpuRegs.fprc[31]], ~(FPUflagI|FPUflagD)); // Clear I and D flags @@ -1743,7 +1729,6 @@ void recRSQRT_S_xmm(int info) // Should this do the same, or should Full mode leave roundmode alone? --air int t0reg = _allocTempXMMreg(XMMT_FPS, -1); - //if (t0reg == -1) {Console.Error("FPU: RSQRT Allocation Error!");} //Console.WriteLn("FPU: RSQRT"); switch(info & (PROCESS_EE_S|PROCESS_EE_T) ) { diff --git a/pcsx2/x86/iFPUd.cpp b/pcsx2/x86/iFPUd.cpp index 0b710e595d..ccc834bfd0 100644 --- a/pcsx2/x86/iFPUd.cpp +++ b/pcsx2/x86/iFPUd.cpp @@ -348,9 +348,6 @@ void FPU_ADD_SUB(int tempd, int tempt) //tempd and tempt are overwritten, they a int temp2 = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); //receives regt int xmmtemp = _allocTempXMMreg(XMMT_FPS, -1); //temporary for anding with regd/regt - if (tempecx != ECX) { Console.Error("FPU: ADD/SUB Allocation Error!"); tempecx = ECX;} - if (temp2 == -1) { Console.Error("FPU: ADD/SUB Allocation Error!"); temp2 = EAX;} - xMOVD(xRegister32(tempecx), xRegisterSSE(tempd)); xMOVD(xRegister32(temp2), xRegisterSSE(tempt)); @@ -593,8 +590,6 @@ void recDIVhelper1(int regd, int regt) // Sets flags u32 *ajmp32, *bjmp32; int t1reg = _allocTempXMMreg(XMMT_FPS, -1); int tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - if (t1reg == -1) {Console.Error("FPU: DIV Allocation Error!"); return;} - if (tempReg == -1) {Console.Error("FPU: DIV Allocation Error!"); tempReg = EAX;} xAND(ptr32[&fpuRegs.fprc[31]], ~(FPUflagI|FPUflagD)); // Clear I and D flags @@ -651,7 +646,6 @@ static __aligned16 SSE_MXCSR roundmode_nearest, roundmode_neg; void recDIV_S_xmm(int info) { bool roundmodeFlag = false; - //if (t0reg == -1) {Console.Error("FPU: DIV Allocation Error!");} //Console.WriteLn("DIV"); if( CHECK_FPUNEGDIVHACK ) @@ -931,9 +925,7 @@ void recSQRT_S_xmm(int info) u8 *pjmp; int roundmodeFlag = 0; int tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - if (tempReg == -1) {Console.Error("FPU: SQRT Allocation Error!"); tempReg = EAX;} int t1reg = _allocTempXMMreg(XMMT_FPS, -1); - if (t1reg == -1) {Console.Error("FPU: SQRT Allocation Error!"); return;} //Console.WriteLn("FPU: SQRT"); if (g_sseMXCSR.GetRoundMode() != SSEround_Nearest) @@ -993,8 +985,6 @@ void recRSQRThelper1(int regd, int regt) // Preforms the RSQRT function when reg u32 *pjmp32; int t1reg = _allocTempXMMreg(XMMT_FPS, -1); int tempReg = _allocX86reg(-1, X86TYPE_TEMP, 0, 0); - if (t1reg == -1) {Console.Error("FPU: RSQRT Allocation Error!"); return;} - if (tempReg == -1) {Console.Error("FPU: RSQRT Allocation Error!"); tempReg = EAX;} xAND(ptr32[&fpuRegs.fprc[31]], ~(FPUflagI|FPUflagD)); // Clear I and D flags