From 5f278b2d94cc490fcb1d69ba283b728af0339e95 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 25 May 2015 12:20:48 +0000 Subject: [PATCH] Unbreak build with SSE 4.1 (clang -march=penryn) Common/ColorConv.cpp:199:33: error: use of undeclared identifier '_mm_packus_epi32'; did you mean '_mm_packs_epi32'? _mm_store_si128(&dstp[i / 2], _mm_packus_epi32(c1, c2)); ^~~~~~~~~~~~~~~~ _mm_packs_epi32 /usr/bin/../lib/clang/3.6.0/include/emmintrin.h:1254:1: note: '_mm_packs_epi32' declared here _mm_packs_epi32(__m128i __a, __m128i __b) ^ Common/ColorConv.cpp:241:33: error: use of undeclared identifier '_mm_packus_epi32'; did you mean '_mm_packs_epi32'? _mm_store_si128(&dstp[i / 2], _mm_packus_epi32(c1, c2)); ^~~~~~~~~~~~~~~~ _mm_packs_epi32 /usr/bin/../lib/clang/3.6.0/include/emmintrin.h:1254:1: note: '_mm_packs_epi32' declared here _mm_packs_epi32(__m128i __a, __m128i __b) ^ 2 errors generated. GPU/Common/TextureScalerCommon.cpp:294:6: error: unknown type name '__m128' __m128 result = _mm_set1_ps(0.0f); ^ GPU/Common/TextureScalerCommon.cpp:294:22: error: use of undeclared identifier '_mm_set1_ps' __m128 result = _mm_set1_ps(0.0f); ^ GPU/Common/TextureScalerCommon.cpp:305:9: error: unknown type name '__m128i' __m128i samp... ^ GPU/Common/TextureScalerCommon.cpp:305:26: error: use of undeclared identifier '_mm_cvtsi32_si128' ...__m128i sample = _mm_cvtsi32_si128(data[csy*w + csx]); ^ GPU/Common/TextureScalerCommon.cpp:307:9: error: unknown type name '__m128' __m128 col ... ^ GPU/Common/TextureScalerCommon.cpp:308:31: error: use of undeclared identifier '_mm_set1_ps' ...col = _mm_mul_ps(col, _mm_set1_ps(weight)); ^ GPU/Common/TextureScalerCommon.cpp:314:6: error: unknown type name '__m128i' __m128i pixel = _mm_cvtps_epi32(_mm_... ^ GPU/Common/TextureScalerCommon.cpp:314:57: error: use of undeclared identifier '_mm_set1_ps' ...__m128i pixel = _mm_cvtps_epi32(_mm_mul_ps(result, _mm_set1_ps(bicubicInvSum... ^ 8 errors generated. --- Common/ColorConv.cpp | 4 ++++ GPU/Common/TextureScalerCommon.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Common/ColorConv.cpp b/Common/ColorConv.cpp index b13ebf18c8..1a2a089325 100644 --- a/Common/ColorConv.cpp +++ b/Common/ColorConv.cpp @@ -25,6 +25,10 @@ #include #endif +#if _M_SSE >= 0x401 +#include +#endif + inline u16 RGBA8888toRGB565(u32 px) { return ((px >> 3) & 0x001F) | ((px >> 5) & 0x07E0) | ((px >> 8) & 0xF800); } diff --git a/GPU/Common/TextureScalerCommon.cpp b/GPU/Common/TextureScalerCommon.cpp index b248bb47d9..c12ae3cce5 100644 --- a/GPU/Common/TextureScalerCommon.cpp +++ b/GPU/Common/TextureScalerCommon.cpp @@ -35,8 +35,8 @@ #include "Common/CPUDetect.h" #include "ext/xbrz/xbrz.h" -#if _M_SSE >= 0x402 -#include +#if _M_SSE >= 0x401 +#include #endif // Report the time and throughput for each larger scaling operation in the log