diff mbox series

[PATCHv2] powerpc: Add support for POWER10

Message ID 20200625230116.301613-1-tuliom@linux.ibm.com
State Accepted
Headers show
Series [PATCHv2] powerpc: Add support for POWER10 | expand

Commit Message

Tulio Magno Quites Machado Filho June 25, 2020, 11:01 p.m. UTC
Changes since v1:
 - Remove 2 directories from Implies.  Added another directory that was
   missing.
 - Listed power10 in preconfigure.ac

---8<---

1. Add the directories to hold POWER10 files.

2. Print the correct values for AT_PLATFORM and AT_BASE_PLATFORM.

3. Let submachine=power10 be set automatically.
---
 sysdeps/powerpc/dl-procinfo.h                         | 11 ++++++++++-
 sysdeps/powerpc/powerpc32/power10/Implies             |  2 ++
 .../powerpc/powerpc32/power10/fpu/multiarch/Implies   |  1 +
 sysdeps/powerpc/powerpc32/power10/multiarch/Implies   |  1 +
 sysdeps/powerpc/powerpc64/be/power10/Implies          |  2 ++
 sysdeps/powerpc/powerpc64/be/power10/fpu/Implies      |  1 +
 .../powerpc64/be/power10/fpu/multiarch/Implies        |  1 +
 .../powerpc/powerpc64/be/power10/multiarch/Implies    |  1 +
 sysdeps/powerpc/powerpc64/le/power10/Implies          |  2 ++
 sysdeps/powerpc/powerpc64/le/power10/fpu/Implies      |  1 +
 .../powerpc64/le/power10/fpu/multiarch/Implies        |  1 +
 .../powerpc/powerpc64/le/power10/multiarch/Implies    |  1 +
 sysdeps/powerpc/preconfigure                          |  2 +-
 sysdeps/powerpc/preconfigure.ac                       |  2 +-
 14 files changed, 26 insertions(+), 3 deletions(-)
 create mode 100644 sysdeps/powerpc/powerpc32/power10/Implies
 create mode 100644 sysdeps/powerpc/powerpc32/power10/fpu/multiarch/Implies
 create mode 100644 sysdeps/powerpc/powerpc32/power10/multiarch/Implies
 create mode 100644 sysdeps/powerpc/powerpc64/be/power10/Implies
 create mode 100644 sysdeps/powerpc/powerpc64/be/power10/fpu/Implies
 create mode 100644 sysdeps/powerpc/powerpc64/be/power10/fpu/multiarch/Implies
 create mode 100644 sysdeps/powerpc/powerpc64/be/power10/multiarch/Implies
 create mode 100644 sysdeps/powerpc/powerpc64/le/power10/Implies
 create mode 100644 sysdeps/powerpc/powerpc64/le/power10/fpu/Implies
 create mode 100644 sysdeps/powerpc/powerpc64/le/power10/fpu/multiarch/Implies
 create mode 100644 sysdeps/powerpc/powerpc64/le/power10/multiarch/Implies

Comments

Matheus Castanho June 26, 2020, 7:09 p.m. UTC | #1
Hi Tulio,

