From 0735245c527152d934f108110a1c573a2d47fd46 Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Fri, 28 Aug 2015 17:03:54 -0700 Subject: [PATCH] pinsrw instruction allows reading 2 bytes directly into an xmm register. Saving a gpr register allows the register to not be pushed for now, and in future it can be used to point to color conversion matrix or alpha channel. R=harryjin@google.com BUG=libyuv:488 Review URL: https://webrtc-codereview.appspot.com/52789004. --- source/row_win.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/source/row_win.cc b/source/row_win.cc index da28fc818..30aecf0be 100644 --- a/source/row_win.cc +++ b/source/row_win.cc @@ -2378,14 +2378,12 @@ void I422ToABGRRow_AVX2(const uint8* y_buf, // Read 2 UV from 411, upsample to 8 UV. #define READYUV411 __asm { \ - __asm movzx ebx, word ptr [esi] /* U */ /* NOLINT */ \ - __asm movd xmm0, ebx \ - __asm movzx ebx, word ptr [esi + edi] /* V */ /* NOLINT */ \ - __asm movd xmm1, ebx \ + __asm pinsrw xmm0, [esi], 0 /* U */ \ + __asm pinsrw xmm1, [esi + edi], 0 /* V */ \ __asm lea esi, [esi + 2] \ - __asm punpcklbw xmm0, xmm1 /* UV */ \ - __asm punpcklwd xmm0, xmm0 /* UVUV (upsample) */ \ - __asm punpckldq xmm0, xmm0 /* UVUVUVUV (upsample) */ \ + __asm punpcklbw xmm0, xmm1 /* UV */ \ + __asm punpcklwd xmm0, xmm0 /* UVUV (upsample) */ \ + __asm punpckldq xmm0, xmm0 /* UVUVUVUV (upsample) */ \ } // Read 4 UV from NV12, upsample to 8 UV.