[babl] GCC+Win32: Ensure stack alignment in SSE code



commit 18e37b1952f24c1d61b48e0ca79c33b7b253cd71
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Mon Jun 17 21:33:49 2013 -0700

    GCC+Win32: Ensure stack alignment in SSE code
    
    Without this option GCC will generate bad code that attempts to
    push SSE variables onto an unaligned stack.

 configure.ac |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2ddb3a5..98dbe5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -316,7 +316,10 @@ if test "x$enable_mmx" = xyes; then
 
     if test "x$enable_sse" = xyes; then
       BABL_DETECT_CFLAGS(fpmath_flag, '-mfpmath=sse')
-      SSE_EXTRA_CFLAGS="$MMX_EXTRA_CFLAGS $fpmath_flag"
+      if test "x$platform_win32" = xyes; then
+        BABL_DETECT_CFLAGS(stack_align, '-mstackrealign')
+      fi
+      SSE_EXTRA_CFLAGS="$MMX_EXTRA_CFLAGS $stack_align $fpmath_flag"
       
       BABL_DETECT_CFLAGS(sse_flag, '-msse')
       SSE_EXTRA_CFLAGS="$SSE_EXTRA_CFLAGS $sse_flag"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]