From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70051.outbound.protection.outlook.com [40.107.7.51]) by sourceware.org (Postfix) with ESMTPS id AF4993858C27 for ; Tue, 22 Nov 2022 16:32:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AF4993858C27 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W+eZM0KoTv+cIeLRCI3H9/YnG6LXyco3WYxBLFbK6kw=; b=N/yGFxfuwaTxk7yrcN45QJt4f5ZQjYs6fKwCSWHe9F85i0E0GjgfB6JYxgWRW3nr4hUPS2YETwrzoglco17GCsfotXsmSQqqxLzY7wEDPdrbFqEIYmhePhnGRnoRj4vT2XerLuPtzHzDPy6Vx7QGm0/UFuFhI/8JF/m0kEmYX3o= Received: from ZR0P278CA0004.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:16::14) by PAXPR08MB6333.eurprd08.prod.outlook.com (2603:10a6:102:15b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17; Tue, 22 Nov 2022 16:32:00 +0000 Received: from VI1EUR03FT036.eop-EUR03.prod.protection.outlook.com (2603:10a6:910:16:cafe::2d) by ZR0P278CA0004.outlook.office365.com (2603:10a6:910:16::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15 via Frontend Transport; Tue, 22 Nov 2022 16:32:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VI1EUR03FT036.mail.protection.outlook.com (100.127.144.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.8 via Frontend Transport; Tue, 22 Nov 2022 16:32:00 +0000 Received: ("Tessian outbound aeae1c7b66fd:v130"); Tue, 22 Nov 2022 16:31:59 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 60ac6d0e805534a0 X-CR-MTA-TID: 64aa7808 Received: from 312790f3f9cd.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A58D5290-C48B-4149-9817-BDEB7CD9AE49.1; Tue, 22 Nov 2022 16:31:52 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 312790f3f9cd.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 22 Nov 2022 16:31:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y89OwsMweYUGe3p/sVv/8pdatm44yAjhS8FXsG4NYm3BKBdXI5hm1JgR/msf7wQ6z2g6ETVujGQ4MzArsq6nN2F2/MPcTtS/kt3wF59EWxs9RqquBTsOP4CvFIgkD0GHMlvJvR8rvwAtqs/zSnwse56C++dqY6t+Q+UZ17HteQs8Mws3VDlDJWA1efoB5sEYltbUzpoj89IMV4GDD92oIJqF5bCdc7mMYZQ0c6iGfDlnFPG28XlPlrGgy4k7MDi+lzMQ0sv0gVmZlPf9/p6fMDm+Uv5s0wbM/Lm0ss+9vCt+0PYou32UzQ9PVQy75CIpZdt+34uerPecFKJbgCVjIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W+eZM0KoTv+cIeLRCI3H9/YnG6LXyco3WYxBLFbK6kw=; b=fkesFMBPQ5rWolfMaRHa1uisOikTbvnXokb/S0y2SrYVbaCFPHy0AsGo0v0dQOssocwOIRrRNxf1SUvepOITcn6cTzvFwm9+DrxCsRcHbF8ws1o4c8aCO+DMEZt70Du5bga9+mke6wcJ9qwk/KT9WarGaE99FKjcY0G+zRbdgZmJI2S1fVE8kvnXUiIrYYTH5YwNsf6Mk8sb01uhbhDQaWaWPHoiP+2Deb0c0LH1QyVSwoGgYRjoDIe8AG/AsxtuS0JLszwmjQGPtXzjm45eWeRXIo1gRf2qn6zecv9wVPpVNwkiI4cHmL84Uks8z+IJs3A5ZfpEJGIqd1VN2oTH7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W+eZM0KoTv+cIeLRCI3H9/YnG6LXyco3WYxBLFbK6kw=; b=N/yGFxfuwaTxk7yrcN45QJt4f5ZQjYs6fKwCSWHe9F85i0E0GjgfB6JYxgWRW3nr4hUPS2YETwrzoglco17GCsfotXsmSQqqxLzY7wEDPdrbFqEIYmhePhnGRnoRj4vT2XerLuPtzHzDPy6Vx7QGm0/UFuFhI/8JF/m0kEmYX3o= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3390.eurprd08.prod.outlook.com (2603:10a6:803:7d::27) by AS2PR08MB8502.eurprd08.prod.outlook.com (2603:10a6:20b:55d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.17; Tue, 22 Nov 2022 16:31:50 +0000 Received: from VI1PR08MB3390.eurprd08.prod.outlook.com ([fe80::980d:b4a6:d4a:bb55]) by VI1PR08MB3390.eurprd08.prod.outlook.com ([fe80::980d:b4a6:d4a:bb55%7]) with mapi id 15.20.5857.017; Tue, 22 Nov 2022 16:31:49 +0000 Message-ID: <303a383e-bd05-d8ca-1b3a-9f52398d4d31@arm.com> Date: Tue, 22 Nov 2022 14:07:04 +0100 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-US To: Richard Earnshaw , 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: Christophe Lyon In-Reply-To: <2f19640b-6900-5062-472f-5896f55bc6f7@foss.arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0303.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:196::20) To VI1PR08MB3390.eurprd08.prod.outlook.com (2603:10a6:803:7d::27) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3390:EE_|AS2PR08MB8502:EE_|VI1EUR03FT036:EE_|PAXPR08MB6333:EE_ X-MS-Office365-Filtering-Correlation-Id: c06a8072-65b1-41e5-a36e-08dacca71485 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ZGd8T4y5aipnllTkEXjOQXlzS7CS/4xDkQWRoTM4tM6bdsdIVaCUuBKytu7mBH17fcHhVm+W0nzaBaEmyIt+FrSJrLMQVoePweawkaevezF4cPp+Q3LGPafSPurao9J9277/RZKKAuGBTS+aLp1hwGXqAn71FKX2daN82tbwU1/ePjo8R8dq9TrxMCZcVmopUHaBR/AA70JXeAY1opTNRV1a+lUhdf7GF80kVk2cd9Jh9ID6JfxZxtLAhTE2+VL9cAi0ooYMqJTQzCFdlF3MmLsAAJxpMW7/WVjYh+p72RzPTbelto+mnnW11L76tJycbFF41My+TdDvVTwnUf7BVtwvfrhqI4o0EHTfKj11zwhpfT6nFDGH2EoShJBY4fJZI6/J7uz2WlnXMbXTTz6lZQSZMLaxP5zXvhoLUbZbX/Xv0WI7sOlfMKQxHsvYtg3jrFZo+FmlfpLRMhvSekSAsIAnmSP9flVfBRb/MWqTbdTH3Hl9lqSIdMHMVuoC3gnsxukctJT/OdCGFIWQPGaz7OU2Wd/4UUoc+qCl5925cbUdddjuMILrCy3rQHqj4ieMf9hoZHHy7snwdSs9XkfRjTzLKMF8rPatn1wCaeKroWwfWaE1zdCn6K6Gg6FVkHQM0EwVls4yU3HrqlZjJJueeIYPD4iyHF8yoe2g+Dl4jRLIZXXs4z/+hff5hq+yeNnTwtG5e5hTHlfqI7h08CNm9REfhfDasPgh/xo/QedYYmtioKrzgpnHg2cKOCOhnZ/kAQ/u/iqVo2QsXJF6Oy/dMo7HfZLlSxxy3pDEug5n8/I= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3390.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(396003)(366004)(136003)(39860400002)(346002)(451199015)(478600001)(41300700001)(186003)(8936002)(2616005)(84970400001)(6486002)(31686004)(6506007)(38100700002)(6666004)(6636002)(110136005)(6512007)(316002)(83380400001)(53546011)(26005)(5660300002)(66476007)(8676002)(86362001)(31696002)(66946007)(44832011)(36756003)(2906002)(66556008)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8502 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT036.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c1ca6e75-f50d-49cd-7b7a-08dacca70e32 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r7oxVQo7M2/gLsD9Z6aGVbvnJfaf5zrkQGqV9THi2WPQvhAOVWP6q0eOSsWynpDU6NduC0sAqQDjMFTAkpe04NHaTfBcrnr28Lh9mvRjDAn+NYoPNFb+VBs+zKP6Fv3NWVherOJONLpUP/9zD8+FWDFi3Ibro+rJTUjKvLy0HcRyZgKYfZi3Xb48NvTTLSmUh+VOFQXXmwIVu8XEAZlpolvWje9BsGQn2A5lvobq1agLXKzoQr6fZkOi+jdJvF8vnajyMkK1KdVr3dZ7gVioDAYvt1qVJNP980rW/nBHlQcOpd4hw2TB2Iq8K5vCd2rsipbvX38sPI8JT/yA2qwgEhqf5bxyt3uQc07DRmpt7DxMlJPRsquC9EVFAeAv7ie1liewkhD9x6S1Oc9gD9jZt/GSIm8Tlzy/vj2/VuQd3AczzVKatN59M1djR8aUhx8CrS1UM4W2fxO6FvloiVRAy9mZU27+Rx+VVfaHDSSfqOpQy8CB2IfrAujlcrIfqdCMNZtc+Id+QS4Eq3I+4QyM9vCmxU2aqBTV0US4NbG8OPYO07o+NH6cXk9Ke9zHeZendrdE84XbVSx+HDAODzVWsbc2GMxte2urHKhj0pY1lhmtRN0FrXupVjmHYJ8IJkAW5n5ep29RmFL959ru1UNwlYnj/El3z1KVvFzV6wgE+FPPdxfFJVJ09Kllt38ZpsR9KVY8+Pczj8HrDMKRDjk+cFlD4AsgUav+R0vmoxJ265vmZKFuc+TDF3zS4DWicHaG20r2wwMZpRF60LmsOEsZBcE58dqmk2Hs2bk4vh2R6jcXDMIMbpqrPwGRgtXJaQcp X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(396003)(376002)(39860400002)(346002)(451199015)(40470700004)(36840700001)(46966006)(6506007)(356005)(110136005)(26005)(81166007)(2906002)(86362001)(83380400001)(36756003)(31696002)(6486002)(478600001)(6666004)(40460700003)(36860700001)(53546011)(82310400005)(6512007)(186003)(336012)(82740400003)(2616005)(47076005)(44832011)(8936002)(31686004)(40480700001)(41300700001)(316002)(8676002)(70206006)(5660300002)(70586007)(84970400001)(6636002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2022 16:32:00.1160 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c06a8072-65b1-41e5-a36e-08dacca71485 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR03FT036.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6333 X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,BODY_8BITS,DATE_IN_PAST_03_06,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY 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 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 quite a few tests under aapcs64 which have a similar #ifndef __AAPCS64_BIG_ENDIAN__ > I notice the new ANON definition is not correctly indented. > > R.