public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/dmf001)] Make %A warn about not using accumulators.
@ 2022-10-11 15:58 Michael Meissner
  0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2022-10-11 15:58 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3065dced0a8167eab5fc10624c704600db2efc65

commit 3065dced0a8167eab5fc10624c704600db2efc65
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Tue Oct 11 11:56:13 2022 -0400

    Make %A warn about not using accumulators.
    
    2022-10-11   Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            * config/rs6000/rs6000.cc (print_operand): Under -mdmf, for output
              modifier %A, make sure the argument is an accumulator.

Diff:
---
 gcc/config/rs6000/rs6000.cc | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 92713407c4f..b3e608dbaa4 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -13910,8 +13910,19 @@ print_operand (FILE *file, rtx x, int code)
 	 output_operand.  */
 
     case 'A':
-      /* Write the MMA accumulator number associated with VSX register X.  */
-      if (!REG_P (x) || !FP_REGNO_P (REGNO (x)) || (REGNO (x) % 4) != 0)
+      /* Write the MMA accumulator number associated with VSX register X.  On
+	 DMF systems, only allow DMF accumulators, not accumulators overlapping
+	 with the FPR registers.  */
+      if (!REG_P (x))
+	output_operand_lossage ("invalid %%A value");
+      else if (TARGET_DMF)
+	{
+	  if (DMF_REGNO_P (REGNO (x)))
+	    fprintf (file, "%d", REGNO (x) - FIRST_DMF_REGNO);
+	  else
+	    output_operand_lossage ("%%A operand is not a DMF accumulator");
+	}
+      else if (!FP_REGNO_P (REGNO (x)) || (REGNO (x) % 4) != 0)
 	output_operand_lossage ("invalid %%A value");
       else
 	fprintf (file, "%d", (REGNO (x) - FIRST_FPR_REGNO) / 4);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-11 15:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-11 15:58 [gcc(refs/users/meissner/heads/dmf001)] Make %A warn about not using accumulators Michael Meissner

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