[PATCH] powerpc: Add support for POWER10

Matheus Castanho msc@linux.ibm.com
Thu Jun 25 18:47:37 GMT 2020


Hi Tulio,

On 6/24/20 9:10 PM, Tulio Magno Quites Machado Filho via Libc-alpha wrote:
> Add the directories to hold POWER10 files.
> 
> Print the correct values for AT_PLATFORM and AT_BASE_PLATFORM.
> ---
>  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          |  3 +++
>  sysdeps/powerpc/powerpc64/be/power10/fpu/Implies      |  2 ++
>  .../powerpc64/be/power10/fpu/multiarch/Implies        |  1 +
>  .../powerpc/powerpc64/be/power10/multiarch/Implies    |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/Implies          |  1 +
>  sysdeps/powerpc/powerpc64/le/power10/fpu/Implies      |  1 +
>  .../powerpc64/le/power10/fpu/multiarch/Implies        |  1 +
>  .../powerpc/powerpc64/le/power10/multiarch/Implies    |  1 +
>  12 files changed, 25 insertions(+), 1 deletion(-)
>  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

OK.

>  
>  #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

OK.

>  
>  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;

OK.

>  	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..2a4fe87b9e
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/be/power10/Implies
> @@ -0,0 +1,3 @@
> +powerpc/powerpc64/power10

This directory does not exist. So should it or should this line be removed?

> +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..01e4a5a3f6
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/be/power10/fpu/Implies
> @@ -0,0 +1,2 @@
> +powerpc/powerpc64/power10/fpu

The same applies here. Directory does not exist.

These seem to be the only 'Implied' ones missing. With your patch
applied to the tree:
[sysdeps]$ git diff HEAD^ | for d in $(grep '+powerpc'); do d=${d:1}; [
-d $d ] && echo "OK!" || echo "Not found -> $d"; done
OK!
OK!
OK!
OK!
Not found -> powerpc/powerpc64/power10
OK!
OK!
Not found -> powerpc/powerpc64/power10/fpu
OK!
OK!
OK!
OK!
OK!
OK!
OK!

> +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..37f19d3553
> --- /dev/null
> +++ b/sysdeps/powerpc/powerpc64/le/power10/Implies
> @@ -0,0 +1 @@
> +powerpc/powerpc64/le/power9

For BE you also add [...]/be/power9/fpu. Should this also be the case
here for LE?

> 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
> 

--
Matheus Castanho


More information about the Libc-alpha mailing list