]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
PowerPC: Add support for POWER8. rsa/power8
authorRyan S. Arnold <rsa@linux.vnet.ibm.com>
Thu, 16 May 2013 17:12:16 +0000 (12:12 -0500)
committerRyan S. Arnold <rsa@linux.vnet.ibm.com>
Thu, 16 May 2013 17:12:16 +0000 (12:12 -0500)
ChangeLog
sysdeps/powerpc/bits/hwcap.h
sysdeps/powerpc/dl-procinfo.c
sysdeps/powerpc/dl-procinfo.h
sysdeps/powerpc/powerpc32/power8/Implies [new file with mode: 0644]
sysdeps/powerpc/powerpc64/power8/Implies [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/powerpc32/power8/Implies [new file with mode: 0644]
sysdeps/unix/sysv/linux/powerpc/powerpc64/power8/Implies [new file with mode: 0644]

index aa526f8343da79d57fc2863867016af6d1ef6d7e..b08cd20e8f64028a8a9988ca2abbc1255c375a55 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+2013-05-16  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
+       Memory.
+       [PPC_FEATURE2_HAS_DSCR]: New feature bit for Data Stream Control
+       Register.
+       [PPC_FEATURE2_HAS_EBB]: New feature bit for Event Based Branching
+       facility.
+       [PPC_FEATURE2_HAS_ISEL]: New feature bit for Integer Select.
+       [PPC_FEATURE2_HAS_TAR]: New feature bit for Target Address Register
+       facility.
+       * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_platforms): Add power8 as
+       PPC_PLATFORM_POWER8.
+       (_dl_powerpc_cap_flags): Add arch_2_07, htm, dscr, ebb, isel, and tar
+       as hwcap strings for power8.
+       * 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.
+       [_DL_PLATFORMS_COUNT]: Increment for power8.
+       [PPC_PLATFORM_POWER8]: New definition.
+       (_dl_string_platform): Add return value for power8 platform string.
+       * sysdeps/powerpc/powerpc32/power8/Implies: New file.
+       * sysdeps/powerpc/powerpc64/power8/Implies: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/power8/Implies: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/power8/Implies: Likewise.
+
 2013-05-16  Ryan S. Arnold  <rsa@linux.vnet.ibm.com>
 
        * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_platforms): Add ppc405,
index 783138a0e688c47f0ba26fdccfa5ee4a31913f9b..c1d1defd2a2b5c1882682392f3c6629cef87c445 100644 (file)
@@ -20,9 +20,9 @@
 # error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
 #endif
 
-/*
- * The following must match the kernels asm/cputable.h.
- */
+/* The bit numbers must match those in the kernel's asm/cputable.h.  */
+
+/* Feature definitions in AT_HWCAP.  */
 #define PPC_FEATURE_32             0x80000000 /* 32-bit mode. */
 #define PPC_FEATURE_64             0x40000000 /* 64-bit mode. */
 #define PPC_FEATURE_601_INSTR      0x20000000 /* 601 chip, Old POWER ISA.  */
@@ -39,7 +39,7 @@
 #define PPC_FEATURE_POWER5         0x00040000 /* POWER5 ISA 2.02 */
 #define PPC_FEATURE_POWER5_PLUS            0x00020000 /* POWER5+ ISA 2.03 */
 #define PPC_FEATURE_CELL_BE        0x00010000 /* CELL Broadband Engine */
-#define PPC_FEATURE_BOOKE          0x00008000
+#define PPC_FEATURE_BOOKE          0x00008000 /* ISA Category Embedded */
 #define PPC_FEATURE_SMT                    0x00004000 /* Simultaneous Multi-Threading */
 #define PPC_FEATURE_ICACHE_SNOOP    0x00002000
 #define PPC_FEATURE_ARCH_2_05      0x00001000 /* ISA 2.05 */
 #define PPC_FEATURE_PSERIES_PERFMON_COMPAT  0x00000040
 #define PPC_FEATURE_TRUE_LE        0x00000002
 #define PPC_FEATURE_PPC_LE         0x00000001
