diff options
author | Spec-Chum <spec-chum@users.sourceforge.net> | 2010-02-18 03:17:11 +0300 |
---|---|---|
committer | Spec-Chum <spec-chum@users.sourceforge.net> | 2010-02-18 03:17:11 +0300 |
commit | 07692e241a10bd832ed5f9ca9f80604beb09a30f (patch) | |
tree | 64ea553848a579723e3638afea8036fff5f4c7f3 /src/subtitles/Rasterizer.cpp | |
parent | 59071b65b1021e60bd74bd68a228dd80136bdfda (diff) |
-Revert 1667, appears MSVC at fault...__mm64 undefined for x64 - compiles but doesn't link
-Some cosmetic changes to fix analysis errors
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1672 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/subtitles/Rasterizer.cpp')
-rw-r--r-- | src/subtitles/Rasterizer.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/subtitles/Rasterizer.cpp b/src/subtitles/Rasterizer.cpp index e62d5ea1d..be70360d3 100644 --- a/src/subtitles/Rasterizer.cpp +++ b/src/subtitles/Rasterizer.cpp @@ -901,14 +901,20 @@ static __forceinline void pixmix2_sse2(DWORD* dst, DWORD color, DWORD shapealpha // Calculate a - b clamping to 0 instead of underflowing
static __forceinline DWORD safe_subtract(DWORD a, DWORD b)
{
+#ifndef __WIN64
__m64 ap = _mm_cvtsi32_si64(a);
__m64 bp = _mm_cvtsi32_si64(b);
__m64 rp = _mm_subs_pu16(ap, bp);
DWORD r = (DWORD)_mm_cvtsi64_si32(rp);
+
_mm_empty();
+
return r;
- // return (b > a) ? 0 : a - b;
+#else
+ // For whatever reason Microsoft's x64 compiler doesn't support MMX intrinsics
+ return (b > a) ? 0 : a - b;
+#endif
}
// For CPUID usage in Rasterizer::Draw
@@ -1150,7 +1156,9 @@ CRect Rasterizer::Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int x // Remember to EMMS!
// Rendering fails in funny ways if we don't do this.
+#ifndef _M_X64
_mm_empty();
+#endif
return bbox;
}
|