incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r1189933 - in /incubator/ooo/trunk/main: configure.in sal/osl/unx/interlck.c set_soenv.in solenv/inc/unxlngr.mk
Date Thu, 27 Oct 2011 18:54:01 GMT
Author: pfg
Date: Thu Oct 27 18:54:01 2011
New Revision: 1189933

URL: http://svn.apache.org/viewvc?rev=1189933&view=rev
Log:
i117017 - ARM optimization for armv6/armv7

Modified:
    incubator/ooo/trunk/main/configure.in
    incubator/ooo/trunk/main/sal/osl/unx/interlck.c
    incubator/ooo/trunk/main/set_soenv.in
    incubator/ooo/trunk/main/solenv/inc/unxlngr.mk

Modified: incubator/ooo/trunk/main/configure.in
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/configure.in?rev=1189933&r1=1189932&r2=1189933&view=diff
==============================================================================
--- incubator/ooo/trunk/main/configure.in (original)
+++ incubator/ooo/trunk/main/configure.in Thu Oct 27 18:54:01 2011
@@ -852,6 +852,16 @@ AC_ARG_ENABLE(dependency-tracking,
 AC_ARG_ENABLE(copyleft,
 [  --enable-copyleft      Whether to use copyleft components.
 ],,)
+AC_ARG_WITH(arm-target,
+[  --arm-target        The minimal targeted arm processor
+                          used for the build environment.
+                          Cases :
+                            arm-target < 6 : armv4t compatibility
+                            arm-target = 6 : exact armv6 compatibility
+                    	    arm-target > 6 : armv7-a compatibility
+
+                          Usage: --with-arm-target=7
+],with_arm_target=$withval,with_arm_target=4)
 
 BUILD_TYPE="OOo"
 
@@ -5857,6 +5867,24 @@ AC_SUBST(ENABLE_GSTREAMER)
 AC_SUBST(GSTREAMER_CFLAGS)
 AC_SUBST(GSTREAMER_LIBS)
 
+dnl ===================================================================
+dnl Check the ARM target
+dnl ===================================================================
+
+if test "$_os" = "Linux" && echo "$build_cpu" | $GREP -q arm; then
+    # default value
+    ARM_TARGET=ARMV4T
+    AC_MSG_CHECKING([which ARM processor optimization to use])
+    if test "$with_arm_target" -lt "6"; then
+	ARM_TARGET=ARMV4T
+    elif test "$with_arm_target" = "6"; then
+	ARM_TARGET=ARMV6
+    elif test "$with_arm_target" -gt "6"; then
+	ARM_TARGET=ARMV7
+    fi
+    AC_MSG_RESULT([$ARM_TARGET])
+    AC_SUBST(ARM_TARGET)
+fi
 
 dnl ===================================================================
 dnl Check whether the Cairo libraries are available.

Modified: incubator/ooo/trunk/main/sal/osl/unx/interlck.c
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sal/osl/unx/interlck.c?rev=1189933&r1=1189932&r2=1189933&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sal/osl/unx/interlck.c (original)
+++ incubator/ooo/trunk/main/sal/osl/unx/interlck.c Thu Oct 27 18:54:01 2011
@@ -134,6 +134,54 @@ oslInterlockedCount SAL_CALL osl_decreme
     return nCount;
 }
 
+#elif defined ( GCC ) && defined ( ARM )
+
+/*****************************************************************************/
+/* osl_incrementInterlockedCount */
+/*****************************************************************************/
+oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* pCount)
+{
+#if defined( ARMV7 ) || defined( ARMV6 )
+    register oslInterlockedCount nCount __asm__ ("r1");
+    int nResult;
+
+    __asm__ __volatile__ (
+"1:	ldrex %0, [%3]\n"
+"	add %0, %0, #1\n"
+"	strex %1, %0, [%3]\n"
+"	teq %1, #0\n"
+"	bne 1b"
+        : "=&r" (nCount), "=&r" (nResult), "=m" (*pCount)
+        : "r" (pCount)
+        : "memory");
+
+    return nCount;
+#else
+    return __sync_add_and_fetch( pCount, 1 );
+#endif
+}
+
+oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* pCount)
+{
+#if defined( ARMV7 ) || defined( ARMV6 )
+    register oslInterlockedCount nCount __asm__ ("r1");
+    int nResult;
+
+    __asm__ __volatile__ (
+"0:	ldrex %0, [%3]\n"
+"	sub %0, %0, #1\n"
+"	strex %1, %0, [%3]\n"
+"	teq %1, #0\n"
+"	bne 0b"
+        : "=&r" (nCount), "=&r" (nResult), "=m" (*pCount)
+        : "r" (pCount)
+        : "memory");
+    return nCount;
+#else
+    return __sync_sub_and_fetch( pCount, 1 );
+#endif
+}
+
 #else
 /* use only if nothing else works, expensive due to single mutex for all reference counts
*/
 

Modified: incubator/ooo/trunk/main/set_soenv.in
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/set_soenv.in?rev=1189933&r1=1189932&r2=1189933&view=diff
==============================================================================
--- incubator/ooo/trunk/main/set_soenv.in (original)
+++ incubator/ooo/trunk/main/set_soenv.in Thu Oct 27 18:54:01 2011
@@ -1709,6 +1709,7 @@ ToFile( "DYNAMIC_CRT",       $DYNAMIC_CR
 ToFile( "SET_EXCEPTIONS",    $SET_EXCEPTIONS,    "e" );
 ToFile( "use_shl_versions",  $use_shl_versions,  "e" );
 ToFile( "FLIPCMD",           $FLIPCMD,           "e" );
+ToFile( "ARM_TARGET",        "@ARM_TARGET@",     "e" );
 if ( $platform =~ m/darwin/ )
 {
 # MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build,

Modified: incubator/ooo/trunk/main/solenv/inc/unxlngr.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/solenv/inc/unxlngr.mk?rev=1189933&r1=1189932&r2=1189933&view=diff
==============================================================================
--- incubator/ooo/trunk/main/solenv/inc/unxlngr.mk (original)
+++ incubator/ooo/trunk/main/solenv/inc/unxlngr.mk Thu Oct 27 18:54:01 2011
@@ -32,3 +32,19 @@ CDEFAULTOPT=-Os
 CDEFS+=-DARM32
 CFLAGS+=-fno-omit-frame-pointer
 DLLPOSTFIX=
+
+.IF "$(ARM_TARGET)" == "ARMV4T"
+ARCH_FLAGS+=-march=armv4t
+CDEFS+=-DARMV4T
+.ENDIF
+
+.IF "$(ARM_TARGET)" == "ARMV6"
+ARCH_FLAGS+=-march=armv6
+CDEFS+=-DARMV6
+.ENDIF
+
+.IF "$(ARM_TARGET)" == "ARMV7"
+ARCH_FLAGS+=-march=armv7-a -mtune=cortex-a8 -mfpu=neon
+CDEFS+=-DARMV7
+.ENDIF
+



Mime
View raw message