public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
To: Murray Steele <Murray.Steele@arm.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 2/2][GCC] arm: Declare MVE types internally via pragma
Date: Wed, 8 Dec 2021 15:23:46 +0000	[thread overview]
Message-ID: <3ad22fca-fa13-04ea-f114-01e8c52dd280@foss.arm.com> (raw)
In-Reply-To: <060230b8-22b0-36eb-2594-c469efaabf35@arm.com>



On 25/11/2021 09:42, Murray Steele via Gcc-patches wrote:
> Changes from original patch:
> 
> 1. Merged test_redef_* test files into one
> 2. Encapsulated contents of arm-mve-builtins.h in namespace arm_mve (missed
>     in initial patch).
> 3. Added extern declarations for scalar_types and acle_vector types to
>     arm-mve-builtins.h (missed in initial patch).
> 4. Added arm-mve-builtins.(cc|h) to gt_targets for arm-*-*-* (missed in
>     initial patch).
> 5. Added include for gt-arm-mve-builtins.h to arm-mve-builtins.cc (missed in
>     initial patch).
> 6. Removed explicit initialisation of handle_arm_mve_types_p as it is unneeded.
> 
> ---
> 
> This patch moves the implementation of MVE ACLE types from
> arm_mve_types.h to inside GCC via a new pragma, which replaces the prior
> type definitions. This allows for the types to be used internally for
> intrinsic function definitions.
> 
> Bootstrapped and regression tested on arm-none-linux-gnuabihf, and
> regression tested on arm-eabi -- no issues.
> 
> Thanks,
> Murray
> 

Nearly there, but...

Your changelog entry needs some work:

> gcc/ChangeLog:
> 
>          * config.gcc: Add arm-mve-builtins.o to extra_objs for arm-*-*-*
>          targets.

  * config.gcc (arm*-*-*): Add arm-mve-builtins.o to extra_objs.

>          * config/arm/arm-c.c (arm_pragma_arm): Handle new pragma.

  ... Handle "#pragma GCC arm".

>          (arm_register_target_pragmas): Register new pragma.
  ... Register it.

>          * config/arm/arm-protos.h: Add arm_mve namespace and declare
>          arm_handle_mve_types_h.

  ...arm-protos.h (arm_mve::arm_handle_mve_types.h): New prototype.

>          * config/arm/arm_mve_types.h: Replace MVE type definitions with
>          new pragma.
>          * config/arm/t-arm: Add arm-mve-builtins.o target.

.../t-arm (arm-mve-builtins.o): New target rule.

>          * config/arm/arm-mve-builtins.cc: New file.
>          * config/arm/arm-mve-builtins.def: New file.
>          * config/arm/arm-mve-builtins.h: New file.
> 
> gcc/testsuite/ChangeLog:
> 
>          * gcc.target/arm/mve/mve.exp: Add new subdirectories.
>          * gcc.target/arm/mve/general-c/type_redef_1.c: New test.
>          * gcc.target/arm/mve/general/double_pragmas_1.c: New test.
>          * gcc.target/arm/mve/general/nomve_1.c: New test.
> 


diff --git a/gcc/config/arm/arm-mve-builtins.def 
b/gcc/config/arm/arm-mve-builtins.def
new file mode 100644
index 
0000000000000000000000000000000000000000..02a46bec3e4cba6add9bce4021c732e15aa8b012
--- /dev/null
+++ b/gcc/config/arm/arm-mve-builtins.def
@@ -0,0 +1,41 @@

+#ifndef DEF_MVE_TYPE
+#define DEF_MVE_TYPE(A, B)
+#endif

When would this file ever be included when this macro wasn't defined? 
Better to require the caller to define this by using #error if it's missing.

then...

+
+#undef DEF_MVE_TYPE

This isn't needed anymore, because caller should undef it after use.

diff --git a/gcc/config/arm/arm-mve-builtins.cc 
b/gcc/config/arm/arm-mve-builtins.cc
new file mode 100644
index 
0000000000000000000000000000000000000000..99ddc8d49aad39e057c1c0d349c6c02c278553d6
--- /dev/null
+++ b/gcc/config/arm/arm-mve-builtins.cc

...
+}
+
+}
+
+using namespace arm_mve;

Add a comment that this is the end of the earlier namespace declaration.

diff --git a/gcc/config/arm/arm-mve-builtins.h 
b/gcc/config/arm/arm-mve-builtins.h
new file mode 100644
index 
0000000000000000000000000000000000000000..c165ce6997b4560fc87626be4bbaa0e8afcbbfed
--- /dev/null
+++ b/gcc/config/arm/arm-mve-builtins.h
@@ -0,0 +1,41 @@


...
+}
+

Likewise.

R.

  parent reply	other threads:[~2021-12-08 15:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 10:15 Murray Steele
2021-11-18 15:45 ` Richard Earnshaw
2021-11-23  9:37   ` Murray Steele
2021-11-23 14:16     ` Richard Earnshaw
2021-11-23 15:45       ` Murray Steele
2021-11-25  9:42         ` Murray Steele
2021-12-08 10:04           ` [PING][PATCH " Murray Steele
2021-12-08 15:23           ` Richard Earnshaw [this message]
2021-12-08 15:39             ` [PATCH " Murray Steele
2021-12-08 17:34               ` Richard Earnshaw
2021-12-09 15:24                 ` [PATCH v3 " Murray Steele
2021-12-21 11:20                   ` Murray Steele
2021-12-22 15:00                   ` Richard Earnshaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ad22fca-fa13-04ea-f114-01e8c52dd280@foss.arm.com \
    --to=richard.earnshaw@foss.arm.com \
    --cc=Murray.Steele@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).