mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
CopyRow_X86 for gcc
BUG=none TEST=none Review URL: http://webrtc-codereview.appspot.com/300007 git-svn-id: http://libyuv.googlecode.com/svn/trunk@97 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
c2b74366ec
commit
e5ffa14f31
@ -1,6 +1,6 @@
|
|||||||
Name: libyuv
|
Name: libyuv
|
||||||
URL: http://code.google.com/p/libyuv/
|
URL: http://code.google.com/p/libyuv/
|
||||||
Version: 96
|
Version: 97
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
|
|
||||||
|
|||||||
@ -129,7 +129,6 @@ static void SplitUV_C(const uint8* src_uv,
|
|||||||
// CopyRows copys 'count' bytes using a 16 byte load/store, 64 bytes at time
|
// CopyRows copys 'count' bytes using a 16 byte load/store, 64 bytes at time
|
||||||
#if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
|
#if defined(_M_IX86) && !defined(YUV_DISABLE_ASM)
|
||||||
#define HAS_COPYROW_SSE2
|
#define HAS_COPYROW_SSE2
|
||||||
#define HAS_COPYROW_X86
|
|
||||||
__declspec(naked)
|
__declspec(naked)
|
||||||
void CopyRow_SSE2(const uint8* src, uint8* dst, int count) {
|
void CopyRow_SSE2(const uint8* src, uint8* dst, int count) {
|
||||||
__asm {
|
__asm {
|
||||||
@ -150,6 +149,7 @@ void CopyRow_SSE2(const uint8* src, uint8* dst, int count) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define HAS_COPYROW_X86
|
||||||
__declspec(naked)
|
__declspec(naked)
|
||||||
void CopyRow_X86(const uint8* src, uint8* dst, int count) {
|
void CopyRow_X86(const uint8* src, uint8* dst, int count) {
|
||||||
__asm {
|
__asm {
|
||||||
@ -169,15 +169,15 @@ void CopyRow_X86(const uint8* src, uint8* dst, int count) {
|
|||||||
#define HAS_COPYROW_SSE2
|
#define HAS_COPYROW_SSE2
|
||||||
void CopyRow_SSE2(const uint8* src, uint8* dst, int count) {
|
void CopyRow_SSE2(const uint8* src, uint8* dst, int count) {
|
||||||
asm volatile (
|
asm volatile (
|
||||||
"1: \n"
|
"1: \n"
|
||||||
"movdqa (%0),%%xmm0 \n"
|
"movdqa (%0),%%xmm0 \n"
|
||||||
"movdqa 0x10(%0),%%xmm1 \n"
|
"movdqa 0x10(%0),%%xmm1 \n"
|
||||||
"lea 0x20(%0),%0 \n"
|
"lea 0x20(%0),%0 \n"
|
||||||
"movdqa %%xmm0,(%1) \n"
|
"movdqa %%xmm0,(%1) \n"
|
||||||
"movdqa %%xmm1,0x10(%1) \n"
|
"movdqa %%xmm1,0x10(%1) \n"
|
||||||
"lea 0x20(%1),%1 \n"
|
"lea 0x20(%1),%1 \n"
|
||||||
"sub $0x20,%2 \n"
|
"sub $0x20,%2 \n"
|
||||||
"ja 1b \n"
|
"ja 1b \n"
|
||||||
: "+r"(src), // %0
|
: "+r"(src), // %0
|
||||||
"+r"(dst), // %1
|
"+r"(dst), // %1
|
||||||
"+r"(count) // %2
|
"+r"(count) // %2
|
||||||
@ -186,7 +186,21 @@ void CopyRow_SSE2(const uint8* src, uint8* dst, int count) {
|
|||||||
#if defined(__SSE2__)
|
#if defined(__SSE2__)
|
||||||
, "xmm0", "xmm1"
|
, "xmm0", "xmm1"
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define HAS_COPYROW_X86
|
||||||
|
void CopyRow_X86(const uint8* src, uint8* dst, int width) {
|
||||||
|
size_t width_tmp = static_cast<size_t>(width);
|
||||||
|
asm volatile (
|
||||||
|
"shr $0x2,%2 \n"
|
||||||
|
"rep movsl (%0),(%1) \n"
|
||||||
|
: "+S"(src), // %0
|
||||||
|
"+D"(dst), // %1
|
||||||
|
"+c"(width_tmp) // %2
|
||||||
|
:
|
||||||
|
: "memory", "cc"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user