+
+/* Feature definitions in AT_HWCAP2.  */
+#define PPC_FEATURE2_ARCH_2_07     0x80000000 /* ISA 2.07 */
+#define PPC_FEATURE2_HAS_HTM       0x40000000 /* Hardware Transactional Memory */
+#define PPC_FEATURE2_HAS_DSCR      0x20000000 /* Data Stream Control Register */
+#define PPC_FEATURE2_HAS_EBB       0x10000000 /* Event Base Branching */
+#define PPC_FEATURE2_HAS_ISEL      0x08000000 /* Integer Select */
+#define PPC_FEATURE2_HAS_TAR       0x04000000 /* Target Address Register */
index 0f5c2b3d6d3915f1d2bbdad1d7fe68cc48f018f1..1c87fb00f99add5469a25d0e0a5c19f735472e53 100644 (file)
@@ -45,7 +45,7 @@
 #if !defined PROCINFO_DECL && defined SHARED
   ._dl_powerpc_cap_flags
 #else
-PROCINFO_CLASS const char _dl_powerpc_cap_flags[25][10]
+PROCINFO_CLASS const char _dl_powerpc_cap_flags[57][10]
 #endif
 #ifndef PROCINFO_DECL
 = {
@@ -56,6 +56,14 @@ PROCINFO_CLASS const char _dl_powerpc_cap_flags[25][10]
     "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
@@ -67,7 +75,7 @@ PROCINFO_CLASS const char _dl_powerpc_cap_flags[25][10]
 #if !defined PROCINFO_DECL && defined SHARED
   ._dl_powerpc_platforms
 #else
-PROCINFO_CLASS const char _dl_powerpc_platforms[13][12]
+PROCINFO_CLASS const char _dl_powerpc_platforms[14][12]
 #endif
 #ifndef PROCINFO_DECL
 = {
@@ -83,7 +91,8 @@ PROCINFO_CLASS const char _dl_powerpc_platforms[13][12]
     [PPC_PLATFORM_PPC405] = "ppc405",
     [PPC_PLATFORM_PPC440] = "ppc440",
     [PPC_PLATFORM_PPC464] = "ppc464",
-    [PPC_PLATFORM_PPC476] = "ppc476"
+    [PPC_PLATFORM_PPC476] = "ppc476",
+    [PPC_PLATFORM_POWER8] = "power8"
   }
 #endif
 #if !defined SHARED || defined PROCINFO_DECL
index f24a0c6f112b6dbaabf559caf462ce49fd0bc6dc..d9cd12672293a7f371e1425ffd80175b45eff71a 100644 (file)
 #define _DL_PROCINFO_H 1
 
 #include <ldsodefs.h>
-#include <sysdep.h>    /* This defines the PPC_FEATURE_* macros.  */
+#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
-#define _DL_HWCAP2_FIRST       32
-#define _DL_HWCAP_COUNT                32
+
+/* 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 \
                                + PPC_FEATURE_HAS_DFP)
 
-#define _DL_PLATFORMS_COUNT    13
+#define _DL_PLATFORMS_COUNT    14
 
 #define _DL_FIRST_PLATFORM     32
 /* Mask to filter out platforms.  */
@@ -52,6 +60,7 @@
 #define PPC_PLATFORM_PPC440            10
 #define PPC_PLATFORM_PPC464            11
 #define PPC_PLATFORM_PPC476            12
+#define PPC_PLATFORM_POWER8            13
 
 static inline const char *
 __attribute__ ((unused))
@@ -112,6 +121,9 @@ _dl_string_platform (const char *str)
        case '7':
          ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER7;
          break;
+       case '8':
+         ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER8;
+         break;
        default:
          return -1;
        }
@@ -159,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;
diff --git a/sysdeps/powerpc/powerpc32/power8/Implies b/sysdeps/powerpc/powerpc32/power8/Implies
new file mode 100644 (file)
index 0000000..083f3e9
--- /dev/null
@@ -0,0 +1,2 @@
+powerpc/powerpc32/power7/fpu
+powerpc/powerpc32/power7
diff --git a/sysdeps/powerpc/powerpc64/power8/Implies b/sysdeps/powerpc/powerpc64/power8/Implies
new file mode 100644 (file)
index 0000000..9a5e3c7
--- /dev/null
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power7/fpu
+powerpc/powerpc64/power7
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/power8/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/power8/Implies
new file mode 100644 (file)
index 0000000..066dea2
--- /dev/null
@@ -0,0 +1,2 @@
+powerpc/powerpc32/power8/fpu
+powerpc/powerpc32/power8
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/power8/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/power8/Implies
new file mode 100644 (file)
index 0000000..fad2505
--- /dev/null
@@ -0,0 +1,2 @@
+powerpc/powerpc64/power8/fpu
+powerpc/powerpc64/power8