From f8ee67edb8e5fed34bf4d5208bce89ea8be1ac1e Mon Sep 17 00:00:00 2001 From: "marco.diiga" Date: Mon, 21 Mar 2016 06:04:43 -0700 Subject: [PATCH] Fix for unaligned automatic variable address in SSE routines. This used to work on linux but crashed on windows when rendering antialiased glyphs. I tracked the problem down to an alignment issue. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817813002 Review URL: https://codereview.chromium.org/1817813002 --- AUTHORS | 1 + src/opts/SkOpts_sse41.cpp | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 4b3c09e..893569c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -39,3 +39,4 @@ Thiago Fransosi Farina Jose Mayol Linaro <*@linaro.org> Christian Plesner Hansen +Marco Alesiani \ No newline at end of file diff --git a/src/opts/SkOpts_sse41.cpp b/src/opts/SkOpts_sse41.cpp index f097e56..7a76081 100644 --- a/src/opts/SkOpts_sse41.cpp +++ b/src/opts/SkOpts_sse41.cpp @@ -50,8 +50,7 @@ static m64i next1(const uint32_t*& ptr) { // xyzw -> xxxx yyyy zzzz wwww static __m128i replicate_coverage(__m128i xyzw) { - const uint8_t mask[] = { 0,0,0,0, 1,1,1,1, 2,2,2,2, 3,3,3,3 }; - return _mm_shuffle_epi8(xyzw, _mm_load_si128((const __m128i*)mask)); + return _mm_shuffle_epi8(xyzw, _mm_setr_epi8(0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3)); } static __m128i next4(const uint8_t*& ptr) { -- 2.7.4