mirror of https://github.com/PCSX2/pcsx2.git
Merge pull request #146 from Sonicadvance1/GSdx-x86_64-fixes
Fixes for getting GSdx to compile on x86_64
This commit is contained in:
commit
320d22f2a7
|
@ -3,7 +3,7 @@ if(NOT TOP_CMAKE_WAS_SOURCED)
|
|||
message(FATAL_ERROR "
|
||||
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
|
||||
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
|
||||
endif(NOT TOP_CMAKE_WAS_SOURCED)
|
||||
endif()
|
||||
|
||||
|
||||
# plugin name
|
||||
|
@ -27,28 +27,28 @@ set(OptimizationFlags
|
|||
)
|
||||
|
||||
#Clang doesn't support a few common flags that GCC does.
|
||||
if(NOT USE_CLANG)
|
||||
if(NOT USE_CLANG AND _M_X86_32)
|
||||
add_definitions(${CommonFlags} -mpreferred-stack-boundary=2)
|
||||
endif(NOT USE_CLANG)
|
||||
endif()
|
||||
|
||||
# Debug - Build
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
add_definitions(${CommonFlags} -D_DEBUG -g -Wall)
|
||||
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
endif()
|
||||
|
||||
# Devel - Build
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Devel)
|
||||
add_definitions(${CommonFlags} ${OptimizationFlags} -D_DEVEL -g)
|
||||
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
|
||||
endif()
|
||||
|
||||
# Release - Build
|
||||
if(CMAKE_BUILD_TYPE STREQUAL Release)
|
||||
add_definitions(${CommonFlags} ${OptimizationFlags} -W)
|
||||
endif(CMAKE_BUILD_TYPE STREQUAL Release)
|
||||
endif()
|
||||
|
||||
if(XDG_STD)
|
||||
add_definitions(-DXDG_STD)
|
||||
endif(XDG_STD)
|
||||
endif()
|
||||
|
||||
if(GLES_API AND GLESV2_FOUND)
|
||||
add_definitions(-DENABLE_GLES)
|
||||
|
|
|
@ -33,10 +33,6 @@ GPUDrawScanlineCodeGenerator::GPUDrawScanlineCodeGenerator(void* param, uint32 k
|
|||
: GSCodeGenerator(code, maxsize)
|
||||
, m_local(*(GPUScanlineLocalData*)param)
|
||||
{
|
||||
#if _M_AMD64
|
||||
//#error TODO
|
||||
#endif
|
||||
|
||||
m_sel.key = key;
|
||||
|
||||
Generate();
|
||||
|
|
|
@ -36,10 +36,6 @@ GPUSetupPrimCodeGenerator::GPUSetupPrimCodeGenerator(void* param, uint32 key, vo
|
|||
: GSCodeGenerator(code, maxsize)
|
||||
, m_local(*(GPUScanlineLocalData*)param)
|
||||
{
|
||||
#if _M_AMD64
|
||||
//#error TODO
|
||||
#endif
|
||||
|
||||
m_sel.key = key;
|
||||
|
||||
Generate();
|
||||
|
|
|
@ -99,7 +99,7 @@ EXPORT_C_(void) PS2EsetEmuVersion(const char* emuId, uint32 version)
|
|||
|
||||
EXPORT_C_(uint32) PS2EgetCpuPlatform()
|
||||
{
|
||||
#if _M_AMD64
|
||||
#ifdef _M_AMD64
|
||||
|
||||
return PS2E_X86_64;
|
||||
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
|
||||
#if _M_SSE < 0x500 && (defined(_M_AMD64) || defined(_WIN64))
|
||||
|
||||
#error TODO
|
||||
|
||||
void GSDrawScanlineCodeGenerator::Generate()
|
||||
{
|
||||
}
|
||||
|
@ -98,21 +96,21 @@ void GSDrawScanlineCodeGenerator::WriteFrame()
|
|||
{
|
||||
}
|
||||
|
||||
void GSDrawScanlineCodeGenerator::ReadPixel(const Xmm& dst, const Reg32& addr)
|
||||
void GSDrawScanlineCodeGenerator::ReadPixel(const Xmm& dst, const Reg64& addr)
|
||||
{
|
||||
}
|
||||
|
||||
void GSDrawScanlineCodeGenerator::WritePixel(const Xmm& src, const Reg32& addr, const Reg8& mask, bool fast, int psm, int fz)
|
||||
void GSDrawScanlineCodeGenerator::WritePixel(const Xmm& src, const Reg64& addr, const Reg8& mask, bool fast, int psm, int fz)
|
||||
{
|
||||
}
|
||||
|
||||
static const int s_offsets[4] = {0, 2, 8, 10};
|
||||
|
||||
void GSDrawScanlineCodeGenerator::WritePixel(const Xmm& src, const Reg32& addr, uint8 i, int psm)
|
||||
void GSDrawScanlineCodeGenerator::WritePixel(const Xmm& src, const Reg64& addr, uint8 i, int psm)
|
||||
{
|
||||
}
|
||||
|
||||
void GSDrawScanlineCodeGenerator::ReadTexel(const Xmm& dst, const Xmm& addr, const Xmm& temp1, const Xmm& temp2)
|
||||
void GSDrawScanlineCodeGenerator::ReadTexel(int pixels, int mip_offset)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ void GSSetupPrimCodeGenerator::Generate()
|
|||
|
||||
mov(r8, (size_t)&m_local);
|
||||
|
||||
if((m_en.z || m_en.f) && !m_sel.sprite || m_en.t || m_en.c && m_sel.iip)
|
||||
if((m_en.z || m_en.f) && m_sel.prim != GS_SPRITE_CLASS || m_en.t || m_en.c && m_sel.iip)
|
||||
{
|
||||
for(int i = 0; i < 5; i++)
|
||||
{
|
||||
|
@ -65,7 +65,7 @@ void GSSetupPrimCodeGenerator::Depth()
|
|||
return;
|
||||
}
|
||||
|
||||
if(!m_sel.sprite)
|
||||
if(m_sel.prim != GS_SPRITE_CLASS)
|
||||
{
|
||||
// GSVector4 p = dscan.p;
|
||||
|
||||
|
@ -96,7 +96,9 @@ void GSSetupPrimCodeGenerator::Depth()
|
|||
cvttps2dq(xmm2, xmm2);
|
||||
pshuflw(xmm2, xmm2, _MM_SHUFFLE(2, 2, 0, 0));
|
||||
pshufhw(xmm2, xmm2, _MM_SHUFFLE(2, 2, 0, 0));
|
||||
movdqa(ptr[r8 + offsetof(GSScanlineLocalData, d[i].f)], xmm2);
|
||||
|
||||
const size_t variableOffset = offsetof(GSScanlineLocalData, d[0].f) + (i * sizeof(GSScanlineLocalData::d[0]));
|
||||
movdqa(ptr[r8 + variableOffset], xmm2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,7 +120,9 @@ void GSSetupPrimCodeGenerator::Depth()
|
|||
|
||||
movaps(xmm1, xmm0);
|
||||
mulps(xmm1, Xmm(4 + i));
|
||||
movdqa(ptr[r8 + offsetof(GSScanlineLocalData, d[i].z)], xmm1);
|
||||
|
||||
const size_t variableOffset = offsetof(GSScanlineLocalData, d[0].z) + (i * sizeof(GSScanlineLocalData::d[0]));
|
||||
movdqa(ptr[r8 + variableOffset], xmm1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -226,21 +230,28 @@ void GSSetupPrimCodeGenerator::Texture()
|
|||
|
||||
cvttps2dq(xmm2, xmm2);
|
||||
|
||||
const size_t variableOffsetS = offsetof(GSScanlineLocalData, d[0].s) + (i * sizeof(GSScanlineLocalData::d[0]));
|
||||
const size_t variableOffsetT = offsetof(GSScanlineLocalData, d[0].t) + (i * sizeof(GSScanlineLocalData::d[0]));
|
||||
|
||||
switch(j)
|
||||
{
|
||||
case 0: movdqa(ptr[r8 + offsetof(GSScanlineLocalData, d[i].si)], xmm2); break;
|
||||
case 1: movdqa(ptr[r8 + offsetof(GSScanlineLocalData, d[i].ti)], xmm2); break;
|
||||
case 0: movdqa(ptr[r8 + variableOffsetS], xmm2); break;
|
||||
case 1: movdqa(ptr[r8 + variableOffsetT], xmm2); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// m_local.d[i].s/t/q = v;
|
||||
|
||||
const size_t variableOffsetS = offsetof(GSScanlineLocalData, d[0].s) + (i * sizeof(GSScanlineLocalData::d[0]));
|
||||
const size_t variableOffsetT = offsetof(GSScanlineLocalData, d[0].t) + (i * sizeof(GSScanlineLocalData::d[0]));
|
||||
const size_t variableOffsetQ = offsetof(GSScanlineLocalData, d[0].q) + (i * sizeof(GSScanlineLocalData::d[0]));
|
||||
|
||||
switch(j)
|
||||
{
|
||||
case 0: movaps(ptr[r8 + offsetof(GSScanlineLocalData, d[i].s)], xmm2); break;
|
||||
case 1: movaps(ptr[r8 + offsetof(GSScanlineLocalData, d[i].t)], xmm2); break;
|
||||
case 2: movaps(ptr[r8 + offsetof(GSScanlineLocalData, d[i].q)], xmm2); break;
|
||||
case 0: movaps(ptr[r8 + variableOffsetS], xmm2); break;
|
||||
case 1: movaps(ptr[r8 + variableOffsetT], xmm2); break;
|
||||
case 2: movaps(ptr[r8 + variableOffsetQ], xmm2); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -297,7 +308,9 @@ void GSSetupPrimCodeGenerator::Color()
|
|||
// m_local.d[i].rb = r.upl16(b);
|
||||
|
||||
punpcklwd(xmm2, xmm3);
|
||||
movdqa(ptr[r8 + offsetof(GSScanlineLocalData, d[i].rb)], xmm2);
|
||||
|
||||
const size_t variableOffset = offsetof(GSScanlineLocalData, d[0].rb) + (i * sizeof(GSScanlineLocalData::d[0]));
|
||||
movdqa(ptr[r8 + variableOffset], xmm2);
|
||||
}
|
||||
|
||||
// GSVector4 c = dscan.c;
|
||||
|
@ -330,7 +343,9 @@ void GSSetupPrimCodeGenerator::Color()
|
|||
// m_local.d[i].ga = g.upl16(a);
|
||||
|
||||
punpcklwd(xmm2, xmm3);
|
||||
movdqa(ptr[r8 + offsetof(GSScanlineLocalData, d[i].ga)], xmm2);
|
||||
|
||||
const size_t variableOffset = offsetof(GSScanlineLocalData, d[0].ga) + (i * sizeof(GSScanlineLocalData::d[0]));
|
||||
movdqa(ptr[r8 + variableOffset], xmm2);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -362,4 +377,4 @@ void GSSetupPrimCodeGenerator::Color()
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -46,7 +46,7 @@ const char* GSUtil::GetLibName()
|
|||
if(SVN_MODS) str += "m";
|
||||
#endif
|
||||
|
||||
#if _M_AMD64
|
||||
#ifdef _M_AMD64
|
||||
str += " 64-bit";
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue