all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: emacs-devel@gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: USE_LSB_TAG and Solaris 10
Date: Mon, 17 Jan 2011 21:04:27 -0800	[thread overview]
Message-ID: <4D351F5B.4010001@cs.ucla.edu> (raw)
In-Reply-To: <jwvbp3fql3p.fsf-monnier+emacs@gnu.org>

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  <eggert@cs.ucla.edu>
+
+	* 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  <eggert@cs.ucla.edu>
 
 	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  <eggert@cs.ucla.edu>
+
+	* 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  <monnier@iro.umontreal.ca>
 
 	* 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	other threads:[~2011-01-18  5:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1PekHk-0001J5-48@internal.in.savannah.gnu.org>
     [not found] ` <jwvsjwrqqpz.fsf-monnier+emacs@gnu.org>
     [not found]   ` <4D34A57E.4080809@cs.ucla.edu>
     [not found]     ` <jwvbp3fql3p.fsf-monnier+emacs@gnu.org>
2011-01-18  5:04       ` Paul Eggert [this message]
2011-01-18 15:04         ` USE_LSB_TAG and Solaris 10 Eli Zaretskii
2011-01-18 18:25           ` Paul Eggert
2011-01-18 22:55             ` Eli Zaretskii
2011-01-19 14:48             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D351F5B.4010001@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.