From 0db78ad127aacd528b5a699a8d0f3d6fb01e4a01 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Sun, 8 Dec 2013 19:23:41 +0000 Subject: [PATCH] Switch from xor/mov bx, to movzx ebx, which still passes drmemory and valgrind. BUG=none TESTED=drmemory Review URL: https://webrtc-codereview.appspot.com/5339004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@904 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- source/scale_posix.cc | 9 +++------ source/scale_win.cc | 9 +++------ unit_test/unit_test.cc | 4 ++-- 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/README.chromium b/README.chromium index ddca5a06a..f47e9eed9 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 902 +Version: 904 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 83ae6f4fa..2714f8a21 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 902 +#define LIBYUV_VERSION 904 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/scale_posix.cc b/source/scale_posix.cc index 03882af4a..a777bfde1 100644 --- a/source/scale_posix.cc +++ b/source/scale_posix.cc @@ -857,13 +857,11 @@ void ScaleFilterCols_SSSE3(uint8* dst_ptr, const uint8* src_ptr, "2: \n" "movdqa %%xmm2,%%xmm1 \n" "paddd %%xmm3,%%xmm2 \n" - "xor %2,%2 \n" - MEMOP(mov,0x00,1,3,1) ",%w2 \n" // mov (%1,%3,1),%w2 + MEMOP(movzwl,0x00,1,3,1) ",%k2 \n" // movzwl (%1,%3,1),%k2 "movd %k2,%%xmm0 \n" "psrlw $0x9,%%xmm1 \n" BUNDLEALIGN - "xor %2,%2 \n" - MEMOP(mov,0x00,1,4,1) ",%w2 \n" // mov (%1,%4,1),%w2 + MEMOP(movzwl,0x00,1,4,1) ",%k2 \n" // movzwl (%1,%4,1),%k2 "movd %k2,%%xmm4 \n" "pshufb %%xmm5,%%xmm1 \n" "punpcklwd %%xmm4,%%xmm0 \n" @@ -883,8 +881,7 @@ void ScaleFilterCols_SSSE3(uint8* dst_ptr, const uint8* src_ptr, "29: \n" "addl $0x1,%5 \n" "jl 99f \n" - "xor %2,%2 \n" - MEMOP(mov,0x00,1,3,1) ",%w2 \n" // mov (%1,%3,1),%w2 + MEMOP(movzwl,0x00,1,3,1) ",%k2 \n" // movzwl (%1,%3,1),%k2 "movd %k2,%%xmm0 \n" "psrlw $0x9,%%xmm2 \n" "pshufb %%xmm5,%%xmm2 \n" diff --git a/source/scale_win.cc b/source/scale_win.cc index fe2f84cfa..76f5f4b4b 100644 --- a/source/scale_win.cc +++ b/source/scale_win.cc @@ -831,12 +831,10 @@ void ScaleFilterCols_SSSE3(uint8* dst_ptr, const uint8* src_ptr, xloop2: movdqa xmm1, xmm2 // x0, x1 fractions. paddd xmm2, xmm3 // x += dx - xor ebx, ebx - mov bx, word ptr [esi + eax] // 2 source x0 pixels + movzx ebx, word ptr [esi + eax] // 2 source x0 pixels movd xmm0, ebx psrlw xmm1, 9 // 7 bit fractions. - xor ebx, ebx - mov bx, word ptr [esi + edx] // 2 source x1 pixels + movzx ebx, word ptr [esi + edx] // 2 source x1 pixels movd xmm4, ebx pshufb xmm1, xmm5 // 0011 punpcklwd xmm0, xmm4 @@ -859,8 +857,7 @@ void ScaleFilterCols_SSSE3(uint8* dst_ptr, const uint8* src_ptr, jl xloop99 // 1 pixel remainder - xor ebx, ebx - mov bx, word ptr [esi + eax] // 2 source x0 pixels + movzx ebx, word ptr [esi + eax] // 2 source x0 pixels movd xmm0, ebx psrlw xmm2, 9 // 7 bit fractions. pshufb xmm2, xmm5 // 0011 diff --git a/unit_test/unit_test.cc b/unit_test/unit_test.cc index 12e8a5677..d1bbffa4a 100644 --- a/unit_test/unit_test.cc +++ b/unit_test/unit_test.cc @@ -19,8 +19,8 @@ #define BENCHMARK_ITERATIONS 1 libyuvTest::libyuvTest() : rotate_max_w_(128), rotate_max_h_(128), - benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(353), - benchmark_height_(264) { + benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(33), + benchmark_height_(17) { const char* repeat = getenv("LIBYUV_REPEAT"); if (repeat) { benchmark_iterations_ = atoi(repeat); // NOLINT