On 6/25/20 8:01 PM, Tulio Magno Quites Machado Filho wrote:
> Changes since v1:
>  - Remove 2 directories from Implies.  Added another directory that was
>    missing.
>  - Listed power10 in preconfigure.ac
> 
> ---8<---
> 
> 1. Add the directories to hold POWER10 files.
> 
> 2. Print the correct values for AT_PLATFORM and AT_BASE_PLATFORM.
> 
> 3. Let submachine=power10 be set automatically.
> ---
>  sysdeps/powerpc/dl-procinfo.h                         | 11 ++++++++++-
>  sysdeps/powerpc/powerpc32/power10/Implies             |  2 ++
>  .../powerpc/powerpc32/power10/fpu/multiarch/Implies   |  1 +
>  sysdeps/powerpc/powerpc32/power10/multiarch/Implies   |  1 +
>  sysdeps/powerpc/powerpc64/be/power10/Implies          |  2 ++
>  sysdeps/powerpc/powerpc64/be/power10/fpu/Implies      |  1 +
>  .../powerpc64/be/power10/fpu/multiarch/Implies        |  1 +
>  .../powerpc/powerpc64/be/power10/multiarch/Implies    |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/Implies          |  2 ++
>  sysdeps/powerpc/powerpc64/le/power10/fpu/Implies      |  1 +
>  .../powerpc64/le/power10/fpu/multiarch/Implies        |  1 +
>  .../powerpc/powerpc64/le/power10/multiarch/Implies    |  1 +
>  sysdeps/powerpc/preconfigure                          |  2 +-
>  sysdeps/powerpc/preconfigure.ac                       |  2 +-
>  14 files changed, 26 insertions(+), 3 deletions(-)
>  create mode 100644 sysdeps/powerpc/powerpc32/power10/Implies
>  create mode 100644 sysdeps/powerpc/powerpc32/power10/fpu/multiarch/Implies
>  create mode 100644 sysdeps/powerpc/powerpc32/power10/multiarch/Implies
>  create mode 100644 sysdeps/powerpc/powerpc64/be/power10/Implies
>  create mode 100644 sysdeps/powerpc/powerpc64/be/power10/fpu/Implies
>  create mode 100644 sysdeps/powerpc/powerpc64/be/power10/fpu/multiarch/Implies
>  create mode 100644 sysdeps/powerpc/powerpc64/be/power10/multiarch/Implies
>  create mode 100644 sysdeps/powerpc/powerpc64/le/power10/Implies
>  create mode 100644 sysdeps/powerpc/powerpc64/le/power10/fpu/Implies
>  create mode 100644 sysdeps/powerpc/powerpc64/le/power10/fpu/multiarch/Implies
>  create mode 100644 sysdeps/powerpc/powerpc64/le/power10/multiarch/Implies
> 
> diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
> index 9ae85f46ec..497dc568e9 100644
> --- a/sysdeps/powerpc/dl-procinfo.h
> +++ b/sysdeps/powerpc/dl-procinfo.h
> @@ -37,7 +37,7 @@
>  #define HWCAP_IMPORTANT		(PPC_FEATURE_HAS_ALTIVEC \
>  				+ PPC_FEATURE_HAS_DFP)
>  
> -#define _DL_PLATFORMS_COUNT	15
> +#define _DL_PLATFORMS_COUNT	16
>  
>  #define _DL_FIRST_PLATFORM	32
>  /* Mask to filter out platforms.  */
> @@ -60,6 +60,7 @@
>  #define PPC_PLATFORM_PPC476		12
>  #define PPC_PLATFORM_POWER8		13
>  #define PPC_PLATFORM_POWER9		14
> +#define PPC_PLATFORM_POWER10		15
>  
>  static inline const char *
>  __attribute__ ((unused))
> @@ -91,6 +92,14 @@ _dl_string_platform (const char *str)
>        str += 5;
>        switch (*str)
>  	{
> +	case '1':
> +	  if (str[1] == '0')
> +	    {
> +	      ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER10;
> +	    }
> +	  else
> +	    return -1;
> +	  break;
>  	case '4':
>  	  ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER4;
>  	  break;
> diff --git a/sysdeps/powerpc/powerpc32/power10/Implies b/sysdeps/powerpc/powerpc32/power10/Implies
> new file mode 100644
> index 0000000000..b298aca71f
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc32/power10/Implies
> @@ -0,0 +1,2 @@
> +powerpc/powerpc32/power9/fpu
> +powerpc/powerpc32/power9
> diff --git a/sysdeps/powerpc/powerpc32/power10/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc32/power10/fpu/multiarch/Implies
> new file mode 100644
> index 0000000000..1ffddd1cda
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc32/power10/fpu/multiarch/Implies
> @@ -0,0 +1 @@
> +powerpc/powerpc32/power9/fpu/multiarch
> diff --git a/sysdeps/powerpc/powerpc32/power10/multiarch/Implies b/sysdeps/powerpc/powerpc32/power10/multiarch/Implies
> new file mode 100644
> index 0000000000..46363b5207
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc32/power10/multiarch/Implies
> @@ -0,0 +1 @@
> +powerpc/powerpc32/power9/multiarch
> diff --git a/sysdeps/powerpc/powerpc64/be/power10/Implies b/sysdeps/powerpc/powerpc64/be/power10/Implies
> new file mode 100644
> index 0000000000..5aea9bc144
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/be/power10/Implies
> @@ -0,0 +1,2 @@
> +powerpc/powerpc64/be/power9/fpu
> +powerpc/powerpc64/be/power9
> diff --git a/sysdeps/powerpc/powerpc64/be/power10/fpu/Implies b/sysdeps/powerpc/powerpc64/be/power10/fpu/Implies
> new file mode 100644
> index 0000000000..19b2a318e2
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/be/power10/fpu/Implies
> @@ -0,0 +1 @@
> +powerpc/powerpc64/be/power9/fpu
> diff --git a/sysdeps/powerpc/powerpc64/be/power10/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power10/fpu/multiarch/Implies
> new file mode 100644
> index 0000000000..a336feb55b
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/be/power10/fpu/multiarch/Implies
> @@ -0,0 +1 @@
> +powerpc/powerpc64/be/power9/fpu/multiarch
> diff --git a/sysdeps/powerpc/powerpc64/be/power10/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power10/multiarch/Implies
> new file mode 100644
> index 0000000000..b4c0f0a58a
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/be/power10/multiarch/Implies
> @@ -0,0 +1 @@
> +powerpc/powerpc64/be/power9/multiarch
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/Implies b/sysdeps/powerpc/powerpc64/le/power10/Implies
> new file mode 100644
> index 0000000000..9e1b787348
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/le/power10/Implies
> @@ -0,0 +1,2 @@
> +powerpc/powerpc64/le/power9/fpu
> +powerpc/powerpc64/le/power9
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/fpu/Implies b/sysdeps/powerpc/powerpc64/le/power10/fpu/Implies
> new file mode 100644
> index 0000000000..1b3525a0d7
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/le/power10/fpu/Implies
> @@ -0,0 +1 @@
> +powerpc/powerpc64/le/power9/fpu
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/power10/fpu/multiarch/Implies
> new file mode 100644
> index 0000000000..189beb801d
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/le/power10/fpu/multiarch/Implies
> @@ -0,0 +1 @@
> +powerpc/powerpc64/le/power9/fpu/multiarch
> diff --git a/sysdeps/powerpc/powerpc64/le/power10/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/power10/multiarch/Implies
> new file mode 100644
> index 0000000000..e6e5fc887e
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/le/power10/multiarch/Implies
> @@ -0,0 +1 @@
> +powerpc/powerpc64/le/power9/multiarch
> diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure
> index deac5a41e2..dfe8e20399 100644
> --- a/sysdeps/powerpc/preconfigure
> +++ b/sysdeps/powerpc/preconfigure
> @@ -56,7 +56,7 @@ fi
>  
>      ;;
>  
> -  a2|970|power[4-9]|power5x|power6+)
> +  a2|970|power[4-9]|power5x|power6+|power10)
>      submachine=${archcpu}
>      if ${libc_cv_cc_submachine+:} false; then :
>    $as_echo_n "(cached) " >&6
> diff --git a/sysdeps/powerpc/preconfigure.ac b/sysdeps/powerpc/preconfigure.ac
> index e6a5ae93a5..6c63bd8257 100644
> --- a/sysdeps/powerpc/preconfigure.ac
> +++ b/sysdeps/powerpc/preconfigure.ac
> @@ -46,7 +46,7 @@ case "${machine}:${submachine}" in
>      AC_CACHE_VAL(libc_cv_cc_submachine,libc_cv_cc_submachine="")
>      ;;
>  
> -  a2|970|power[[4-9]]|power5x|power6+)
> +  a2|970|power[[4-9]]|power5x|power6+|power10)
>      submachine=${archcpu}
>      AC_CACHE_VAL(libc_cv_cc_submachine,libc_cv_cc_submachine="")
>      ;;
> 

