Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: source/row_gcc.cc

Issue 1995293002: Add ARGBExtractAlpha function (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Use packuswb xmm0, xmm0 instead Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/row_common.cc ('k') | source/row_neon.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // VERSION 2 1 // VERSION 2
2 /* 2 /*
3 * Copyright 2011 The LibYuv Project Authors. All rights reserved. 3 * Copyright 2011 The LibYuv Project Authors. All rights reserved.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license 5 * Use of this source code is governed by a BSD-style license
6 * that can be found in the LICENSE file in the root of the source 6 * that can be found in the LICENSE file in the root of the source
7 * tree. An additional intellectual property rights grant can be found 7 * tree. An additional intellectual property rights grant can be found
8 * in the file PATENTS. All contributing project authors may 8 * in the file PATENTS. All contributing project authors may
9 * be found in the AUTHORS file in the root of the source tree. 9 * be found in the AUTHORS file in the root of the source tree.
10 */ 10 */
(...skipping 2918 matching lines...) Expand 10 before | Expand all | Expand 10 after
2929 : "+r"(src), // %0 2929 : "+r"(src), // %0
2930 "+r"(dst), // %1 2930 "+r"(dst), // %1
2931 "+r"(width) // %2 2931 "+r"(width) // %2
2932 : 2932 :
2933 : "memory", "cc" 2933 : "memory", "cc"
2934 , "xmm0", "xmm1", "xmm2" 2934 , "xmm0", "xmm1", "xmm2"
2935 ); 2935 );
2936 } 2936 }
2937 #endif // HAS_ARGBCOPYALPHAROW_AVX2 2937 #endif // HAS_ARGBCOPYALPHAROW_AVX2
2938 2938
2939 #ifdef HAS_ARGBEXTRACTALPHAROW_SSE2
2940 // width in pixels
2941 void ARGBExtractAlphaRow_SSE2(const uint8* src_argb, uint8* dst_a, int width) {
2942 asm volatile (
2943 LABELALIGN
2944 "1: \n"
2945 "movdqu " MEMACCESS(0) ", %%xmm0 \n"
2946 "movdqu " MEMACCESS2(0x10, 0) ", %%xmm1 \n"
2947 "lea " MEMLEA(0x20, 0) ", %0 \n"
2948 "psrld $0x18, %%xmm0 \n"
2949 "psrld $0x18, %%xmm1 \n"
2950 "packssdw %%xmm1, %%xmm0 \n"
2951 "packuswb %%xmm0, %%xmm0 \n"
2952 "movq %%xmm0," MEMACCESS(1) " \n"
2953 "lea " MEMLEA(0x8, 1) ", %1 \n"
2954 "sub $0x8, %2 \n"
2955 "jg 1b \n"
2956 : "+r"(src_argb), // %0
2957 "+r"(dst_a), // %1
2958 "+rm"(width) // %2
2959 :
2960 : "memory", "cc"
2961 , "xmm0", "xmm1"
2962 );
2963 }
2964 #endif // HAS_ARGBEXTRACTALPHAROW_SSE2
2965
2939 #ifdef HAS_ARGBCOPYYTOALPHAROW_SSE2 2966 #ifdef HAS_ARGBCOPYYTOALPHAROW_SSE2
2940 // width in pixels 2967 // width in pixels
2941 void ARGBCopyYToAlphaRow_SSE2(const uint8* src, uint8* dst, int width) { 2968 void ARGBCopyYToAlphaRow_SSE2(const uint8* src, uint8* dst, int width) {
2942 asm volatile ( 2969 asm volatile (
2943 "pcmpeqb %%xmm0,%%xmm0 \n" 2970 "pcmpeqb %%xmm0,%%xmm0 \n"
2944 "pslld $0x18,%%xmm0 \n" 2971 "pslld $0x18,%%xmm0 \n"
2945 "pcmpeqb %%xmm1,%%xmm1 \n" 2972 "pcmpeqb %%xmm1,%%xmm1 \n"
2946 "psrld $0x8,%%xmm1 \n" 2973 "psrld $0x8,%%xmm1 \n"
2947 LABELALIGN 2974 LABELALIGN
2948 "1: \n" 2975 "1: \n"
(...skipping 2549 matching lines...) Expand 10 before | Expand all | Expand 10 after
5498 ); 5525 );
5499 } 5526 }
5500 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 5527 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3
5501 5528
5502 #endif // defined(__x86_64__) || defined(__i386__) 5529 #endif // defined(__x86_64__) || defined(__i386__)
5503 5530
5504 #ifdef __cplusplus 5531 #ifdef __cplusplus
5505 } // extern "C" 5532 } // extern "C"
5506 } // namespace libyuv 5533 } // namespace libyuv
5507 #endif 5534 #endif
OLDNEW
« no previous file with comments | « source/row_common.cc ('k') | source/row_neon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698