public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Michael Meissner <meissner@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/dmf001)] Make %A warn about not using accumulators. Date: Tue, 11 Oct 2022 15:58:43 +0000 (GMT) [thread overview] Message-ID: <20221011155843.D8B4E3857415@sourceware.org> (raw) 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);
reply other threads:[~2022-10-11 15:58 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20221011155843.D8B4E3857415@sourceware.org \ --to=meissner@gcc.gnu.org \ --cc=gcc-cvs@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: linkBe 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).