aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog13
-rw-r--r--src/data.c17
2 files changed, 25 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 82517661164..90ffce575f9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,16 @@
12013-09-24 Paul Eggert <eggert@cs.ucla.edu>
2
3 * data.c (POPCOUNT_STATIC_INLINE): New macro, as a hack for popcount.
4 This is ugly, but it should fix the performance problem for older
5 GCC versions in the short run. I'll look into integrating the
6 Gnulib module for popcount, as a better fix.
7 See the thread starting in:
8 http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00474.html
9 (popcount_size_t_generic) [NEED_GENERIC_POPCOUNT]:
10 (popcount_size_t_msc) [USE_MSC_POPCOUNT]:
11 (popcount_size_t_gcc) [USE_GCC_POPCOUNT]:
12 (popcount_size_t): Use it.
13
12013-09-24 Daniel Colascione <dancol@dancol.org> 142013-09-24 Daniel Colascione <dancol@dancol.org>
2 15
3 * process.c (Fnetwork_interface_info): Fix build break due to 16 * process.c (Fnetwork_interface_info): Fix build break due to
diff --git a/src/data.c b/src/data.c
index 82cfd74cd0f..79679bae444 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2972,18 +2972,25 @@ bool_vector_spare_mask (ptrdiff_t nr_bits)
2972 2972
2973#if _MSC_VER >= 1500 && (defined _M_IX86 || defined _M_X64) 2973#if _MSC_VER >= 1500 && (defined _M_IX86 || defined _M_X64)
2974# define USE_MSC_POPCOUNT 2974# define USE_MSC_POPCOUNT
2975# define POPCOUNT_STATIC_INLINE static inline
2975#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) 2976#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
2976# define USE_GCC_POPCOUNT 2977# define USE_GCC_POPCOUNT
2978# if 199901L <= __STDC_VERSION__ || !__STRICT_ANSI__
2979# define POPCOUNT_STATIC_INLINE static inline
2980# endif
2977#else 2981#else
2978# define NEED_GENERIC_POPCOUNT 2982# define NEED_GENERIC_POPCOUNT
2979#endif 2983#endif
2984#ifndef POPCOUNT_STATIC_INLINE
2985# define POPCOUNT_STATIC_INLINE static
2986#endif
2980 2987
2981#ifdef USE_MSC_POPCOUNT 2988#ifdef USE_MSC_POPCOUNT
2982#define NEED_GENERIC_POPCOUNT 2989# define NEED_GENERIC_POPCOUNT
2983#endif 2990#endif
2984 2991
2985#ifdef NEED_GENERIC_POPCOUNT 2992#ifdef NEED_GENERIC_POPCOUNT
2986static unsigned int 2993POPCOUNT_STATIC_INLINE unsigned int
2987popcount_size_t_generic (size_t val) 2994popcount_size_t_generic (size_t val)
2988{ 2995{
2989 unsigned short j; 2996 unsigned short j;
@@ -2997,7 +3004,7 @@ popcount_size_t_generic (size_t val)
2997#endif 3004#endif
2998 3005
2999#ifdef USE_MSC_POPCOUNT 3006#ifdef USE_MSC_POPCOUNT
3000static unsigned int 3007POPCOUNT_STATIC_INLINE unsigned int
3001popcount_size_t_msc (size_t val) 3008popcount_size_t_msc (size_t val)
3002{ 3009{
3003 unsigned int count; 3010 unsigned int count;
@@ -3042,7 +3049,7 @@ popcount_size_t_msc (size_t val)
3042#endif /* USE_MSC_POPCOUNT */ 3049#endif /* USE_MSC_POPCOUNT */
3043 3050
3044#ifdef USE_GCC_POPCOUNT 3051#ifdef USE_GCC_POPCOUNT
3045static unsigned int 3052POPCOUNT_STATIC_INLINE unsigned int
3046popcount_size_t_gcc (size_t val) 3053popcount_size_t_gcc (size_t val)
3047{ 3054{
3048# if BITS_PER_SIZE_T == 64 3055# if BITS_PER_SIZE_T == 64
@@ -3053,7 +3060,7 @@ popcount_size_t_gcc (size_t val)
3053} 3060}
3054#endif /* USE_GCC_POPCOUNT */ 3061#endif /* USE_GCC_POPCOUNT */
3055 3062
3056static unsigned int 3063POPCOUNT_STATIC_INLINE unsigned int
3057popcount_size_t (size_t val) 3064popcount_size_t (size_t val)
3058{ 3065{
3059#if defined USE_MSC_POPCOUNT 3066#if defined USE_MSC_POPCOUNT