emacs-devel
[Top][All Lists]
Advanced

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

USE_LSB_TAG and Solaris 10


From: Paul Eggert
Subject: USE_LSB_TAG and Solaris 10
Date: Mon, 17 Jan 2011 21:04:27 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

Stefan suggested that I look into why USE_LSB_TAG wasn't used
with Sun cc, or on Solaris 10.

It turns out that Sun cc now supports __attribute__ ((__aligned__ (E)))
a la GCC.  Also, Solaris 10 malloc (which GCC uses) aligns to 8.
So I installed this performance improvement into the trunk.

=== modified file 'ChangeLog'
--- ChangeLog   2011-01-17 19:20:37 +0000
+++ ChangeLog   2011-01-18 04:54:43 +0000
@@ -1,3 +1,10 @@
+2011-01-18  Paul Eggert  <address@hidden>
+
+       * configure.in (HAVE_ATTRIBUTE_ALIGNED): Arrange for this to be
+       defined if the compiler supports GCC-style __attribute__
+       ((__aligned__ ...)).  IBM AIX and Oracle Solaris Studio support
+       this syntax.
+
 2011-01-17  Paul Eggert  <address@hidden>
 
        Makefile.in: tidy up the building of lib

=== modified file 'configure.in'
--- configure.in        2011-01-17 19:01:01 +0000
+++ configure.in        2011-01-18 04:54:43 +0000
@@ -1323,6 +1323,19 @@
 dnl Check for endianess
 AC_C_BIGENDIAN
 
+AC_CACHE_CHECK([for  __attribute__ ((__aligned__ (expr)))],
+  [emacs_cv_attribute_aligned],
+  [AC_COMPILE_IFELSE(
+     [AC_LANG_PROGRAM(
+       [[char __attribute__ ((__aligned__ (1 << 3))) c;]],
+       [[]])],
+     [emacs_cv_attribute_aligned=yes],
+     [emacs_cv_attribute_aligned=no])])
+if test $emacs_cv_attribute_aligned = yes; then
+  AC_DEFINE([HAVE_ATTRIBUTE_ALIGNED], 1,
+    [Define to 1 if GCC-style __attribute__ ((__aligned__ (expr))) works.])
+fi
+
 dnl check for Make feature
 AC_PROG_MAKE_SET
 
@@ -3734,4 +3747,3 @@
 fi
 
 ], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPPFLAGS="$CPPFLAGS"])
-

=== modified file 'src/ChangeLog'
--- src/ChangeLog       2011-01-18 02:49:59 +0000
+++ src/ChangeLog       2011-01-18 04:54:43 +0000
@@ -1,3 +1,11 @@
+2011-01-18  Paul Eggert  <address@hidden>
+
+       * lisp.h (DECL_ALIGN): Define if HAVE_ATTRIBUTE_ALIGNED, not if
+       defined __GNUC__.  ../configure now checks for this GCC feature,
+       which is now also supported by IBM and Oracle compilers.
+       (USE_LSB_TAG) [defined DECL_ALIGN]: Also define if defined __sun,
+       since Solaris malloc returns mult-of-8.
+
 2011-01-18  Stefan Monnier  <address@hidden>
 
        * image.c (syms_of_image): Don't access XSYMBOL's internals directly.

=== modified file 'src/lisp.h'
--- src/lisp.h  2011-01-17 19:24:36 +0000
+++ src/lisp.h  2011-01-18 04:54:43 +0000
@@ -122,16 +122,18 @@
    TYPEBITS-aligned. */
 #ifndef NO_DECL_ALIGN
 # ifndef DECL_ALIGN
-/* What compiler directive should we use for non-gcc compilers?  -stef  */
-#  if defined (__GNUC__)
+#  if HAVE_ATTRIBUTE_ALIGNED
 #   define DECL_ALIGN(type, var) \
      type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var
+#  else
+     /* What directives do other compilers use?  */
 #  endif
 # endif
 #endif
 
 /* Let's USE_LSB_TAG on systems where we know malloc returns mult-of-8.  */
-#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || 
defined DARWIN_OS
+#if (defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ \
+     || defined DARWIN_OS || defined __sun)
 /* We also need to be able to specify mult-of-8 alignment on static vars.  */
 # if defined DECL_ALIGN
 #  define USE_LSB_TAG




reply via email to

[Prev in Thread] Current Thread [Next in Thread]