public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Peter Bergner <bergner@linux.ibm.com>
Cc: "GCC Patches" <gcc-patches@gcc.gnu.org>,
	"Segher Boessenkool" <segher@kernel.crashing.org>,
	"Dan Horák" <dan@danny.cz>
Subject: Re: [PATCH] libffi: fix handling of homogeneous float128 structs [PR109447]
Date: Fri, 5 May 2023 23:42:02 +0200	[thread overview]
Message-ID: <ZFV4KtC7lNBZNJYb@tucnak> (raw)
In-Reply-To: <f3381264-616a-6c76-3357-7dec1f60696d@linux.ibm.com>

On Thu, May 04, 2023 at 02:29:34PM -0500, Peter Bergner wrote:
> I'd like to pull in Dan's upstream libffi commit into trunk to fix a
> wrong code bug/testsuite failure on powerpc64le-linux with long double
> defaulting to ieee128.  This passed bootstrap and regtesting with no
> regressions.  Ok for trunk?
> 
> This bug is also on the GCC 12 and GCC 11 release branches. Ok there too
> assuming testing is clean?  I can wait to push the gcc12 backport until
> after the release.
> 
> Peter
> 
> 
> If there is a homogeneous struct with float128 members, they should be
> copied to vector register save area. The current code incorrectly copies
> only the value of the first member, not increasing the pointer with each
> iteration. Fix this.
> 
> Merged from upstream libffi commit: 464b4b66e3cf3b5489e730c1466ee1bf825560e0
> 
> 2023-05-03  Dan Horák <dan@danny.cz>
> 
> libffi/
> 	PR libffi/109447
> 	* src/powerpc/ffi_linux64.c (ffi_prep_args64): Update arg.f128 pointer.

Ok for 14/13.2/12.4 (i.e. after 12.3 is out)/11.4

> diff --git a/libffi/src/powerpc/ffi_linux64.c b/libffi/src/powerpc/ffi_linux64.c
> index 4d50878e402..3454dacd3d6 100644
> --- a/libffi/src/powerpc/ffi_linux64.c
> +++ b/libffi/src/powerpc/ffi_linux64.c
> @@ -680,7 +680,7 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
>                      {
>                        if (vecarg_count < NUM_VEC_ARG_REGISTERS64
>                            && i < nfixedargs)
> -		        memcpy (vec_base.f128++, arg.f128, sizeof (float128));
> +		        memcpy (vec_base.f128++, arg.f128++, sizeof (float128));
>                        else
>  		        memcpy (next_arg.f128, arg.f128++, sizeof (float128));
>                        if (++next_arg.f128 == gpr_end.f128)

	Jakub


  parent reply	other threads:[~2023-05-05 21:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04 19:29 Peter Bergner
2023-05-05 21:39 ` Peter Bergner
2023-05-05 21:42 ` Jakub Jelinek [this message]
2023-05-09 20:24   ` Peter Bergner
2023-05-09 20:50     ` Andreas Schwab
2023-05-09 21:20       ` Peter Bergner
2023-05-10  7:34         ` Andreas Schwab
2023-05-13 17:16           ` Peter Bergner

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=ZFV4KtC7lNBZNJYb@tucnak \
    --to=jakub@redhat.com \
    --cc=bergner@linux.ibm.com \
    --cc=dan@danny.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.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).