From 46f0707481d50950fdb5d4588486affef0baa9ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Wed, 13 May 2009 10:32:36 -0400 Subject: [PATCH] Move gcc alignment workaround to pixman-sse2.c --- pixman/pixman-general.c | 20 -------------------- pixman/pixman-sse2.c | 44 +++++++++++++++++++++++++++++--------------- pixman/pixman-sse2.h | 4 ---- 3 files changed, 29 insertions(+), 39 deletions(-) diff --git a/pixman/pixman-general.c b/pixman/pixman-general.c index 554a351..825dc3b 100644 --- a/pixman/pixman-general.c +++ b/pixman/pixman-general.c @@ -327,26 +327,6 @@ pixman_image_composite_rect (pixman_implementation_t *imp, general_composite_rect (imp, &compose_data); } -#if defined(USE_SSE2) && defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) - -/* - * Work around GCC bug causing crashes in Mozilla with SSE2 - * - * When using SSE2 intrinsics, gcc assumes that the stack is 16 byte - * aligned. Unfortunately some code, such as Mozilla and Mono contain - * code that aligns the stack to 4 bytes. - * - * The __force_align_arg_pointer__ makes gcc generate a prologue that - * realigns the stack pointer to 16 bytes. - * - * On x86-64 this is not necessary because the standard ABI already - * calls for a 16 byte aligned stack. - * - * See https://bugs.freedesktop.org/show_bug.cgi?id=15693 - */ - -__attribute__((__force_align_arg_pointer__)) -#endif static void general_composite (pixman_implementation_t * imp, pixman_op_t op, diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c index 36b6055..c3a3064 100644 --- a/pixman/pixman-sse2.c +++ b/pixman/pixman-sse2.c @@ -4863,7 +4863,7 @@ fbCompositeOver_x888x8x8888sse2 (pixman_implementation_t *imp, } #endif -static const FastPathInfo sse2_fast_path_array[] = +static const FastPathInfo sse2_fast_paths[] = { { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_r5g6b5, fbCompositeSolidMask_nx8x0565sse2, 0 }, { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_b5g6r5, fbCompositeSolidMask_nx8x0565sse2, 0 }, @@ -4940,22 +4940,36 @@ static const FastPathInfo sse2_fast_path_array[] = { PIXMAN_OP_NONE }, }; -const FastPathInfo *const sse2_fast_paths = sse2_fast_path_array; - +/* + * Work around GCC bug causing crashes in Mozilla with SSE2 + * + * When using SSE2 intrinsics, gcc assumes that the stack is 16 byte + * aligned. Unfortunately some code, such as Mozilla and Mono contain + * code that aligns the stack to 4 bytes. + * + * The __force_align_arg_pointer__ makes gcc generate a prologue that + * realigns the stack pointer to 16 bytes. + * + * On x86-64 this is not necessary because the standard ABI already + * calls for a 16 byte aligned stack. + * + * See https://bugs.freedesktop.org/show_bug.cgi?id=15693 + */ +__attribute__((__force_align_arg_pointer__)) static void sse2_composite (pixman_implementation_t *imp, - pixman_op_t op, - pixman_image_t *src, - pixman_image_t *mask, - pixman_image_t *dest, - int32_t src_x, - int32_t src_y, - int32_t mask_x, - int32_t mask_y, - int32_t dest_x, - int32_t dest_y, - int32_t width, - int32_t height) + pixman_op_t op, + pixman_image_t *src, + pixman_image_t *mask, + pixman_image_t *dest, + int32_t src_x, + int32_t src_y, + int32_t mask_x, + int32_t mask_y, + int32_t dest_x, + int32_t dest_y, + int32_t width, + int32_t height) { if (_pixman_run_fast_path (sse2_fast_paths, imp, op, src, mask, dest, diff --git a/pixman/pixman-sse2.h b/pixman/pixman-sse2.h index 417e31d..dff5d4b 100644 --- a/pixman/pixman-sse2.h +++ b/pixman/pixman-sse2.h @@ -49,10 +49,6 @@ pixman_bool_t pixman_have_sse2(void); #ifdef USE_SSE2 -extern const FastPathInfo *const sse2_fast_paths; - -void fbComposeSetupSSE2(void); - pixman_bool_t pixmanFillsse2 (uint32_t *bits, int stride, -- 2.7.4