Commit 15c3d45c authored by fbarchard@google.com's avatar fbarchard@google.com

Change WIN32 to _M_IX86 and use YUV_DISABLE_ASM consistently

BUG=none
TEST=none
Review URL: http://webrtc-codereview.appspot.com/277008

git-svn-id: http://libyuv.googlecode.com/svn/trunk@84 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 1c2d8be1
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 83 Version: 84
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
#include "libyuv/basic_types.h" #include "libyuv/basic_types.h"
#include "libyuv/cpu_id.h" #include "libyuv/cpu_id.h"
#include "row.h"
namespace libyuv { namespace libyuv {
#if defined(__ARM_NEON__) && \ #if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
#define HAS_SUMSQUAREERROR_NEON #define HAS_SUMSQUAREERROR_NEON
static uint32 SumSquareError_NEON(const uint8* src_a, static uint32 SumSquareError_NEON(const uint8* src_a,
...@@ -59,8 +59,7 @@ static uint32 SumSquareError_NEON(const uint8* src_a, ...@@ -59,8 +59,7 @@ static uint32 SumSquareError_NEON(const uint8* src_a,
return sse; return sse;
} }
#elif defined(WIN32) && \ #elif defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
#define HAS_SUMSQUAREERROR_SSE2 #define HAS_SUMSQUAREERROR_SSE2
__declspec(naked) __declspec(naked)
static uint32 SumSquareError_SSE2(const uint8* src_a, static uint32 SumSquareError_SSE2(const uint8* src_a,
...@@ -100,8 +99,7 @@ static uint32 SumSquareError_SSE2(const uint8* src_a, ...@@ -100,8 +99,7 @@ static uint32 SumSquareError_SSE2(const uint8* src_a,
} }
} }
#elif (defined(__x86_64__) || defined(__i386__)) && \ #elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
#define HAS_SUMSQUAREERROR_SSE2 #define HAS_SUMSQUAREERROR_SSE2
static uint32 SumSquareError_SSE2(const uint8* src_a, static uint32 SumSquareError_SSE2(const uint8* src_a,
const uint8* src_b, int count) { const uint8* src_b, int count) {
......
...@@ -8,12 +8,11 @@ ...@@ -8,12 +8,11 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include "row.h"
#include <assert.h> #include <assert.h>
#include "libyuv/basic_types.h" #include "libyuv/basic_types.h"
#include "libyuv/cpu_id.h" #include "libyuv/cpu_id.h"
#include "row.h"
#include "video_common.h" #include "video_common.h"
namespace libyuv { namespace libyuv {
...@@ -22,7 +21,7 @@ namespace libyuv { ...@@ -22,7 +21,7 @@ namespace libyuv {
// and vst would select which 2 components to write. The low level would need // and vst would select which 2 components to write. The low level would need
// to be ARGBToBG, ARGBToGB, ARGBToRG, ARGBToGR // to be ARGBToBG, ARGBToGB, ARGBToRG, ARGBToGR
#if defined(WIN32) && !defined(COVERAGE_ENABLED) #if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_ARGBTOBAYERROW_SSSE3 #define HAS_ARGBTOBAYERROW_SSSE3
__declspec(naked) __declspec(naked)
static void ARGBToBayerRow_SSSE3(const uint8* src_argb, static void ARGBToBayerRow_SSSE3(const uint8* src_argb,
...@@ -46,8 +45,7 @@ static void ARGBToBayerRow_SSSE3(const uint8* src_argb, ...@@ -46,8 +45,7 @@ static void ARGBToBayerRow_SSSE3(const uint8* src_argb,
} }
} }
#elif (defined(__x86_64__) || defined(__i386__)) && \ #elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
#define HAS_ARGBTOBAYERROW_SSSE3 #define HAS_ARGBTOBAYERROW_SSSE3
static void ARGBToBayerRow_SSSE3(const uint8* src_argb, uint8* dst_bayer, static void ARGBToBayerRow_SSSE3(const uint8* src_argb, uint8* dst_bayer,
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
namespace libyuv { namespace libyuv {
#if defined(__ARM_NEON__) && !defined(DISABLE_ASM) #if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
#define HAS_SPLITUV_NEON #define HAS_SPLITUV_NEON
// Reads 16 pairs of UV and write even values to dst_u and odd to dst_v // Reads 16 pairs of UV and write even values to dst_u and odd to dst_v
// Alignment requirement: 16 bytes for pointers, and multiple of 16 pixels. // Alignment requirement: 16 bytes for pointers, and multiple of 16 pixels.
...@@ -39,7 +39,7 @@ static void SplitUV_NEON(const uint8* src_uv, ...@@ -39,7 +39,7 @@ static void SplitUV_NEON(const uint8* src_uv,
); );
} }
#elif defined(WIN32) && !defined(DISABLE_ASM) #elif defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_SPLITUV_SSE2 #define HAS_SPLITUV_SSE2
__declspec(naked) __declspec(naked)
static void SplitUV_SSE2(const uint8* src_uv, static void SplitUV_SSE2(const uint8* src_uv,
...@@ -76,7 +76,7 @@ static void SplitUV_SSE2(const uint8* src_uv, ...@@ -76,7 +76,7 @@ static void SplitUV_SSE2(const uint8* src_uv,
} }
} }
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(DISABLE_ASM) #elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
#define HAS_SPLITUV_SSE2 #define HAS_SPLITUV_SSE2
static void SplitUV_SSE2(const uint8* src_uv, static void SplitUV_SSE2(const uint8* src_uv,
uint8* dst_u, uint8* dst_v, int pix) { uint8* dst_u, uint8* dst_v, int pix) {
...@@ -230,7 +230,7 @@ int I420Mirror(const uint8* src_y, int src_stride_y, ...@@ -230,7 +230,7 @@ int I420Mirror(const uint8* src_y, int src_stride_y,
// SetRows32 writes 'count' bytes using a 32 bit value repeated // SetRows32 writes 'count' bytes using a 32 bit value repeated
#if defined(__ARM_NEON__) && !defined(DISABLE_ASM) #if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
#define HAS_SETROW_NEON #define HAS_SETROW_NEON
static void SetRow32_NEON(uint8* dst, uint32 v32, int count) { static void SetRow32_NEON(uint8* dst, uint32 v32, int count) {
asm volatile ( asm volatile (
...@@ -246,7 +246,7 @@ static void SetRow32_NEON(uint8* dst, uint32 v32, int count) { ...@@ -246,7 +246,7 @@ static void SetRow32_NEON(uint8* dst, uint32 v32, int count) {
); );
} }
#elif defined(WIN32) && !defined(DISABLE_ASM) #elif defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_SETROW_SSE2 #define HAS_SETROW_SSE2
__declspec(naked) __declspec(naked)
static void SetRow32_SSE2(uint8* dst, uint32 v32, int count) { static void SetRow32_SSE2(uint8* dst, uint32 v32, int count) {
...@@ -265,7 +265,7 @@ static void SetRow32_SSE2(uint8* dst, uint32 v32, int count) { ...@@ -265,7 +265,7 @@ static void SetRow32_SSE2(uint8* dst, uint32 v32, int count) {
} }
} }
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(DISABLE_ASM) #elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
#define HAS_SETROW_SSE2 #define HAS_SETROW_SSE2
static void SetRow32_SSE2(uint8* dst, uint32 v32, int count) { static void SetRow32_SSE2(uint8* dst, uint32 v32, int count) {
...@@ -360,7 +360,7 @@ int I420Rect(uint8* dst_y, int dst_stride_y, ...@@ -360,7 +360,7 @@ int I420Rect(uint8* dst_y, int dst_stride_y,
return 0; return 0;
} }
#if defined(WIN32) && !defined(DISABLE_ASM) #if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_HALFROW_SSE2 #define HAS_HALFROW_SSE2
__declspec(naked) __declspec(naked)
static void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride, static void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
...@@ -385,7 +385,7 @@ static void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride, ...@@ -385,7 +385,7 @@ static void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
} }
} }
#elif (defined(__x86_64__) || defined(__i386__)) && !defined(DISABLE_ASM) #elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
#define HAS_HALFROW_SSE2 #define HAS_HALFROW_SSE2
static void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride, static void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride,
uint8* dst_uv, int pix) { uint8* dst_uv, int pix) {
...@@ -603,7 +603,7 @@ int NV12ToI420(const uint8* src_y, ...@@ -603,7 +603,7 @@ int NV12ToI420(const uint8* src_y,
width, height); width, height);
} }
#if defined(WIN32) && !defined(DISABLE_ASM) #if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_SPLITYUY2_SSE2 #define HAS_SPLITYUY2_SSE2
__declspec(naked) __declspec(naked)
static void SplitYUY2_SSE2(const uint8* src_yuy2, static void SplitYUY2_SSE2(const uint8* src_yuy2,
...@@ -651,8 +651,7 @@ static void SplitYUY2_SSE2(const uint8* src_yuy2, ...@@ -651,8 +651,7 @@ static void SplitYUY2_SSE2(const uint8* src_yuy2,
} }
} }
#elif (defined(__x86_64__) || defined(__i386__)) && \ #elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
!defined(DISABLE_ASM)
#define HAS_SPLITYUY2_SSE2 #define HAS_SPLITYUY2_SSE2
static void SplitYUY2_SSE2(const uint8* src_yuy2, uint8* dst_y, static void SplitYUY2_SSE2(const uint8* src_yuy2, uint8* dst_y,
uint8* dst_u, uint8* dst_v, int pix) { uint8* dst_u, uint8* dst_v, int pix) {
...@@ -762,7 +761,7 @@ int Q420ToI420(const uint8* src_y, int src_stride_y, ...@@ -762,7 +761,7 @@ int Q420ToI420(const uint8* src_y, int src_stride_y,
return 0; return 0;
} }
#if defined(WIN32) && !defined(DISABLE_ASM) #if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_YUY2TOI420ROW_SSE2 #define HAS_YUY2TOI420ROW_SSE2
__declspec(naked) __declspec(naked)
void YUY2ToI420RowY_SSE2(const uint8* src_yuy2, void YUY2ToI420RowY_SSE2(const uint8* src_yuy2,
...@@ -899,8 +898,7 @@ void UYVYToI420RowUV_SSE2(const uint8* src_uyvy, int stride_uyvy, ...@@ -899,8 +898,7 @@ void UYVYToI420RowUV_SSE2(const uint8* src_uyvy, int stride_uyvy,
} }
} }
#elif (defined(__x86_64__) || defined(__i386__)) && \ #elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
!defined(DISABLE_ASM)
#define HAS_YUY2TOI420ROW_SSE2 #define HAS_YUY2TOI420ROW_SSE2
static void YUY2ToI420RowY_SSE2(const uint8* src_yuy2, static void YUY2ToI420RowY_SSE2(const uint8* src_yuy2,
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
namespace libyuv { namespace libyuv {
#if (defined(WIN32) || defined(__x86_64__) || defined(__i386__)) && \ #if (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) && \
!defined(LIBYUV_DISABLE_ASM) !defined(YUV_DISABLE_ASM)
// Note static const preferred, but gives internal compiler error on gcc 4.2 // Note static const preferred, but gives internal compiler error on gcc 4.2
// Shuffle table for reversing the bytes. // Shuffle table for reversing the bytes.
uvec8 kShuffleReverse = { uvec8 kShuffleReverse = {
...@@ -58,7 +58,7 @@ void TransposeUVWx8_NEON(const uint8* src, int src_stride, ...@@ -58,7 +58,7 @@ void TransposeUVWx8_NEON(const uint8* src, int src_stride,
int width); int width);
#endif #endif
#if defined(WIN32) && !defined(LIBYUV_DISABLE_ASM) #if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_TRANSPOSE_WX8_SSSE3 #define HAS_TRANSPOSE_WX8_SSSE3
__declspec(naked) __declspec(naked)
static void TransposeWx8_SSSE3(const uint8* src, int src_stride, static void TransposeWx8_SSSE3(const uint8* src, int src_stride,
...@@ -276,8 +276,7 @@ __asm { ...@@ -276,8 +276,7 @@ __asm {
ret ret
} }
} }
#elif (defined(__i386__) || defined(__x86_64__)) && \ #elif (defined(__i386__) || defined(__x86_64__)) && !defined(YUV_DISABLE_ASM)
!defined(LIBYUV_DISABLE_ASM) && !defined(TARGET_IPHONE_SIMULATOR)
#define HAS_TRANSPOSE_WX8_SSSE3 #define HAS_TRANSPOSE_WX8_SSSE3
static void TransposeWx8_SSSE3(const uint8* src, int src_stride, static void TransposeWx8_SSSE3(const uint8* src, int src_stride,
uint8* dst, int dst_stride, int width) { uint8* dst, int dst_stride, int width) {
...@@ -854,7 +853,7 @@ static void ReverseRow_C(const uint8* src, uint8* dst, int width) { ...@@ -854,7 +853,7 @@ static void ReverseRow_C(const uint8* src, uint8* dst, int width) {
} }
} }
#if defined(WIN32) && !defined(LIBYUV_DISABLE_ASM) #if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_REVERSE_ROW_SSSE3 #define HAS_REVERSE_ROW_SSSE3
__declspec(naked) __declspec(naked)
static void ReverseRow_SSSE3(const uint8* src, uint8* dst, int width) { static void ReverseRow_SSSE3(const uint8* src, uint8* dst, int width) {
...@@ -877,7 +876,7 @@ __asm { ...@@ -877,7 +876,7 @@ __asm {
} }
#elif (defined(__i386__) || defined(__x86_64__)) && \ #elif (defined(__i386__) || defined(__x86_64__)) && \
!defined(LIBYUV_DISABLE_ASM) && !defined(TARGET_IPHONE_SIMULATOR) !defined(YUV_DISABLE_ASM)
#define HAS_REVERSE_ROW_SSSE3 #define HAS_REVERSE_ROW_SSSE3
static void ReverseRow_SSSE3(const uint8* src, uint8* dst, int width) { static void ReverseRow_SSSE3(const uint8* src, uint8* dst, int width) {
intptr_t temp_width = static_cast<intptr_t>(width); intptr_t temp_width = static_cast<intptr_t>(width);
...@@ -1053,7 +1052,7 @@ void RotateUV270(const uint8* src, int src_stride, ...@@ -1053,7 +1052,7 @@ void RotateUV270(const uint8* src, int src_stride,
width, height); width, height);
} }
#if defined(WIN32) && !defined(LIBYUV_DISABLE_ASM) #if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_REVERSE_ROW_UV_SSSE3 #define HAS_REVERSE_ROW_UV_SSSE3
__declspec(naked) __declspec(naked)
void ReverseRowUV_SSSE3(const uint8* src, void ReverseRowUV_SSSE3(const uint8* src,
...@@ -1084,7 +1083,7 @@ __asm { ...@@ -1084,7 +1083,7 @@ __asm {
} }
#elif (defined(__i386__) || defined(__x86_64__)) && \ #elif (defined(__i386__) || defined(__x86_64__)) && \
!defined(LIBYUV_DISABLE_ASM) && !defined(TARGET_IPHONE_SIMULATOR) !defined(YUV_DISABLE_ASM)
#define HAS_REVERSE_ROW_UV_SSSE3 #define HAS_REVERSE_ROW_UV_SSSE3
void ReverseRowUV_SSSE3(const uint8* src, void ReverseRowUV_SSSE3(const uint8* src,
uint8* dst_a, uint8* dst_b, uint8* dst_a, uint8* dst_b,
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
*/ */
#include "libyuv/basic_types.h" #include "libyuv/basic_types.h"
#include "row.h"
namespace libyuv { namespace libyuv {
#if defined(__ARM_NEON__) && \ #if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
void ReverseRow_NEON(const uint8* src, uint8* dst, int width) { void ReverseRow_NEON(const uint8* src, uint8* dst, int width) {
asm volatile ( asm volatile (
......
...@@ -49,7 +49,7 @@ void SetUseReferenceImpl(bool use) { ...@@ -49,7 +49,7 @@ void SetUseReferenceImpl(bool use) {
* *
*/ */
#if defined(__ARM_NEON__) && !defined(COVERAGE_ENABLED) #if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
#define HAS_SCALEROWDOWN2_NEON #define HAS_SCALEROWDOWN2_NEON
void ScaleRowDown2_NEON(const uint8* src_ptr, int /* src_stride */, void ScaleRowDown2_NEON(const uint8* src_ptr, int /* src_stride */,
uint8* dst, int dst_width) { uint8* dst, int dst_width) {
...@@ -505,8 +505,8 @@ static void ScaleRowDown38_2_Int_NEON(const uint8* src_ptr, int src_stride, ...@@ -505,8 +505,8 @@ static void ScaleRowDown38_2_Int_NEON(const uint8* src_ptr, int src_stride,
*/ */
// Constants for SSE2 code // Constants for SSE2 code
#elif (defined(WIN32) || defined(__i386__) || defined(__x86_64__)) && \ #elif (defined(_M_IX86) || defined(__i386__) || defined(__x86_64__)) && \
!defined(COVERAGE_ENABLED) && !TARGET_IPHONE_SIMULATOR !defined(YUV_DISABLE_ASM)
#if defined(_MSC_VER) #if defined(_MSC_VER)
#define TALIGN16(t, var) __declspec(align(16)) t _ ## var #define TALIGN16(t, var) __declspec(align(16)) t _ ## var
#elif defined(OSX) && defined(__i386__) #elif defined(OSX) && defined(__i386__)
...@@ -590,7 +590,7 @@ extern "C" TALIGN16(const uint16, scaleab2[8]) = ...@@ -590,7 +590,7 @@ extern "C" TALIGN16(const uint16, scaleab2[8]) =
{ 65536 / 3, 65536 / 3, 65536 / 2, 65536 / 3, 65536 / 3, 65536 / 2, 0, 0 }; { 65536 / 3, 65536 / 3, 65536 / 2, 65536 / 3, 65536 / 3, 65536 / 2, 0, 0 };
#endif #endif
#if defined(WIN32) && !defined(COVERAGE_ENABLED) #if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
#define HAS_SCALEROWDOWN2_SSE2 #define HAS_SCALEROWDOWN2_SSE2
// Reads 32 pixels, throws half away and writes 16 pixels. // Reads 32 pixels, throws half away and writes 16 pixels.
...@@ -1444,8 +1444,7 @@ static void ScaleFilterCols34_SSSE3(uint8* dst_ptr, const uint8* src_ptr, ...@@ -1444,8 +1444,7 @@ static void ScaleFilterCols34_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
} }
} }
#elif (defined(__x86_64__) || defined(__i386__)) && \ #elif (defined(__x86_64__) || defined(__i386__)) && !defined(YUV_DISABLE_ASM)
!defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR)
// GCC versions of row functions are verbatim conversions from Visual C. // GCC versions of row functions are verbatim conversions from Visual C.
// Generated using gcc disassembly on Visual C object file: // Generated using gcc disassembly on Visual C object file:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment