public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Andrew Stubbs <ams@codesourcery.com>, <gcc-patches@gcc.gnu.org>
Subject: GCN: Restore build with GCC 4.8 (was: [committed 1/6] amdgcn: add multiple vector sizes)
Date: Mon, 17 Oct 2022 14:26:27 +0200	[thread overview]
Message-ID: <87v8oihc0c.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <45381d6f9f4e7b5c7b062f5ad8cc9788091c2d07.1665485382.git.ams@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 2995 bytes --]

Hi!

On 2022-10-11T12:02:03+0100, Andrew Stubbs <ams@codesourcery.com> wrote:
> --- a/gcc/config/gcn/gcn.cc
> +++ b/gcc/config/gcn/gcn.cc

> +/* Return a vector mode with N lanes of MODE.  */
> +
> +static machine_mode
> +VnMODE (int n, machine_mode mode)
> +{
> +  switch (mode)
> +    {
> +    case QImode:

Pushed to master branch commit 612de72b0d2904b5a5a2b487ce4cb907c768a947
"GCN: Restore build with GCC 4.8", see attached.

Cherry-picked pushed to devel/omp/gcc-12 branch in
commit 38e4f4f55a6823d028b8f5332c500b7267ad320b
"GCN: Restore build with GCC 4.8", see attached.


Grüße
 Thomas


> +      switch (n)
> +     {
> +     case 2: return V2QImode;
> +     case 4: return V4QImode;
> +     case 8: return V8QImode;
> +     case 16: return V16QImode;
> +     case 32: return V32QImode;
> +     case 64: return V64QImode;
> +     }
> +      break;
> +    case HImode:
> +      switch (n)
> +     {
> +     case 2: return V2HImode;
> +     case 4: return V4HImode;
> +     case 8: return V8HImode;
> +     case 16: return V16HImode;
> +     case 32: return V32HImode;
> +     case 64: return V64HImode;
> +     }
> +      break;
> +    case HFmode:
> +      switch (n)
> +     {
> +     case 2: return V2HFmode;
> +     case 4: return V4HFmode;
> +     case 8: return V8HFmode;
> +     case 16: return V16HFmode;
> +     case 32: return V32HFmode;
> +     case 64: return V64HFmode;
> +     }
> +      break;
> +    case SImode:
> +      switch (n)
> +     {
> +     case 2: return V2SImode;
> +     case 4: return V4SImode;
> +     case 8: return V8SImode;
> +     case 16: return V16SImode;
> +     case 32: return V32SImode;
> +     case 64: return V64SImode;
> +     }
> +      break;
> +    case SFmode:
> +      switch (n)
> +     {
> +     case 2: return V2SFmode;
> +     case 4: return V4SFmode;
> +     case 8: return V8SFmode;
> +     case 16: return V16SFmode;
> +     case 32: return V32SFmode;
> +     case 64: return V64SFmode;
> +     }
> +      break;
> +    case DImode:
> +      switch (n)
> +     {
> +     case 2: return V2DImode;
> +     case 4: return V4DImode;
> +     case 8: return V8DImode;
> +     case 16: return V16DImode;
> +     case 32: return V32DImode;
> +     case 64: return V64DImode;
> +     }
> +      break;
> +    case DFmode:
> +      switch (n)
> +     {
> +     case 2: return V2DFmode;
> +     case 4: return V4DFmode;
> +     case 8: return V8DFmode;
> +     case 16: return V16DFmode;
> +     case 32: return V32DFmode;
> +     case 64: return V64DFmode;
> +     }
> +      break;
> +    default:
> +      break;
> +    }
> +
> +  return VOIDmode;
> +}


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Attachment #2: 0001-GCN-Restore-build-with-GCC-4.8.patch --]
[-- Type: text/x-diff, Size: 3435 bytes --]

From 612de72b0d2904b5a5a2b487ce4cb907c768a947 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Sat, 15 Oct 2022 00:10:29 +0200
Subject: [PATCH] GCN: Restore build with GCC 4.8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

For example, for "g++-4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4", the recent
commit r13-3220-g45381d6f9f4e7b5c7b062f5ad8cc9788091c2d07
"amdgcn: add multiple vector sizes" broke the build:

    In file included from [...]/source-gcc/gcc/coretypes.h:458:0,
                     from [...]/source-gcc/gcc/config/gcn/gcn.cc:24:
    [...]/source-gcc/gcc/config/gcn/gcn.cc: In function ‘machine_mode VnMODE(int, machine_mode)’:
    ./insn-modes.h:42:71: error: temporary of non-literal type ‘scalar_int_mode’ in a constant expression
     #define QImode (scalar_int_mode ((scalar_int_mode::from_int) E_QImode))
                                                                           ^
    [...]/source-gcc/gcc/config/gcn/gcn.cc:405:10: note: in expansion of macro ‘QImode’
         case QImode:
              ^
    In file included from [...]/source-gcc/gcc/coretypes.h:478:0,
                     from [...]/source-gcc/gcc/config/gcn/gcn.cc:24:
    [...]/source-gcc/gcc/machmode.h:410:7: note: ‘scalar_int_mode’ is not literal because:
     class scalar_int_mode
           ^
    [...]/source-gcc/gcc/machmode.h:410:7: note:   ‘scalar_int_mode’ is not an aggregate, does not have a trivial default constructor, and has no constexpr constructor that is not a copy or move constructor
    [...]

Addressing this like simiar issues have been addressed in the past.

	gcc/
	* config/gcn/gcn.cc (VnMODE): Use 'case E_QImode:' instead of
	'case QImode:', etc.
---
 gcc/config/gcn/gcn.cc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc
