public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@baylibre.com>
To: Andrew Stubbs <ams@baylibre.com>, gcc-patches@gcc.gnu.org
Subject: GCN: Remove 'FIRST_{SGPR,VGPR,AVGPR}_REG', 'LAST_{SGPR,VGPR,AVGPR}_REG' from machine description (was: [PATCH v3 04/10] GCN machine description)
Date: Wed, 31 Jan 2024 18:21:50 +0100	[thread overview]
Message-ID: <87jznpl8pd.fsf@euler.schwinge.ddns.net> (raw)
In-Reply-To: <ab4dbbb24c00edac768d0849d1151af80051e02c.1544611347.git.ams@codesourcery.com>

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

Hi!

On 2018-12-12T11:52:23+0000, Andrew Stubbs <ams@codesourcery.com> wrote:
> This patch contains the machine description portion of the GCN back-end.  [...]

> --- /dev/null
> +++ b/gcc/config/gcn/gcn.md

> +;; {{{ Constants and enums
> +
> +; Named registers
> +(define_constants
> +  [(FIRST_SGPR_REG		 0)
> +   (LAST_SGPR_REG		 101)
> +   (FLAT_SCRATCH_REG		 102)
> +   (FLAT_SCRATCH_LO_REG		 102)
> +   (FLAT_SCRATCH_HI_REG		 103)
> +   (XNACK_MASK_REG		 104)
> +   (XNACK_MASK_LO_REG		 104)
> +   (XNACK_MASK_HI_REG		 105)
> +   (VCC_REG			 106)
> +   (VCC_LO_REG			 106)
> +   (VCC_HI_REG			 107)
> +   (VCCZ_REG			 108)
> +   (TBA_REG			 109)
> +   (TBA_LO_REG			 109)
> +   (TBA_HI_REG			 110)
> +   (TMA_REG			 111)
> +   (TMA_LO_REG			 111)
> +   (TMA_HI_REG			 112)
> +   (TTMP0_REG			 113)
> +   (TTMP11_REG			 124)
> +   (M0_REG			 125)
> +   (EXEC_REG			 126)
> +   (EXEC_LO_REG			 126)
> +   (EXEC_HI_REG			 127)
> +   (EXECZ_REG			 128)
> +   (SCC_REG			 129)
> +   (FIRST_VGPR_REG		 160)
> +   (LAST_VGPR_REG		 415)])
> +
> +(define_constants
> +  [(SP_REGNUM 16)
> +   (LR_REGNUM 18)
> +   (AP_REGNUM 416)
> +   (FP_REGNUM 418)])

Generally, shouldn't there be a better way, that avoids duplication and
instead shares such definitions between 'gcn.h' and 'gcn.md'?

Until that's settled, OK to push the attached
"GCN: Remove 'FIRST_{SGPR,VGPR,AVGPR}_REG', 'LAST_{SGPR,VGPR,AVGPR}_REG' from machine description"?
(I assume "still builds" is sufficient validation of this change.)


Grüße
 Thomas



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-GCN-Remove-FIRST_-SGPR-VGPR-AVGPR-_REG-LAST_-SGPR-VG.patch --]
[-- Type: text/x-diff, Size: 1296 bytes --]

From 6af4774b4574086f5d4925333406eab4fed7f9a5 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Wed, 31 Jan 2024 13:27:34 +0100
Subject: [PATCH] GCN: Remove 'FIRST_{SGPR,VGPR,AVGPR}_REG',
 'LAST_{SGPR,VGPR,AVGPR}_REG' from machine description

They're not used there, and we avoid potentially out-of-sync definitions.

	gcc/
	* config/gcn/gcn.md (FIRST_SGPR_REG, LAST_SGPR_REG)
	(FIRST_VGPR_REG, LAST_VGPR_REG, FIRST_AVGPR_REG, LAST_AVGPR_REG):
	Don't 'define_constants'.
---
 gcc/config/gcn/gcn.md | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gcc/config/gcn/gcn.md b/gcc/config/gcn/gcn.md
index 1f3c692b7a67..b3235eeea1b6 100644
--- a/gcc/config/gcn/gcn.md
+++ b/gcc/config/gcn/gcn.md
@@ -23,9 +23,7 @@
 
 ; Named registers
 (define_constants
-  [(FIRST_SGPR_REG		 0)
-   (CC_SAVE_REG			 22)
-   (LAST_SGPR_REG		 101)
+  [(CC_SAVE_REG			 22)
    (FLAT_SCRATCH_REG		 102)
    (FLAT_SCRATCH_LO_REG		 102)
    (FLAT_SCRATCH_HI_REG		 103)
@@ -49,11 +47,7 @@
    (EXEC_LO_REG			 126)
    (EXEC_HI_REG			 127)
    (EXECZ_REG			 128)
-   (SCC_REG			 129)
-   (FIRST_VGPR_REG		 160)
-   (LAST_VGPR_REG		 415)
-   (FIRST_AVGPR_REG		 416)
-   (LAST_AVGPR_REG		 671)])
+   (SCC_REG			 129)])
 
 (define_constants
   [(SP_REGNUM 16)
-- 
2.43.0


  parent reply	other threads:[~2024-01-31 17:21 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 11:52 [PATCH v3 00/10] AMD GCN Port v3 Andrew Stubbs
2018-12-12 11:52 ` [PATCH v3 03/10] GCN libgcc Andrew Stubbs
2018-12-12 11:52 ` [PATCH 01/10] Fix LRA bug Andrew Stubbs
2018-12-13 23:49   ` Jeff Law
2018-12-14 10:04     ` Andrew Stubbs
2018-12-14 11:52       ` Andrew Stubbs
2018-12-12 11:52 ` [PATCH v3 02/10] GCN libgfortran Andrew Stubbs
2018-12-12 11:53 ` [PATCH v3 08/10] Testsuite: GCN is always PIE Andrew Stubbs
2018-12-12 11:53 ` [PATCH v3 06/10] GCN back-end config Andrew Stubbs
2020-03-09 15:24   ` [Patch] ./configure.ac – build libgomp by default for amdgcn*-*-* Tobias Burnus
2020-03-09 15:56     ` Jakub Jelinek
2020-04-29  8:23     ` [gcn] Don't default to building target-libstdc++-v3 [PR92713] (was: [PATCH v3 06/10] GCN back-end config) Thomas Schwinge
2018-12-12 11:53 ` [PATCH v3 09/10] Ignore LLVM's blank lines Andrew Stubbs
2018-12-12 12:07   ` Rainer Orth
2018-12-17 12:09     ` Andrew Stubbs
2018-12-13  1:32   ` Segher Boessenkool
2019-01-28 21:35   ` H.J. Lu
2018-12-12 11:53 ` [PATCH v3 04/10] GCN machine description Andrew Stubbs
2020-04-29  8:30   ` Thomas Schwinge
2024-01-31 17:21   ` Thomas Schwinge [this message]
2024-01-31 17:41     ` GCN: Remove 'FIRST_{SGPR,VGPR,AVGPR}_REG', 'LAST_{SGPR,VGPR,AVGPR}_REG' from " Andrew Stubbs
2018-12-12 11:53 ` [PATCH v3 05/10] GCN back-end code Andrew Stubbs
2024-01-31 17:12   ` GCN: Remove 'SGPR_OR_VGPR_REGNO_P' definition (was: [PATCH v3 05/10] GCN back-end code) Thomas Schwinge
2024-01-31 17:22     ` GCN: Remove 'SGPR_OR_VGPR_REGNO_P' definition Andrew Stubbs
2024-02-01 13:49   ` GCN: Don't hard-code number of SGPR/VGPR/AVGPR registers (was: [PATCH v3 05/10] GCN back-end code) Thomas Schwinge
2024-02-01 14:45     ` GCN: Don't hard-code number of SGPR/VGPR/AVGPR registers Andrew Stubbs
2018-12-12 11:53 ` [PATCH v3 10/10] Port testsuite to GCN Andrew Stubbs
2018-12-17 12:17   ` Andrew Stubbs
2018-12-12 11:53 ` [PATCH v3 07/10] Add dg-require-effective-target exceptions Andrew Stubbs
2019-01-07 10:48 ` [PATCH v3 00/10] AMD GCN Port v3 Andrew Stubbs
2019-01-07 11:59   ` Richard Biener
2019-01-11 23:20     ` Jeff Law
2019-01-14 13:55       ` Andrew Stubbs
2019-01-17 12:51         ` Andrew Stubbs
2019-01-17 12:55           ` 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=87jznpl8pd.fsf@euler.schwinge.ddns.net \
    --to=tschwinge@baylibre.com \
    --cc=ams@baylibre.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).