2013-12-17 23:40:27 +01:00
|
|
|
// Copyright (c) 2013- PPSSPP Project.
|
|
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
2016-10-12 17:32:52 +02:00
|
|
|
#include "ppsspp_config.h"
|
|
|
|
|
#if PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64)
|
|
|
|
|
|
2013-12-17 23:40:27 +01:00
|
|
|
#include "Core/MemMap.h"
|
2016-05-01 10:35:37 +02:00
|
|
|
#include "Core/MIPS/JitCommon/JitCommon.h"
|
2013-12-17 23:40:27 +01:00
|
|
|
#include "Core/MIPS/x86/RegCache.h"
|
2016-05-01 01:20:21 +02:00
|
|
|
#include "Core/MIPS/x86/Jit.h"
|
2013-12-17 23:40:27 +01:00
|
|
|
|
2017-08-31 01:14:51 +02:00
|
|
|
alignas(16) static const u64 ssNoSignMask[2] = {0x7FFFFFFF7FFFFFFFULL, 0x7FFFFFFF7FFFFFFFULL};
|
2013-12-17 23:40:27 +01:00
|
|
|
|
|
|
|
|
namespace MIPSComp {
|
2014-12-07 14:44:15 +01:00
|
|
|
using namespace Gen;
|
2013-12-17 23:40:27 +01:00
|
|
|
|
|
|
|
|
int Jit::Replace_fabsf() {
|
2013-12-20 15:37:37 +01:00
|
|
|
fpr.SpillLock(0, 12);
|
2016-05-31 10:40:14 -07:00
|
|
|
fpr.MapReg(0, false, true);
|
2013-12-17 23:40:27 +01:00
|
|
|
MOVSS(fpr.RX(0), fpr.R(12));
|
2017-07-05 15:06:44 +02:00
|
|
|
MOV(PTRBITS, R(RAX), ImmPtr(&ssNoSignMask));
|
|
|
|
|
ANDPS(fpr.RX(0), MatR(RAX));
|
2013-12-18 16:27:23 +01:00
|
|
|
fpr.ReleaseSpillLocks();
|
2013-12-17 23:40:27 +01:00
|
|
|
return 4; // Number of instructions in the MIPS function
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2016-10-12 17:32:52 +02:00
|
|
|
|
|
|
|
|
#endif // PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64)
|