From c67db6053495a2744511a43ba7b6ba3fa49b26a5 Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Thu, 21 Dec 2017 11:04:15 -0800 Subject: [PATCH] HalfFloat_SSE2 use movd from memory pshufd requires 16 byte aligned memory or a register. Use movd to a register to avoid a segfault if memory for float is misaligned Bug: libyuv:759 Test: 32 bit build of LibYUVPlanarTest.TestHalfFloatPlane_16bit_denormal Change-Id: I6fdcc4317453af5acd4700f9d46425bb2f4a205b Reviewed-on: https://chromium-review.googlesource.com/840459 Reviewed-by: Miguel Casas Reviewed-by: Frank Barchard Commit-Queue: Frank Barchard --- README.chromium | 2 +- include/libyuv/version.h | 2 +- source/row_gcc.cc | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.chromium b/README.chromium index abd0e7d9c..d90c04228 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1684 +Version: 1685 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 68919b202..3e11fd6c4 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1684 +#define LIBYUV_VERSION 1685 #endif // INCLUDE_LIBYUV_VERSION_H_ diff --git a/source/row_gcc.cc b/source/row_gcc.cc index d322c7b8b..70f72b207 100644 --- a/source/row_gcc.cc +++ b/source/row_gcc.cc @@ -5910,7 +5910,8 @@ static float kScaleBias = 1.9259299444e-34f; void HalfFloatRow_SSE2(const uint16* src, uint16* dst, float scale, int width) { scale *= kScaleBias; asm volatile ( - "pshufd $0x0,%3,%%xmm4 \n" + "movd %3,%%xmm4 \n" + "pshufd $0x0,%%xmm4,%%xmm4 \n" "pxor %%xmm5,%%xmm5 \n" "sub %0,%1 \n" @@ -5935,11 +5936,7 @@ void HalfFloatRow_SSE2(const uint16* src, uint16* dst, float scale, int width) { : "+r"(src), // %0 "+r"(dst), // %1 "+r"(width) // %2 -#if defined(__x86_64__) - : "x"(scale) // %3 -#else : "m"(scale) // %3 -#endif : "memory", "cc", "xmm2", "xmm3", "xmm4", "xmm5" );