Commit 94c669448a2bd4ff421c1a585f21f18af49b09b8

Chongyu Zhu 2014-01-08T08:52:59

[arm] Fix Savannah bug #41138, part 2. * builds/unix/ftconfig.in (FT_MulFix_arm), include/config/ftconfig.h (FT_MulFix_arm), src/truetype/ttinterp.c (TT_MulFix14_arm): Fix preprocessor conditionals for `add.w'.

diff --git a/ChangeLog b/ChangeLog
index 67c6194..5f1b1b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-01-08  Chongyu Zhu  <lembacon@gmail.com>
+
+	[arm] Fix Savannah bug #41138, part 2.
+
+	* builds/unix/ftconfig.in (FT_MulFix_arm), include/config/ftconfig.h
+	(FT_MulFix_arm), src/truetype/ttinterp.c (TT_MulFix14_arm): Fix
+	preprocessor conditionals for `add.w'.
+
 2014-01-08  Werner Lemberg  <wl@gnu.org>
 
 	[autofit] Fix Savannah bug #41138, part 1.
diff --git a/builds/unix/ftconfig.in b/builds/unix/ftconfig.in
index ddaea25..2cf6708 100644
--- a/builds/unix/ftconfig.in
+++ b/builds/unix/ftconfig.in
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    UNIX-specific configuration file (specification only).               */
 /*                                                                         */
-/*  Copyright 1996-2004, 2006-2009, 2011, 2013 by                          */
+/*  Copyright 1996-2004, 2006-2009, 2011, 2013, 2014 by                    */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -419,7 +419,7 @@ FT_BEGIN_HEADER
     __asm__ __volatile__ (
       "smull  %1, %2, %4, %3\n\t"       /* (lo=%1,hi=%2) = a*b */
       "mov    %0, %2, asr #31\n\t"      /* %0  = (hi >> 31) */
-#ifdef __clang__
+#if defined( __clang__ ) && defined( __thumb2__ )
       "add.w  %0, %0, #0x8000\n\t"      /* %0 += 0x8000 */
 #else
       "add    %0, %0, #0x8000\n\t"      /* %0 += 0x8000 */
diff --git a/include/config/ftconfig.h b/include/config/ftconfig.h
index 0770e78..d98a311 100644
--- a/include/config/ftconfig.h
+++ b/include/config/ftconfig.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    ANSI-specific configuration file (specification only).               */
 /*                                                                         */
-/*  Copyright 1996-2004, 2006-2008, 2010-2011, 2013 by                     */
+/*  Copyright 1996-2004, 2006-2008, 2010-2011, 2013, 2014 by               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -386,7 +386,7 @@ FT_BEGIN_HEADER
     __asm__ __volatile__ (
       "smull  %1, %2, %4, %3\n\t"       /* (lo=%1,hi=%2) = a*b */
       "mov    %0, %2, asr #31\n\t"      /* %0  = (hi >> 31) */
-#ifdef __clang__
+#if defined( __clang__ ) && defined( __thumb2__ )
       "add.w  %0, %0, #0x8000\n\t"      /* %0 += 0x8000 */
 #else
       "add    %0, %0, #0x8000\n\t"      /* %0 += 0x8000 */
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 4c384ec..4ea1d33 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType bytecode interpreter (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2013                                                    */
+/*  Copyright 1996-2014                                                    */
 /*  by David Turner, Robert Wilhelm, and Werner Lemberg.                   */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -1470,7 +1470,7 @@
     __asm__ __volatile__ (
       "smull  %1, %2, %4, %3\n\t"       /* (lo=%1,hi=%2) = a*b */
       "mov    %0, %2, asr #31\n\t"      /* %0  = (hi >> 31) */
-#ifdef __clang__
+#if defined( __clang__ ) && defined( __thumb2__ )
       "add.w  %0, %0, #0x2000\n\t"      /* %0 += 0x2000 */
 #else
       "add    %0, %0, #0x2000\n\t"      /* %0 += 0x2000 */