From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 9F9083858C27 for ; Tue, 22 Nov 2022 14:03:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9F9083858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=foss.arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C13C91FB; Tue, 22 Nov 2022 06:03:30 -0800 (PST) Received: from [10.2.78.76] (unknown [10.2.78.76]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B751A3F73D; Tue, 22 Nov 2022 06:03:23 -0800 (PST) Message-ID: <599f8b0e-5e7b-3676-3e38-9d58ff451ba2@foss.arm.com> Date: Tue, 22 Nov 2022 14:03:22 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] aarch64: Fix test_dfp_17.c for big-endian [PR 107604] Content-Language: en-GB To: Christophe Lyon , Richard Earnshaw via Gcc-patches , richard.sandiford@arm.com References: <20221122090114.38090-1-christophe.lyon@arm.com> <2f19640b-6900-5062-472f-5896f55bc6f7@foss.arm.com> From: Richard Earnshaw In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3495.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 22/11/2022 13:09, Christophe Lyon wrote: > > > On 11/22/22 12:33, Richard Earnshaw wrote: >> >> >> On 22/11/2022 11:21, Richard Sandiford wrote: >>> Richard Earnshaw via Gcc-patches 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__ > Yes, it could be used to clean all those up as well. > >> I notice the new ANON definition is not correctly indented. > It looks OK on my side (2 spaces). Never mind then, it must be a quirk of how the diff is displayed. > > Thanks, > > Christophe > >> >> R.