This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch rsa/hwcap2_v3 updated. glibc-2.17-673-gd0f0333


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, rsa/hwcap2_v3 has been updated
       via  d0f03338fd8c314f865b4421b99efd69725ca063 (commit)
      from  6d6691c0f4a53c0e1c1915e19e71544c6b55b491 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d0f03338fd8c314f865b4421b99efd69725ca063

commit d0f03338fd8c314f865b4421b99efd69725ca063
Author: Ryan S. Arnold <rsa@linux.vnet.ibm.com>
Date:   Wed May 15 15:48:17 2013 -0500

    PowerPC: Fix AT_HWCAP2 feature bit string output in _dl_procinfo.

diff --git a/ChangeLog b/ChangeLog
index cc1b0d3..17911d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2013-05-14  Ryan S. Arnold  <rsa@linux.vnet.ibm.com>
 
+	* sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Properly
+	placed power8 hwcap strings to fix code that assumed bits incremented
+	from 0 to 31.
+	* sysdeps/powerpc/dl-procinfo.h (_dl_procinfo): Eliminate confusing
+	conditional variable definitions used to re-use a single loop
+	definition.  Replace with simpler redundant loops.  Account for
+	AT_HWCAP2 feature bits starting at bit 31 and decrementing.
+	[_DL_HWCAP_LAST]: New definition.
+	[_DL_HWCAP2_LAST]: New definition.
+	[_DL_HWCAP_COUNT]: Update to 64 to account for available bits, not
+	number of actual hwcap bits that are defined.
+
+2013-05-14  Ryan S. Arnold  <rsa@linux.vnet.ibm.com>
+
 	* sysdeps/powerpc/bits/hwcap.h: Add new AT_HWCAP2 features.
 	[PPC_FEATURE2_ARCH_2_07]: New feature bit for Power ISA 2.07.
 	[PPC_FEATURE2_HAS_HTM]: New feature bit for Hardware Transactional
diff --git a/sysdeps/powerpc/dl-procinfo.c b/sysdeps/powerpc/dl-procinfo.c
index 0fbbc80..1c87fb0 100644
--- a/sysdeps/powerpc/dl-procinfo.c
+++ b/sysdeps/powerpc/dl-procinfo.c
@@ -45,18 +45,25 @@
 #if !defined PROCINFO_DECL && defined SHARED
   ._dl_powerpc_cap_flags
 #else
-PROCINFO_CLASS const char _dl_powerpc_cap_flags[31][10]
+PROCINFO_CLASS const char _dl_powerpc_cap_flags[57][10]
 #endif
 #ifndef PROCINFO_DECL
 = {
-    "ebb", "isel", "tar",
-    "vsx", "arch_2_07", "htm", "dscr",
+    "vsx",
     "arch_2_06", "power6x", "dfp", "pa6t",
     "arch_2_05", "ic_snoop", "smt", "booke",
     "cellbe", "power5+", "power5", "power4",
     "notb", "efpdouble", "efpsingle", "spe",
     "ucache", "4xxmac", "mmu", "fpu",
     "altivec", "ppc601", "ppc64", "ppc32",
+    "", "", "", "",
+    "", "", "", "",
+    "", "", "", "",
+    "", "", "", "",
+    "", "", "", "",
+    "", "", "", "",
+    "", "", "tar", "isel",
+    "ebb", "dscr", "htm", "arch_2_07",
   }
 #endif
 #if !defined SHARED || defined PROCINFO_DECL
diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index 3a5ce12..d9cd126 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -22,13 +22,18 @@
 #include <ldsodefs.h>
 #include <sysdep.h>	/* This defines the PPC_FEATURE[2]_* macros.  */
 
-/* There are 25 bits used in AT_HWCAP, but they are bits 7..31.  */
+/* There are 25 bits used in AT_HWCAP, but they are bits 7..31.  The feature
+ * definitions started at bit 31 and decremented as new features were added.
+ */
+#define _DL_HWCAP_LAST		31
 #define _DL_HWCAP_FIRST		7
-/* Where AT_HWCAP2 starts relative to _DL_HWCAP_FIRST.  */
-#define _DL_HWCAP2_FIRST	32
 
-/* The total number of used bits relative to _DL_HWCAP_FIRST.  */
-#define _DL_HWCAP_COUNT		38
+/* AT_HWCAP2 feature bits similarily started at bit 31 and decremented as new
+ * features were added.  */
+#define _DL_HWCAP2_LAST		31
+
+/* The total number of available bits relative to (minus) _DL_HWCAP_FIRST.  */
+#define _DL_HWCAP_COUNT		64
 
 /* These bits influence library search.  */
 #define HWCAP_IMPORTANT		(PPC_FEATURE_HAS_ALTIVEC \
@@ -166,31 +171,31 @@ static inline int
 __attribute__ ((unused))
 _dl_procinfo (unsigned int type, int word)
 {
-  unsigned int first, count, str_offset;
-
   switch(type)
     {
     case AT_HWCAP:
       _dl_printf ("AT_HWCAP:       ");
-      first = _DL_HWCAP_FIRST;
-      count = MIN(_DL_HWCAP_COUNT, _DL_HWCAP2_FIRST);
-      str_offset = 0;
+
+      for (int i = _DL_HWCAP_FIRST; i <= _DL_HWCAP_LAST; ++i)
+	if (word & (1 << i))
+	  _dl_printf (" %s", _dl_hwcap_string (i));
       break;
     case AT_HWCAP2:
-      _dl_printf ("AT_HWCAP2:      ");
-      first = 0;
-      count = _DL_HWCAP_COUNT - _DL_HWCAP2_FIRST;
-      str_offset = _DL_HWCAP2_FIRST;
-      break;
+      {
+	unsigned int offset = _DL_HWCAP_LAST + 1;
+
+	_dl_printf ("AT_HWCAP2:      ");
+
+	for (int i = 0; i <= _DL_HWCAP2_LAST; ++i)
+	  if (word & (1 << i))
+	    _dl_printf (" %s", _dl_hwcap_string (offset + i));
+	break;
+      }
     default:
       /* This should not happen.  */
       return -1;
     }
 
-  for (int i = first; i < count; ++i)
-    if (word & (1 << i))
-      _dl_printf (" %s", _dl_hwcap_string (str_offset + i));
-
   _dl_printf ("\n");
 
   return 0;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                     |   14 +++++++++++++
 sysdeps/powerpc/dl-procinfo.c |   13 +++++++++--
 sysdeps/powerpc/dl-procinfo.h |   43 ++++++++++++++++++++++------------------
 3 files changed, 48 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]