Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #370 from Sonicadvance1/remove_specialized_memcmp
Removes ZeroFrog's "optimized" memcpy and memcmp functions.
  • Loading branch information
shuffle2 committed May 22, 2014
2 parents fc41a53 + a4bb0da commit b58753b
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 493 deletions.
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/Software/BPMemLoader.cpp
Expand Up @@ -99,7 +99,7 @@ void SWBPWritten(int address, int newvalue)
ptr = Memory::GetPointer((bpmem.tmem_config.tlut_src & 0xFFFFF) << 5);

if (ptr)
memcpy_gc(texMem + tlutTMemAddr, ptr, tlutXferCount);
memcpy(texMem + tlutTMemAddr, ptr, tlutXferCount);
else
PanicAlert("Invalid palette pointer %08x %08x %08x", bpmem.tmem_config.tlut_src, bpmem.tmem_config.tlut_src << 5, (bpmem.tmem_config.tlut_src & 0xFFFFF)<< 5);
break;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoBackends/Software/XFMemLoader.cpp
Expand Up @@ -61,7 +61,7 @@ void SWLoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
// write to XF regs
if (transferSize > 0)
{
memcpy_gc((u32*)(&xfmem) + baseAddress, pData, transferSize * 4);
memcpy((u32*)(&xfmem) + baseAddress, pData, transferSize * 4);
XFWritten(transferSize, baseAddress);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoCommon/BPStructs.cpp
Expand Up @@ -274,7 +274,7 @@ static void BPWritten(const BPCmd& bp)
ptr = Memory::GetPointer((bpmem.tmem_config.tlut_src & 0xFFFFF) << 5);

if (ptr)
memcpy_gc(texMem + tlutTMemAddr, ptr, tlutXferCount);
memcpy(texMem + tlutTMemAddr, ptr, tlutXferCount);
else
PanicAlert("Invalid palette pointer %08x %08x %08x", bpmem.tmem_config.tlut_src, bpmem.tmem_config.tlut_src << 5, (bpmem.tmem_config.tlut_src & 0xFFFFF)<< 5);

Expand Down
3 changes: 1 addition & 2 deletions Source/Core/VideoCommon/CMakeLists.txt
Expand Up @@ -35,8 +35,7 @@ set(SRCS BPFunctions.cpp
VideoConfig.cpp
VideoState.cpp
XFMemory.cpp
XFStructs.cpp
memcpy_amd.cpp)
XFStructs.cpp)
set(LIBS core png)

if(NOT _M_GENERIC)
Expand Down
10 changes: 0 additions & 10 deletions Source/Core/VideoCommon/VideoCommon.h
Expand Up @@ -13,16 +13,6 @@
#include "Common/MathUtil.h"
#include "VideoCommon/VideoBackendBase.h"

#if defined(_MSC_VER) && _M_X86_32
void * memcpy_amd(void *dest, const void *src, size_t n);
unsigned char memcmp_mmx(const void* src1, const void* src2, int cmpsize);
#define memcpy_gc memcpy_amd
#define memcmp_gc memcmp_mmx
#else
#define memcpy_gc memcpy
#define memcmp_gc memcmp
#endif

// These are accurate (disregarding AA modes).
enum
{
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/VideoCommon/VideoCommon.vcxproj
Expand Up @@ -59,7 +59,6 @@
<ClCompile Include="ImageWrite.cpp" />
<ClCompile Include="IndexGenerator.cpp" />
<ClCompile Include="MainBase.cpp" />
<ClCompile Include="memcpy_amd.cpp" />
<ClCompile Include="OnScreenDisplay.cpp" />
<ClCompile Include="OpcodeDecoding.cpp" />
<ClCompile Include="PerfQueryBase.cpp" />
Expand Down Expand Up @@ -159,4 +158,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
1 change: 0 additions & 1 deletion Source/Core/VideoCommon/VideoCommon.vcxproj.filters
Expand Up @@ -26,7 +26,6 @@
<ItemGroup>
<ClCompile Include="CommandProcessor.cpp" />
<ClCompile Include="DriverDetails.cpp" />
<ClCompile Include="memcpy_amd.cpp" />
<ClCompile Include="PixelEngine.cpp" />
<ClCompile Include="VideoBackendBase.cpp" />
<ClCompile Include="VideoConfig.cpp" />
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/VideoCommon/XFStructs.cpp
Expand Up @@ -228,7 +228,7 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
}

XFMemWritten(xfMemTransferSize, xfMemBase);
memcpy_gc((u32*)(&xfmem) + xfMemBase, pData, xfMemTransferSize * 4);
memcpy((u32*)(&xfmem) + xfMemBase, pData, xfMemTransferSize * 4);

pData += xfMemTransferSize;
}
Expand All @@ -237,7 +237,7 @@ void LoadXFReg(u32 transferSize, u32 baseAddress, u32 *pData)
if (transferSize > 0)
{
XFRegWritten(transferSize, baseAddress, pData);
memcpy_gc((u32*)(&xfmem) + baseAddress, pData, transferSize * 4);
memcpy((u32*)(&xfmem) + baseAddress, pData, transferSize * 4);
}
}

Expand Down

0 comments on commit b58753b

Please sign in to comment.