public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pat Haugen <pthaugen@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-10319] Fix register count when not splitting Complex IEEE 128-bit args.
Date: Mon, 17 Oct 2022 20:15:28 +0000 (GMT)	[thread overview]
Message-ID: <20221017201528.99D1B3858D32@sourceware.org> (raw)

https://gcc.gnu.org/g:e7f0d923dc29965ff92f27245ea63c5726edcacd

commit r11-10319-ge7f0d923dc29965ff92f27245ea63c5726edcacd
Author: Pat Haugen <pthaugen@linux.ibm.com>
Date:   Mon Oct 17 15:11:42 2022 -0500

    Fix register count when not splitting Complex IEEE 128-bit args.
    
    For ABI_V4, we do not split complex args. This created a problem because
    even though an arg would be passed in two VSX regs, we were only advancing the
    function arg counter by one VSX register. Fixed with this patch.
    
    (backported commit 2ee68beee709e48fce85b8892ff9985acc6a91a8)
    
    gcc/
            PR target/99685
            * config/rs6000/rs6000-call.c (rs6000_function_arg_advance_1): Bump
            register count when not splitting IEEE 128-bit Complex.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index e58b149d022..1be4797e834 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -7190,6 +7190,12 @@ rs6000_function_arg_advance_1 (CUMULATIVE_ARGS *cum, machine_mode mode,
 	{
 	  cum->vregno += n_elts;
 
+	  /* If we are not splitting Complex IEEE128 args then account for the
+	     fact that they are passed in 2 VSX regs. */
+	  if (!targetm.calls.split_complex_arg && type
+	      && TREE_CODE (type) == COMPLEX_TYPE && elt_mode == KCmode)
+	    cum->vregno++;
+
 	  if (!TARGET_ALTIVEC)
 	    error ("cannot pass argument in vector register because"
 		   " altivec instructions are disabled, use %qs"

                 reply	other threads:[~2022-10-17 20:15 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=20221017201528.99D1B3858D32@sourceware.org \
    --to=pthaugen@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: 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).