This updated version looks good to me.

Thanks,
Matheus Castanho
Paul E Murphy June 26, 2020, 8:48 p.m. UTC | #2
On 6/25/20 6:01 PM, Tulio Magno Quites Machado Filho wrote:
> Changes since v1:
>   - Remove 2 directories from Implies.  Added another directory that was
>     missing.
>   - Listed power10 in preconfigure.ac
> 
> ---8<---
> 
> 1. Add the directories to hold POWER10 files.
> 
> 2. Print the correct values for AT_PLATFORM and AT_BASE_PLATFORM.
> 
> 3. Let submachine=power10 be set automatically.

This patch LGTM.

> diff --git a/sysdeps/powerpc/powerpc64/le/power10/Implies b/sysdeps/powerpc/powerpc64/le/power10/Implies
> new file mode 100644
> index 0000000000..9e1b787348
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/le/power10/Implies
> @@ -0,0 +1,2 @@
> +powerpc/powerpc64/le/power9/fpu

OK, this is the newly added path mentioned above.


> diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure
> diff --git a/sysdeps/powerpc/preconfigure.ac b/sysdeps/powerpc/preconfigure.ac

OK
Tulio Magno Quites Machado Filho June 29, 2020, 1:20 p.m. UTC | #3
Paul E Murphy via Libc-alpha <libc-alpha@sourceware.org> writes:

