emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r102888: Improve performance on non-G


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102888: Improve performance on non-GCC hosts with __aligned__.
Date: Mon, 17 Jan 2011 20:55:12 -0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102888 [merge]
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Mon 2011-01-17 20:55:12 -0800
message:
  Improve performance on non-GCC hosts with __aligned__.
modified:
  ChangeLog
  configure
  configure.in
  src/ChangeLog
  src/config.in
  src/lisp.h
=== modified file 'ChangeLog'
--- a/ChangeLog 2011-01-17 19:20:37 +0000
+++ b/ChangeLog 2011-01-18 04:54:23 +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'
--- a/configure 2011-01-17 19:01:01 +0000
+++ b/configure 2011-01-18 04:54:23 +0000
@@ -8278,6 +8278,37 @@
  esac
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for  __attribute__ 
((__aligned__ (expr)))" >&5
+$as_echo_n "checking for  __attribute__ ((__aligned__ (expr)))... " >&6; }
+if ${emacs_cv_attribute_aligned+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+char __attribute__ ((__aligned__ (1 << 3))) c;
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  emacs_cv_attribute_aligned=yes
+else
+  emacs_cv_attribute_aligned=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_attribute_aligned" 
>&5
+$as_echo "$emacs_cv_attribute_aligned" >&6; }
+if test $emacs_cv_attribute_aligned = yes; then
+
+$as_echo "#define HAVE_ATTRIBUTE_ALIGNED 1" >>confdefs.h
+
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets 
\$(MAKE)" >&5
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
@@ -18959,4 +18990,3 @@
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
-

=== modified file 'configure.in'
--- a/configure.in      2011-01-17 19:01:01 +0000
+++ b/configure.in      2011-01-18 04:54:23 +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'
--- a/src/ChangeLog     2011-01-18 02:49:59 +0000
+++ b/src/ChangeLog     2011-01-18 04:54:23 +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/config.in'
--- a/src/config.in     2011-01-17 19:01:01 +0000
+++ b/src/config.in     2011-01-18 04:54:23 +0000
@@ -115,6 +115,9 @@
 /* Define to 1 if ALSA is available. */
 #undef HAVE_ALSA
 
+/* Define to 1 if GCC-style __attribute__ ((__aligned__ (expr))) works. */
+#undef HAVE_ATTRIBUTE_ALIGNED
+
 /* Define to 1 if strtold conforms to C99. */
 #undef HAVE_C99_STRTOLD
 

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2011-01-17 19:24:36 +0000
+++ b/src/lisp.h        2011-01-18 04:54:23 +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]