emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114452: * data.c (POPCOUNT_STATIC_INLINE): New macr


From: Paul Eggert
Subject: [Emacs-diffs] trunk r114452: * data.c (POPCOUNT_STATIC_INLINE): New macro, as a hack for popcount.
Date: Tue, 24 Sep 2013 14:53:56 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114452
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Tue 2013-09-24 07:53:49 -0700
message:
  * data.c (POPCOUNT_STATIC_INLINE): New macro, as a hack for popcount.
  
  This is ugly, but it should fix the performance problem for older
  GCC versions in the short run.  I'll look into integrating the
  Gnulib module for popcount, as a better fix.
  See the thread starting in:
  http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00474.html
  (popcount_size_t_generic) [NEED_GENERIC_POPCOUNT]:
  (popcount_size_t_msc) [USE_MSC_POPCOUNT]:
  (popcount_size_t_gcc) [USE_GCC_POPCOUNT]:
  (popcount_size_t): Use it.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/data.c                     data.c-20091113204419-o5vbwnq5f7feedwu-251
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-09-24 11:48:53 +0000
+++ b/src/ChangeLog     2013-09-24 14:53:49 +0000
@@ -1,3 +1,16 @@
+2013-09-24  Paul Eggert  <address@hidden>
+
+       * data.c (POPCOUNT_STATIC_INLINE): New macro, as a hack for popcount.
+       This is ugly, but it should fix the performance problem for older
+       GCC versions in the short run.  I'll look into integrating the
+       Gnulib module for popcount, as a better fix.
+       See the thread starting in:
+       http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00474.html
+       (popcount_size_t_generic) [NEED_GENERIC_POPCOUNT]:
+       (popcount_size_t_msc) [USE_MSC_POPCOUNT]:
+       (popcount_size_t_gcc) [USE_GCC_POPCOUNT]:
+       (popcount_size_t): Use it.
+
 2013-09-24  Daniel Colascione  <address@hidden>
 
        * process.c (Fnetwork_interface_info): Fix build break due to

=== modified file 'src/data.c'
--- a/src/data.c        2013-09-24 04:28:06 +0000
+++ b/src/data.c        2013-09-24 14:53:49 +0000
@@ -2972,18 +2972,25 @@
 
 #if _MSC_VER >= 1500 && (defined _M_IX86 || defined _M_X64)
 # define USE_MSC_POPCOUNT
+# define POPCOUNT_STATIC_INLINE static inline
 #elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
 # define USE_GCC_POPCOUNT
+# if 199901L <= __STDC_VERSION__ || !__STRICT_ANSI__
+#  define POPCOUNT_STATIC_INLINE static inline
+# endif
 #else
 # define NEED_GENERIC_POPCOUNT
 #endif
+#ifndef POPCOUNT_STATIC_INLINE
+# define POPCOUNT_STATIC_INLINE static
+#endif
 
 #ifdef USE_MSC_POPCOUNT
-#define NEED_GENERIC_POPCOUNT
+# define NEED_GENERIC_POPCOUNT
 #endif
 
 #ifdef NEED_GENERIC_POPCOUNT
-static unsigned int
+POPCOUNT_STATIC_INLINE unsigned int
 popcount_size_t_generic (size_t val)
 {
     unsigned short j;
@@ -2997,7 +3004,7 @@
 #endif
 
 #ifdef USE_MSC_POPCOUNT
-static unsigned int
+POPCOUNT_STATIC_INLINE unsigned int
 popcount_size_t_msc (size_t val)
 {
   unsigned int count;
@@ -3042,7 +3049,7 @@
 #endif /* USE_MSC_POPCOUNT */
 
 #ifdef USE_GCC_POPCOUNT
-static unsigned int
+POPCOUNT_STATIC_INLINE unsigned int
 popcount_size_t_gcc (size_t val)
 {
 # if BITS_PER_SIZE_T == 64
@@ -3053,7 +3060,7 @@
 }
 #endif /* USE_GCC_POPCOUNT */
 
-static unsigned int
+POPCOUNT_STATIC_INLINE unsigned int
 popcount_size_t (size_t val)
 {
 #if defined USE_MSC_POPCOUNT


reply via email to

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