> This patch LGTM.

Pushed as d2ba3677da7a785556fcd708404d8e049b1c063b.

Thanks!
diff mbox series

Patch

diff --git a/sysdeps/powerpc/dl-procinfo.h b/sysdeps/powerpc/dl-procinfo.h
index 9ae85f46ec..497dc568e9 100644
--- a/sysdeps/powerpc/dl-procinfo.h
+++ b/sysdeps/powerpc/dl-procinfo.h
@@ -37,7 +37,7 @@ 
 #define HWCAP_IMPORTANT		(PPC_FEATURE_HAS_ALTIVEC \
 				+ PPC_FEATURE_HAS_DFP)
 
-#define _DL_PLATFORMS_COUNT	15
+#define _DL_PLATFORMS_COUNT	16
 
 #define _DL_FIRST_PLATFORM	32
 /* Mask to filter out platforms.  */
@@ -60,6 +60,7 @@ 
 #define PPC_PLATFORM_PPC476		12
 #define PPC_PLATFORM_POWER8		13
 #define PPC_PLATFORM_POWER9		14
+#define PPC_PLATFORM_POWER10		15
 
 static inline const char *
 __attribute__ ((unused))
@@ -91,6 +92,14 @@  _dl_string_platform (const char *str)
       str += 5;
       switch (*str)
 	{
+	case '1':
+	  if (str[1] == '0')
+	    {
+	      ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER10;
+	    }
+	  else
+	    return -1;
+	  break;
 	case '4':
 	  ret = _DL_FIRST_PLATFORM + PPC_PLATFORM_POWER4;
 	  break;
diff --git a/sysdeps/powerpc/powerpc32/power10/Implies b/sysdeps/powerpc/powerpc32/power10/Implies
new file mode 100644
index 0000000000..b298aca71f
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/power10/Implies
@@ -0,0 +1,2 @@ 
+powerpc/powerpc32/power9/fpu
+powerpc/powerpc32/power9
diff --git a/sysdeps/powerpc/powerpc32/power10/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc32/power10/fpu/multiarch/Implies
new file mode 100644
index 0000000000..1ffddd1cda
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/power10/fpu/multiarch/Implies
@@ -0,0 +1 @@ 
+powerpc/powerpc32/power9/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc32/power10/multiarch/Implies b/sysdeps/powerpc/powerpc32/power10/multiarch/Implies
new file mode 100644
index 0000000000..46363b5207
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/power10/multiarch/Implies
@@ -0,0 +1 @@ 
+powerpc/powerpc32/power9/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power10/Implies b/sysdeps/powerpc/powerpc64/be/power10/Implies
new file mode 100644
index 0000000000..5aea9bc144
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power10/Implies
@@ -0,0 +1,2 @@ 
+powerpc/powerpc64/be/power9/fpu
+powerpc/powerpc64/be/power9
diff --git a/sysdeps/powerpc/powerpc64/be/power10/fpu/Implies b/sysdeps/powerpc/powerpc64/be/power10/fpu/Implies
new file mode 100644
index 0000000000..19b2a318e2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power10/fpu/Implies
@@ -0,0 +1 @@ 
+powerpc/powerpc64/be/power9/fpu
diff --git a/sysdeps/powerpc/powerpc64/be/power10/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power10/fpu/multiarch/Implies
new file mode 100644
index 0000000000..a336feb55b
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power10/fpu/multiarch/Implies
@@ -0,0 +1 @@ 
+powerpc/powerpc64/be/power9/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/be/power10/multiarch/Implies b/sysdeps/powerpc/powerpc64/be/power10/multiarch/Implies
new file mode 100644
index 0000000000..b4c0f0a58a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/power10/multiarch/Implies
@@ -0,0 +1 @@ 
+powerpc/powerpc64/be/power9/multiarch
diff --git a/sysdeps/powerpc/powerpc64/le/power10/Implies b/sysdeps/powerpc/powerpc64/le/power10/Implies
new file mode 100644
index 0000000000..9e1b787348
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power10/Implies
@@ -0,0 +1,2 @@ 
+powerpc/powerpc64/le/power9/fpu
+powerpc/powerpc64/le/power9
diff --git a/sysdeps/powerpc/powerpc64/le/power10/fpu/Implies b/sysdeps/powerpc/powerpc64/le/power10/fpu/Implies
new file mode 100644
index 0000000000..1b3525a0d7
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power10/fpu/Implies
@@ -0,0 +1 @@ 
+powerpc/powerpc64/le/power9/fpu
diff --git a/sysdeps/powerpc/powerpc64/le/power10/fpu/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/power10/fpu/multiarch/Implies
new file mode 100644
index 0000000000..189beb801d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power10/fpu/multiarch/Implies
@@ -0,0 +1 @@ 
+powerpc/powerpc64/le/power9/fpu/multiarch
diff --git a/sysdeps/powerpc/powerpc64/le/power10/multiarch/Implies b/sysdeps/powerpc/powerpc64/le/power10/multiarch/Implies
new file mode 100644
index 0000000000..e6e5fc887e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/le/power10/multiarch/Implies
@@ -0,0 +1 @@ 
+powerpc/powerpc64/le/power9/multiarch
diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure
index deac5a41e2..dfe8e20399 100644
--- a/sysdeps/powerpc/preconfigure
+++ b/sysdeps/powerpc/preconfigure
@@ -56,7 +56,7 @@  fi
 
     ;;
 
-  a2|970|power[4-9]|power5x|power6+)
+  a2|970|power[4-9]|power5x|power6+|power10)
     submachine=${archcpu}
     if ${libc_cv_cc_submachine+:} false; then :
   $as_echo_n "(cached) " >&6
diff --git a/sysdeps/powerpc/preconfigure.ac b/sysdeps/powerpc/preconfigure.ac
index e6a5ae93a5..6c63bd8257 100644
--- a/sysdeps/powerpc/preconfigure.ac
+++ b/sysdeps/powerpc/preconfigure.ac
@@ -46,7 +46,7 @@  case "${machine}:${submachine}" in
     AC_CACHE_VAL(libc_cv_cc_submachine,libc_cv_cc_submachine="")
     ;;
 
-  a2|970|power[[4-9]]|power5x|power6+)
+  a2|970|power[[4-9]]|power5x|power6+|power10)
     submachine=${archcpu}
     AC_CACHE_VAL(libc_cv_cc_submachine,libc_cv_cc_submachine="")
     ;;