Re: [PATCH] Add RDMA support to Falkor.

2017-07-21 Thread Richard Earnshaw (lists)
On 29/06/17 21:53, Jim Wilson wrote:
> Falkor is an ARMV8-A part, but also includes the RDMA extension from 
> ARMV8.1-A.
> I'd like to enable support for the RDMA instructions when -mcpu=falkor is 
> used,
> and also make the RDMA intrisics available.  To do that, I need to add rdma
> as an architecture extension, and modify a few things to use it.  Binutils
> already supports rdma as an architecture extension.
> 
> I only did the aarch64 port, and not the arm port.  There are no supported
> targets that have the RDMA instructions and also aarch32 support.  There are
> also no aarch32 RDMA testcases.  So there is no way to test it.  It wasn't
> clear whether it was better to add something untested or leave it out.  I 
> chose
> to leave it out for now.
> 
> I also needed a few testcase changes.  There were redundant options being
> added for the RDMA tests that I had to remove as they are now wrong.  Also
> the fact that I only did aarch64 means we need to check both armv8-a+rdma and
> armv8.1-a for the rdma support.
> 
> This was tested with an aarch64 bootstrap and make check.  There were no
> regressions.
> 
> OK?

OK.

R.

> 
> Jim
> 
>   gcc/
>   * config/aarch64/aarch64-cores.def (falkor): Add AARCH64_FL_RDMA.
>   (qdf24xx): Likewise.
>   * config/aarch64/aarch64-options-extensions.def (rdma); New.
>   * config/aarch64/aarch64.h (AARCH64_FL_RDMA): New.
>   (AARCH64_FL_V8_1): Renumber.
>   (AARCH64_FL_FOR_ARCH8_1): Add AARCH64_FL_RDMA.
>   (AARCH64_ISA_RDMA): Use AARCH64_FL_RDMA.
>   * config/aarch64/arm_neon.h: Use +rdma instead of arch=armv8.1-a.
>   * doc/invoke.texi (AArch64 Options): Mention +rmda in -march docs.  Add
>   rdma to feature modifiers list.
> 
>   gcc/testsuite/
>   * lib/target-supports.exp (add_options_for_arm_v8_1a_neon): Delete
>   redundant -march option.
>   (check_effective_target_arm_v8_1a_neon_ok_nocache): Try armv8-a+rdma
>   in addition to armv8.1-a.
> ---
>  gcc/config/aarch64/aarch64-cores.def |  4 ++--
>  gcc/config/aarch64/aarch64-option-extensions.def |  4 
>  gcc/config/aarch64/aarch64.h |  8 +---
>  gcc/config/aarch64/arm_neon.h|  2 +-
>  gcc/doc/invoke.texi  |  5 -
>  gcc/testsuite/lib/target-supports.exp| 18 ++
>  6 files changed, 26 insertions(+), 15 deletions(-)
> 
> diff --git a/gcc/config/aarch64/aarch64-cores.def 
> b/gcc/config/aarch64/aarch64-cores.def
> index f8342ca..b8d0ba6 100644
> --- a/gcc/config/aarch64/aarch64-cores.def
> +++ b/gcc/config/aarch64/aarch64-cores.def
> @@ -65,8 +65,8 @@ AARCH64_CORE("thunderxt83",   thunderxt83,   thunderx,  8A, 
>  AARCH64_FL_FOR_ARCH
>  AARCH64_CORE("xgene1",  xgene1,xgene1,8A,  AARCH64_FL_FOR_ARCH8, 
> xgene1, 0x50, 0x000, -1)
>  
>  /* Qualcomm ('Q') cores. */
> -AARCH64_CORE("falkor",  falkor,cortexa57, 8A,  AARCH64_FL_FOR_ARCH8 
> | AARCH64_FL_CRC | AARCH64_FL_CRYPTO, qdf24xx,   0x51, 0xC00, -1)
> -AARCH64_CORE("qdf24xx", qdf24xx,   cortexa57, 8A,  AARCH64_FL_FOR_ARCH8 
> | AARCH64_FL_CRC | AARCH64_FL_CRYPTO, qdf24xx,   0x51, 0xC00, -1)
> +AARCH64_CORE("falkor",  falkor,cortexa57, 8A,  AARCH64_FL_FOR_ARCH8 
> | AARCH64_FL_CRC | AARCH64_FL_CRYPTO | AARCH64_FL_RDMA, qdf24xx,   0x51, 
> 0xC00, -1)
> +AARCH64_CORE("qdf24xx", qdf24xx,   cortexa57, 8A,  AARCH64_FL_FOR_ARCH8 
> | AARCH64_FL_CRC | AARCH64_FL_CRYPTO | AARCH64_FL_RDMA, qdf24xx,   0x51, 
> 0xC00, -1)
>  
>  /* Samsung ('S') cores. */
>  AARCH64_CORE("exynos-m1",   exynosm1,  exynosm1,  8A,  AARCH64_FL_FOR_ARCH8 
> | AARCH64_FL_CRC | AARCH64_FL_CRYPTO, exynosm1,  0x53, 0x001, -1)
> diff --git a/gcc/config/aarch64/aarch64-option-extensions.def 
> b/gcc/config/aarch64/aarch64-option-extensions.def
> index c0752ce..c4f059a 100644
> --- a/gcc/config/aarch64/aarch64-option-extensions.def
> +++ b/gcc/config/aarch64/aarch64-option-extensions.def
> @@ -63,4 +63,8 @@ AARCH64_OPT_EXTENSION("fp16", AARCH64_FL_F16, 
> AARCH64_FL_FP, 0, "fphp asimdhp")
>  /* Enabling or disabling "rcpc" only changes "rcpc".  */
>  AARCH64_OPT_EXTENSION("rcpc", AARCH64_FL_RCPC, 0, 0, "lrcpc")
>  
> +/* Enabling "rdma" also enables "fp", "simd".
> +   Disabling "rdma" just disables "rdma".  */
> +AARCH64_OPT_EXTENSION("rdma", AARCH64_FL_RDMA, AARCH64_FL_FP | 
> AARCH64_FL_SIMD, 0, "rdma")
> +
>  #undef AARCH64_OPT_EXTENSION
> diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
> index 106cf3a..7f91edb 100644
> --- a/gcc/config/aarch64/aarch64.h
> +++ b/gcc/config/aarch64/aarch64.h
> @@ -144,7 +144,8 @@ extern unsigned aarch64_architecture_version;
>  #define AARCH64_FL_CRC(1 << 3)   /* Has CRC.  */
>  /* ARMv8.1-A architecture extensions.  */
>  #define AARCH64_FL_LSE (1 << 4)  /* Has Large System Extensions. 
>  */
> -#define AARCH64_FL_V8_1(1 << 5)  /* Has ARMv8.1-A extensions.  */
> +#define AARCH64_FL_RDMA   

[PATCH] Add RDMA support to Falkor.

2017-06-29 Thread Jim Wilson
Falkor is an ARMV8-A part, but also includes the RDMA extension from ARMV8.1-A.
I'd like to enable support for the RDMA instructions when -mcpu=falkor is used,
and also make the RDMA intrisics available.  To do that, I need to add rdma
as an architecture extension, and modify a few things to use it.  Binutils
already supports rdma as an architecture extension.

I only did the aarch64 port, and not the arm port.  There are no supported
targets that have the RDMA instructions and also aarch32 support.  There are
also no aarch32 RDMA testcases.  So there is no way to test it.  It wasn't
clear whether it was better to add something untested or leave it out.  I chose
to leave it out for now.

I also needed a few testcase changes.  There were redundant options being
added for the RDMA tests that I had to remove as they are now wrong.  Also
the fact that I only did aarch64 means we need to check both armv8-a+rdma and
armv8.1-a for the rdma support.

This was tested with an aarch64 bootstrap and make check.  There were no
regressions.

OK?

Jim

gcc/
* config/aarch64/aarch64-cores.def (falkor): Add AARCH64_FL_RDMA.
(qdf24xx): Likewise.
* config/aarch64/aarch64-options-extensions.def (rdma); New.
* config/aarch64/aarch64.h (AARCH64_FL_RDMA): New.
(AARCH64_FL_V8_1): Renumber.
(AARCH64_FL_FOR_ARCH8_1): Add AARCH64_FL_RDMA.
(AARCH64_ISA_RDMA): Use AARCH64_FL_RDMA.
* config/aarch64/arm_neon.h: Use +rdma instead of arch=armv8.1-a.
* doc/invoke.texi (AArch64 Options): Mention +rmda in -march docs.  Add
rdma to feature modifiers list.

gcc/testsuite/
* lib/target-supports.exp (add_options_for_arm_v8_1a_neon): Delete
redundant -march option.
(check_effective_target_arm_v8_1a_neon_ok_nocache): Try armv8-a+rdma
in addition to armv8.1-a.
---
 gcc/config/aarch64/aarch64-cores.def |  4 ++--
 gcc/config/aarch64/aarch64-option-extensions.def |  4 
 gcc/config/aarch64/aarch64.h |  8 +---
 gcc/config/aarch64/arm_neon.h|  2 +-
 gcc/doc/invoke.texi  |  5 -
 gcc/testsuite/lib/target-supports.exp| 18 ++
 6 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-cores.def 
b/gcc/config/aarch64/aarch64-cores.def
index f8342ca..b8d0ba6 100644
--- a/gcc/config/aarch64/aarch64-cores.def
+++ b/gcc/config/aarch64/aarch64-cores.def
@@ -65,8 +65,8 @@ AARCH64_CORE("thunderxt83",   thunderxt83,   thunderx,  8A,  
AARCH64_FL_FOR_ARCH
 AARCH64_CORE("xgene1",  xgene1,xgene1,8A,  AARCH64_FL_FOR_ARCH8, 
xgene1, 0x50, 0x000, -1)
 
 /* Qualcomm ('Q') cores. */
-AARCH64_CORE("falkor",  falkor,cortexa57, 8A,  AARCH64_FL_FOR_ARCH8 | 
AARCH64_FL_CRC | AARCH64_FL_CRYPTO, qdf24xx,   0x51, 0xC00, -1)
-AARCH64_CORE("qdf24xx", qdf24xx,   cortexa57, 8A,  AARCH64_FL_FOR_ARCH8 | 
AARCH64_FL_CRC | AARCH64_FL_CRYPTO, qdf24xx,   0x51, 0xC00, -1)
+AARCH64_CORE("falkor",  falkor,cortexa57, 8A,  AARCH64_FL_FOR_ARCH8 | 
AARCH64_FL_CRC | AARCH64_FL_CRYPTO | AARCH64_FL_RDMA, qdf24xx,   0x51, 0xC00, 
-1)
+AARCH64_CORE("qdf24xx", qdf24xx,   cortexa57, 8A,  AARCH64_FL_FOR_ARCH8 | 
AARCH64_FL_CRC | AARCH64_FL_CRYPTO | AARCH64_FL_RDMA, qdf24xx,   0x51, 0xC00, 
-1)
 
 /* Samsung ('S') cores. */
 AARCH64_CORE("exynos-m1",   exynosm1,  exynosm1,  8A,  AARCH64_FL_FOR_ARCH8 | 
AARCH64_FL_CRC | AARCH64_FL_CRYPTO, exynosm1,  0x53, 0x001, -1)
diff --git a/gcc/config/aarch64/aarch64-option-extensions.def 
b/gcc/config/aarch64/aarch64-option-extensions.def
index c0752ce..c4f059a 100644
--- a/gcc/config/aarch64/aarch64-option-extensions.def
+++ b/gcc/config/aarch64/aarch64-option-extensions.def
@@ -63,4 +63,8 @@ AARCH64_OPT_EXTENSION("fp16", AARCH64_FL_F16, AARCH64_FL_FP, 
0, "fphp asimdhp")
 /* Enabling or disabling "rcpc" only changes "rcpc".  */
 AARCH64_OPT_EXTENSION("rcpc", AARCH64_FL_RCPC, 0, 0, "lrcpc")
 
+/* Enabling "rdma" also enables "fp", "simd".
+   Disabling "rdma" just disables "rdma".  */
+AARCH64_OPT_EXTENSION("rdma", AARCH64_FL_RDMA, AARCH64_FL_FP | 
AARCH64_FL_SIMD, 0, "rdma")
+
 #undef AARCH64_OPT_EXTENSION
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index 106cf3a..7f91edb 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -144,7 +144,8 @@ extern unsigned aarch64_architecture_version;
 #define AARCH64_FL_CRC(1 << 3) /* Has CRC.  */
 /* ARMv8.1-A architecture extensions.  */
 #define AARCH64_FL_LSE   (1 << 4)  /* Has Large System Extensions.  */
-#define AARCH64_FL_V8_1  (1 << 5)  /* Has ARMv8.1-A extensions.  */
+#define AARCH64_FL_RDMA  (1 << 5)  /* Has Round Double Multiply 
Add.  */
+#define AARCH64_FL_V8_1  (1 << 6)  /* Has ARMv8.1-A extensions.  */
 /* ARMv8.2-A architecture extensions.  */
 #define AARCH64_FL_V8_2  (1 << 8)  /* Has ARMv