index 3dc294c2d2f..8777255a5c6 100644
--- a/gcc/config/gcn/gcn.cc
+++ b/gcc/config/gcn/gcn.cc
@@ -402,7 +402,7 @@ VnMODE (int n, machine_mode mode)
 {
   switch (mode)
     {
-    case QImode:
+    case E_QImode:
       switch (n)
 	{
 	case 2: return V2QImode;
@@ -413,7 +413,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64QImode;
 	}
       break;
-    case HImode:
+    case E_HImode:
       switch (n)
 	{
 	case 2: return V2HImode;
@@ -424,7 +424,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64HImode;
 	}
       break;
-    case HFmode:
+    case E_HFmode:
       switch (n)
 	{
 	case 2: return V2HFmode;
@@ -435,7 +435,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64HFmode;
 	}
       break;
-    case SImode:
+    case E_SImode:
       switch (n)
 	{
 	case 2: return V2SImode;
@@ -446,7 +446,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64SImode;
 	}
       break;
-    case SFmode:
+    case E_SFmode:
       switch (n)
 	{
 	case 2: return V2SFmode;
@@ -457,7 +457,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64SFmode;
 	}
       break;
-    case DImode:
+    case E_DImode:
       switch (n)
 	{
 	case 2: return V2DImode;
@@ -468,7 +468,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64DImode;
 	}
       break;
-    case DFmode:
+    case E_DFmode:
       switch (n)
 	{
 	case 2: return V2DFmode;
-- 
2.35.1


[-- Attachment #3: 0001-GCN-Restore-build-with-GCC-4.8.og12.patch --]
[-- Type: text/x-diff, Size: 4077 bytes --]

From 38e4f4f55a6823d028b8f5332c500b7267ad320b Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Sat, 15 Oct 2022 00:10:29 +0200
Subject: [PATCH] GCN: Restore build with GCC 4.8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

For example, for "g++-4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4", the recent
commit r13-3220-g45381d6f9f4e7b5c7b062f5ad8cc9788091c2d07
"amdgcn: add multiple vector sizes" broke the build:

    In file included from [...]/source-gcc/gcc/coretypes.h:458:0,
                     from [...]/source-gcc/gcc/config/gcn/gcn.cc:24:
    [...]/source-gcc/gcc/config/gcn/gcn.cc: In function ‘machine_mode VnMODE(int, machine_mode)’:
    ./insn-modes.h:42:71: error: temporary of non-literal type ‘scalar_int_mode’ in a constant expression
     #define QImode (scalar_int_mode ((scalar_int_mode::from_int) E_QImode))
                                                                           ^
    [...]/source-gcc/gcc/config/gcn/gcn.cc:405:10: note: in expansion of macro ‘QImode’
         case QImode:
              ^
    In file included from [...]/source-gcc/gcc/coretypes.h:478:0,
                     from [...]/source-gcc/gcc/config/gcn/gcn.cc:24:
    [...]/source-gcc/gcc/machmode.h:410:7: note: ‘scalar_int_mode’ is not literal because:
     class scalar_int_mode
           ^
    [...]/source-gcc/gcc/machmode.h:410:7: note:   ‘scalar_int_mode’ is not an aggregate, does not have a trivial default constructor, and has no constexpr constructor that is not a copy or move constructor
    [...]

Addressing this like simiar issues have been addressed in the past.

	gcc/
	* config/gcn/gcn.cc (VnMODE): Use 'case E_QImode:' instead of
	'case QImode:', etc.

(cherry picked from commit 612de72b0d2904b5a5a2b487ce4cb907c768a947)
---
 gcc/ChangeLog.omp     |  8 ++++++++
 gcc/config/gcn/gcn.cc | 14 +++++++-------
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index c34d0ec7c77..527a9850dba 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -1,3 +1,11 @@
+2022-10-17  Thomas Schwinge  <thomas@codesourcery.com>
+
+	Backported from master:
+	2022-10-17  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* config/gcn/gcn.cc (VnMODE): Use 'case E_QImode:' instead of
+	'case QImode:', etc.
+
 2022-10-14  Julian Brown  <julian@codesourcery.com>
 
 	* omp-low.cc (oacc_privatization_candidate_p): Artificial vars are not
diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc
index b01131c0dc2..9c2fd4c5b8a 100644
--- a/gcc/config/gcn/gcn.cc
+++ b/gcc/config/gcn/gcn.cc
@@ -412,7 +412,7 @@ VnMODE (int n, machine_mode mode)
 {
   switch (mode)
     {
-    case QImode:
+    case E_QImode:
       switch (n)
 	{
 	case 2: return V2QImode;
@@ -423,7 +423,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64QImode;
 	}
       break;
-    case HImode:
+    case E_HImode:
       switch (n)
 	{
 	case 2: return V2HImode;
@@ -434,7 +434,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64HImode;
 	}
       break;
-    case HFmode:
+    case E_HFmode:
       switch (n)
 	{
 	case 2: return V2HFmode;
@@ -445,7 +445,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64HFmode;
 	}
       break;
-    case SImode:
+    case E_SImode:
       switch (n)
 	{
 	case 2: return V2SImode;
@@ -456,7 +456,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64SImode;
 	}
       break;
-    case SFmode:
+    case E_SFmode:
       switch (n)
 	{
 	case 2: return V2SFmode;
@@ -467,7 +467,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64SFmode;
 	}
       break;
-    case DImode:
+    case E_DImode:
       switch (n)
 	{
 	case 2: return V2DImode;
@@ -478,7 +478,7 @@ VnMODE (int n, machine_mode mode)
 	case 64: return V64DImode;
 	}
       break;
-    case DFmode:
+    case E_DFmode:
       switch (n)
 	{
 	case 2: return V2DFmode;
-- 
2.35.1


  reply	other threads:[~2022-10-17 12:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11 11:02 [committed 0/6] amdgcn: Add V32, V16, V8, V4, and V2 vectors Andrew Stubbs
2022-10-11 11:02 ` [committed 1/6] amdgcn: add multiple vector sizes Andrew Stubbs
2022-10-17 12:26   ` Thomas Schwinge [this message]
2022-10-11 11:02 ` [committed 2/6] amdgcn: Resolve insn conditions at compile time Andrew Stubbs
2022-10-11 11:02 ` [committed 3/6] amdgcn: Add vec_extract for partial vectors Andrew Stubbs
2022-10-11 11:02 ` [committed 4/6] amdgcn: vec_init for multiple vector sizes Andrew Stubbs
2022-10-11 11:02 ` [committed 5/6] amdgcn: Add vector integer negate insn Andrew Stubbs
2022-10-11 11:02 ` [committed 6/6] amdgcn: vector testsuite tweaks Andrew Stubbs
2022-10-28  7:46   ` Thomas Schwinge
2022-10-28  8:38     ` Stubbs, Andrew
2022-10-28  9:00       ` Thomas Schwinge
2022-10-11 11:29 ` [committed 0/6] amdgcn: Add V32, V16, V8, V4, and V2 vectors Richard Biener
2022-10-11 11:53   ` Andrew Stubbs
2022-10-11 11:58     ` Richard Biener

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=87v8oihc0c.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=ams@codesourcery.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).