Commit f78509b3 authored by nfullagar@google.com's avatar nfullagar@google.com

Port Interpolate SSE2 to NaCl

BUG=253
TEST=libyuv_test,try bots
R=fbarchard@google.com

Review URL: https://webrtc-codereview.appspot.com/2013005

git-svn-id: http://libyuv.googlecode.com/svn/trunk@762 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 6f61eb67
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 761 Version: 762
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -53,6 +53,8 @@ extern "C" { ...@@ -53,6 +53,8 @@ extern "C" {
#define HAS_ARGBSUBTRACTROW_SSE2 #define HAS_ARGBSUBTRACTROW_SSE2
#define HAS_COMPUTECUMULATIVESUMROW_SSE2 #define HAS_COMPUTECUMULATIVESUMROW_SSE2
#define HAS_CUMULATIVESUMTOAVERAGEROW_SSE2 #define HAS_CUMULATIVESUMTOAVERAGEROW_SSE2
#define HAS_INTERPOLATEROW_SSE2
#define HAS_INTERPOLATEROW_SSSE3
// Conversions: // Conversions:
#define HAS_ARGBSHUFFLEROW_SSSE3 #define HAS_ARGBSHUFFLEROW_SSSE3
...@@ -63,7 +65,6 @@ extern "C" { ...@@ -63,7 +65,6 @@ extern "C" {
#define HAS_COPYROW_X86 #define HAS_COPYROW_X86
#define HAS_FIXEDDIV_X86 #define HAS_FIXEDDIV_X86
#define HAS_I400TOARGBROW_SSE2 #define HAS_I400TOARGBROW_SSE2
#define HAS_INTERPOLATEROW_SSSE3
#define HAS_SETROW_X86 #define HAS_SETROW_X86
#endif #endif
...@@ -130,7 +131,6 @@ extern "C" { ...@@ -130,7 +131,6 @@ extern "C" {
// Effects: // Effects:
#define HAS_ARGBUNATTENUATEROW_SSE2 #define HAS_ARGBUNATTENUATEROW_SSE2
#define HAS_INTERPOLATEROW_SSE2
#define HAS_SOBELROW_SSE2 #define HAS_SOBELROW_SSE2
#define HAS_SOBELXROW_SSSE3 #define HAS_SOBELXROW_SSSE3
#define HAS_SOBELXYROW_SSE2 #define HAS_SOBELXYROW_SSE2
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 761 #define LIBYUV_VERSION 762
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -5017,9 +5017,10 @@ void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr, ...@@ -5017,9 +5017,10 @@ void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
// General purpose row blend. // General purpose row blend.
".p2align 4 \n" ".p2align 4 \n"
BUNDLEALIGN
"1: \n" "1: \n"
"movdqa (%1),%%xmm0 \n" "movdqa "MEMACCESS(1)",%%xmm0 \n"
"movdqa (%1,%4,1),%%xmm2 \n" MEMOPREG(movdqa,0x00,1,4,1,xmm2) // movdqa (%1,%4,1),%%xmm2
"movdqa %%xmm0,%%xmm1 \n" "movdqa %%xmm0,%%xmm1 \n"
"movdqa %%xmm2,%%xmm3 \n" "movdqa %%xmm2,%%xmm3 \n"
"punpcklbw %%xmm4,%%xmm2 \n" "punpcklbw %%xmm4,%%xmm2 \n"
...@@ -5036,56 +5037,64 @@ void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr, ...@@ -5036,56 +5037,64 @@ void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
"paddw %%xmm3,%%xmm1 \n" "paddw %%xmm3,%%xmm1 \n"
"packuswb %%xmm1,%%xmm0 \n" "packuswb %%xmm1,%%xmm0 \n"
"sub $0x10,%2 \n" "sub $0x10,%2 \n"
"movdqa %%xmm0,(%1,%0,1) \n" BUNDLEALIGN
"lea 0x10(%1),%1 \n" MEMOPMEM(movdqa,xmm0,0x00,1,0,1) // movdqa %%xmm0,(%1,%0,1)
"lea "MEMLEA(0x10,1)",%1 \n"
"jg 1b \n" "jg 1b \n"
"jmp 99f \n" "jmp 99f \n"
// Blend 25 / 75. // Blend 25 / 75.
".p2align 4 \n" ".p2align 4 \n"
BUNDLEALIGN
"25: \n" "25: \n"
"movdqa (%1),%%xmm0 \n" "movdqa "MEMACCESS(1)",%%xmm0 \n"
"movdqa (%1,%4,1),%%xmm1 \n" MEMOPREG(movdqa,0x00,1,4,1,xmm1) // movdqa (%1,%4,1),%%xmm1
"pavgb %%xmm1,%%xmm0 \n" "pavgb %%xmm1,%%xmm0 \n"
"pavgb %%xmm1,%%xmm0 \n" "pavgb %%xmm1,%%xmm0 \n"
"sub $0x10,%2 \n" "sub $0x10,%2 \n"
"movdqa %%xmm0,(%1,%0,1) \n" BUNDLEALIGN
"lea 0x10(%1),%1 \n" MEMOPMEM(movdqa,xmm0,0x00,1,0,1) // movdqa %%xmm0,(%1,%0,1)
"lea "MEMLEA(0x10,1)",%1 \n"
"jg 25b \n" "jg 25b \n"
"jmp 99f \n" "jmp 99f \n"
// Blend 50 / 50. // Blend 50 / 50.
".p2align 4 \n" ".p2align 4 \n"
BUNDLEALIGN
"50: \n" "50: \n"
"movdqa (%1),%%xmm0 \n" "movdqa "MEMACCESS(1)",%%xmm0 \n"
"movdqa (%1,%4,1),%%xmm1 \n" MEMOPREG(movdqa,0x00,1,4,1,xmm1) // movdqa (%1,%4,1),%%xmm1
"pavgb %%xmm1,%%xmm0 \n" "pavgb %%xmm1,%%xmm0 \n"
"sub $0x10,%2 \n" "sub $0x10,%2 \n"
"movdqa %%xmm0,(%1,%0,1) \n" BUNDLEALIGN
"lea 0x10(%1),%1 \n" MEMOPMEM(movdqa,xmm0,0x00,1,0,1) // movdqa %%xmm0,(%1,%0,1)
"lea "MEMLEA(0x10,1)",%1 \n"
"jg 50b \n" "jg 50b \n"
"jmp 99f \n" "jmp 99f \n"
// Blend 75 / 25. // Blend 75 / 25.
".p2align 4 \n" ".p2align 4 \n"
BUNDLEALIGN
"75: \n" "75: \n"
"movdqa (%1),%%xmm1 \n" "movdqa "MEMACCESS(1)",%%xmm1 \n"
"movdqa (%1,%4,1),%%xmm0 \n" MEMOPREG(movdqa,0x00,1,4,1,xmm0) // movdqa (%1,%4,1),%%xmm0
"pavgb %%xmm1,%%xmm0 \n" "pavgb %%xmm1,%%xmm0 \n"
"pavgb %%xmm1,%%xmm0 \n" "pavgb %%xmm1,%%xmm0 \n"
"sub $0x10,%2 \n" "sub $0x10,%2 \n"
"movdqa %%xmm0,(%1,%0,1) \n" BUNDLEALIGN
"lea 0x10(%1),%1 \n" MEMOPMEM(movdqa,xmm0,0x00,1,0,1) // movdqa %%xmm0,(%1,%0,1)
"lea "MEMLEA(0x10,1)",%1 \n"
"jg 75b \n" "jg 75b \n"
"jmp 99f \n" "jmp 99f \n"
// Blend 100 / 0 - Copy row unchanged. // Blend 100 / 0 - Copy row unchanged.
".p2align 4 \n" ".p2align 4 \n"
BUNDLEALIGN
"100: \n" "100: \n"
"movdqa (%1),%%xmm0 \n" "movdqa "MEMACCESS(1)",%%xmm0 \n"
"sub $0x10,%2 \n" "sub $0x10,%2 \n"
"movdqa %%xmm0,(%1,%0,1) \n" MEMOPMEM(movdqa,xmm0,0x00,1,0,1) // movdqa %%xmm0,(%1,%0,1)
"lea 0x10(%1),%1 \n" "lea "MEMLEA(0x10,1)",%1 \n"
"jg 100b \n" "jg 100b \n"
"99: \n" "99: \n"
...@@ -5095,6 +5104,9 @@ void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr, ...@@ -5095,6 +5104,9 @@ void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr,
"+r"(source_y_fraction) // %3 "+r"(source_y_fraction) // %3
: "r"(static_cast<intptr_t>(src_stride)) // %4 : "r"(static_cast<intptr_t>(src_stride)) // %4
: "memory", "cc" : "memory", "cc"
#if defined(__native_client__) && defined(__x86_64__)
, "r14"
#endif
#if defined(__SSE2__) #if defined(__SSE2__)
, "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" , "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"
#endif #endif
...@@ -5247,9 +5259,10 @@ void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr, ...@@ -5247,9 +5259,10 @@ void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr,
// General purpose row blend. // General purpose row blend.
".p2align 4 \n" ".p2align 4 \n"
BUNDLEALIGN
"1: \n" "1: \n"
"movdqu (%1),%%xmm0 \n" "movdqu "MEMACCESS(1)",%%xmm0 \n"
"movdqu (%1,%4,1),%%xmm2 \n" MEMOPREG(movdqu,0x00,1,4,1,xmm2) // movdqu (%1,%4,1),%%xmm2
"movdqu %%xmm0,%%xmm1 \n" "movdqu %%xmm0,%%xmm1 \n"
"movdqu %%xmm2,%%xmm3 \n" "movdqu %%xmm2,%%xmm3 \n"
"punpcklbw %%xmm4,%%xmm2 \n" "punpcklbw %%xmm4,%%xmm2 \n"
...@@ -5266,56 +5279,64 @@ void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr, ...@@ -5266,56 +5279,64 @@ void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr,
"paddw %%xmm3,%%xmm1 \n" "paddw %%xmm3,%%xmm1 \n"
"packuswb %%xmm1,%%xmm0 \n" "packuswb %%xmm1,%%xmm0 \n"
"sub $0x10,%2 \n" "sub $0x10,%2 \n"
"movdqu %%xmm0,(%1,%0,1) \n" BUNDLEALIGN
"lea 0x10(%1),%1 \n" MEMOPMEM(movdqu,xmm0,0x00,1,0,1) // movdqu %%xmm0,(%1,%0,1)
"lea "MEMLEA(0x10,1)",%1 \n"
"jg 1b \n" "jg 1b \n"
"jmp 99f \n" "jmp 99f \n"
// Blend 25 / 75. // Blend 25 / 75.
".p2align 4 \n" ".p2align 4 \n"
BUNDLEALIGN
"25: \n" "25: \n"
"movdqu (%1),%%xmm0 \n" "movdqu "MEMACCESS(1)",%%xmm0 \n"
"movdqu (%1,%4,1),%%xmm1 \n" MEMOPREG(movdqu,0x00,1,4,1,xmm1) // movdqu (%1,%4,1),%%xmm1
"pavgb %%xmm1,%%xmm0 \n" "pavgb %%xmm1,%%xmm0 \n"
"pavgb %%xmm1,%%xmm0 \n" "pavgb %%xmm1,%%xmm0 \n"
"sub $0x10,%2 \n" "sub $0x10,%2 \n"
"movdqu %%xmm0,(%1,%0,1) \n" BUNDLEALIGN
"lea 0x10(%1),%1 \n" MEMOPMEM(movdqu,xmm0,0x00,1,0,1) // movdqu %%xmm0,(%1,%0,1)
"lea "MEMLEA(0x10,1)",%1 \n"
"jg 25b \n" "jg 25b \n"
"jmp 99f \n" "jmp 99f \n"
// Blend 50 / 50. // Blend 50 / 50.
".p2align 4 \n" ".p2align 4 \n"
BUNDLEALIGN
"50: \n" "50: \n"
"movdqu (%1),%%xmm0 \n" "movdqu "MEMACCESS(1)",%%xmm0 \n"
"movdqu (%1,%4,1),%%xmm1 \n" MEMOPREG(movdqu,0x00,1,4,1,xmm1) // movdqu (%1,%4,1),%%xmm1
"pavgb %%xmm1,%%xmm0 \n" "pavgb %%xmm1,%%xmm0 \n"
"sub $0x10,%2 \n" "sub $0x10,%2 \n"
"movdqu %%xmm0,(%1,%0,1) \n" BUNDLEALIGN
"lea 0x10(%1),%1 \n" MEMOPMEM(movdqu,xmm0,0x00,1,0,1) // movdqu %%xmm0,(%1,%0,1)
"lea "MEMLEA(0x10,1)",%1 \n"
"jg 50b \n" "jg 50b \n"
"jmp 99f \n" "jmp 99f \n"
// Blend 75 / 25. // Blend 75 / 25.
".p2align 4 \n" ".p2align 4 \n"
BUNDLEALIGN
"75: \n" "75: \n"
"movdqu (%1),%%xmm1 \n" "movdqu "MEMACCESS(1)",%%xmm1 \n"
"movdqu (%1,%4,1),%%xmm0 \n" MEMOPREG(movdqu,0x00,1,4,1,xmm0) // movdqu (%1,%4,1),%%xmm0
"pavgb %%xmm1,%%xmm0 \n" "pavgb %%xmm1,%%xmm0 \n"
"pavgb %%xmm1,%%xmm0 \n" "pavgb %%xmm1,%%xmm0 \n"
"sub $0x10,%2 \n" "sub $0x10,%2 \n"
"movdqu %%xmm0,(%1,%0,1) \n" BUNDLEALIGN
"lea 0x10(%1),%1 \n" MEMOPMEM(movdqu,xmm0,0x00,1,0,1) // movdqu %%xmm0,(%1,%0,1)
"lea "MEMLEA(0x10,1)",%1 \n"
"jg 75b \n" "jg 75b \n"
"jmp 99f \n" "jmp 99f \n"
// Blend 100 / 0 - Copy row unchanged. // Blend 100 / 0 - Copy row unchanged.
".p2align 4 \n" ".p2align 4 \n"
BUNDLEALIGN
"100: \n" "100: \n"
"movdqu (%1),%%xmm0 \n" "movdqu "MEMACCESS(1)",%%xmm0 \n"
"sub $0x10,%2 \n" "sub $0x10,%2 \n"
"movdqu %%xmm0,(%1,%0,1) \n" MEMOPMEM(movdqu,xmm0,0x00,1,0,1) // movdqu %%xmm0,(%1,%0,1)
"lea 0x10(%1),%1 \n" "lea "MEMLEA(0x10,1)",%1 \n"
"jg 100b \n" "jg 100b \n"
"99: \n" "99: \n"
...@@ -5325,6 +5346,9 @@ void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr, ...@@ -5325,6 +5346,9 @@ void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr,
"+r"(source_y_fraction) // %3 "+r"(source_y_fraction) // %3
: "r"(static_cast<intptr_t>(src_stride)) // %4 : "r"(static_cast<intptr_t>(src_stride)) // %4
: "memory", "cc" : "memory", "cc"
#if defined(__native_client__) && defined(__x86_64__)
, "r14"
#endif
#if defined(__SSE2__) #if defined(__SSE2__)
, "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" , "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"
#endif #endif
......
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