From: Christophe Lyon <christophe.lyon@arm.com>
To: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>,
Richard Earnshaw via Gcc-patches <gcc-patches@gcc.gnu.org>,
richard.sandiford@arm.com
Subject: Re: [PATCH] aarch64: Fix test_dfp_17.c for big-endian [PR 107604]
Date: Tue, 22 Nov 2022 14:09:55 +0100 [thread overview]
Message-ID: <c3b315c5-33ec-7c8e-d472-30e48137ff0b@arm.com> (raw)
In-Reply-To: <2f19640b-6900-5062-472f-5896f55bc6f7@foss.arm.com>
On 11/22/22 12:33, Richard Earnshaw wrote:
>
>
> On 22/11/2022 11:21, Richard Sandiford wrote:
>> Richard Earnshaw via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
>>> On 22/11/2022 09:01, Christophe Lyon via Gcc-patches wrote:
>>>> gcc.target/aarch64/aapcs64/test_dfp_17.c has been failing on
>>>> big-endian, because the _Decimal32 on-stack argument is not
>>>> padded in the same direction depending on endianness.
>>>>
>>>> This patch fixes the testcase so that it expects the argument
>>>> in the right stack location, similarly to what other tests do
>>>> in the same directory.
>>>>
>>>> gcc/testsuite/ChangeLog:
>>>>
>>>> PR target/107604 * gcc.target/aarch64/aapcs64/test_dfp_17.c:
>>>> Fix for big-endian. ---
>>>> gcc/testsuite/gcc.target/aarch64/aapcs64/test_dfp_17.c | 4
>>>> ++++ 1 file changed, 4 insertions(+)
>>>>
>>>> diff --git
>>>> a/gcc/testsuite/gcc.target/aarch64/aapcs64/test_dfp_17.c
>>>> b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_dfp_17.c index
>>>> 22dc462bf7c..3c45f715cf7 100644 ---
>>>> a/gcc/testsuite/gcc.target/aarch64/aapcs64/test_dfp_17.c +++
>>>> b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_dfp_17.c @@
>>>> -32,6 +32,10 @@ struct z b = { 9.0dd, 10.0dd, 11.0dd, 12.0dd
>>>> }; ANON(struct z, a, D1) ANON(struct z, b, STACK) ANON(int , 5,
>>>> W0) +#ifndef __AAPCS64_BIG_ENDIAN__ ANON(_Decimal32, f1,
>>>> STACK+32) /* Note: no promotion to _Decimal64. */ +#else +
>>>> ANON(_Decimal32, f1, STACK+36) /* Note: no promotion to
>>>> _Decimal64. */ +#endif LAST_ANON(_Decimal64, 0.5dd, STACK+40)
>>>> #endif
>>>
>>> Why would a Decimal32 change stack placement based on the
>>> endianness? Isn't it a 4-byte object?
>>
>> Yes, but PARM_BOUNDARY (64) sets a minimum alignment for all stack
>> arguments.
>>
>> Richard
>
> Ah, OK.
Indeed, it was not immediately obvious to me either, when looking at
aarch64_layout_arg. aarch64_function_arg_padding comes into play, too.
>
> I wonder if we should have a new macro in the tests, something like
> ANON_PADDED to describe this case and that works things out more
> automagically for big-endian.
Maybe. There are many other tests under aapcs64/ which have a similar
#ifndef __AAPCS64_BIG_ENDIAN__
> I notice the new ANON definition is not correctly indented.
It looks OK on my side (2 spaces).
Thanks,
Christophe
>
> R.
next prev parent reply other threads:[~2022-11-22 13:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 9:01 Christophe Lyon
2022-11-22 10:57 ` Richard Sandiford
2022-11-22 11:09 ` Richard Earnshaw
2022-11-22 11:21 ` Richard Sandiford
2022-11-22 11:33 ` Richard Earnshaw
2022-11-22 13:07 ` Christophe Lyon
2022-11-22 13:09 ` Christophe Lyon [this message]
2022-11-22 14:03 ` Richard Earnshaw
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=c3b315c5-33ec-7c8e-d472-30e48137ff0b@arm.com \
--to=christophe.lyon@arm.com \
--cc=Richard.Earnshaw@foss.arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=richard.sandiford@arm.com \
/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).