From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2067.outbound.protection.outlook.com [40.107.22.67]) by sourceware.org (Postfix) with ESMTPS id B67753858425 for ; Tue, 22 Nov 2022 13:10:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B67753858425 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=5+sZl80+S7UVRslNKI7467Ya8IxjZbz9mAdIhEZYwyY=; b=guF/1YK8vNS+zbXcxYpRR7AE945m8V2zU84M/nLXAuLhcmX84ZLLmY7eI5xxKbyUa9fP9g4ByMHw+QlT/54pxbnSq0m84YtI1AQ2CQPJ5BK5LaBbPOkLLNTxZgX7NVruDHjgC9E0CavLdtJvqt62R2QKw4+AN1TT3CBq6AFntzY= Received: from AS9PR05CA0040.eurprd05.prod.outlook.com (2603:10a6:20b:489::23) by AS8PR08MB9429.eurprd08.prod.outlook.com (2603:10a6:20b:5ef::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 13:10:09 +0000 Received: from VI1EUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:489:cafe::40) by AS9PR05CA0040.outlook.office365.com (2603:10a6:20b:489::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9 via Frontend Transport; Tue, 22 Nov 2022 13:10:09 +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 VI1EUR03FT042.mail.protection.outlook.com (100.127.144.197) 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 13:10:09 +0000 Received: ("Tessian outbound b4aebcc5bc64:v130"); Tue, 22 Nov 2022 13:10:08 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 9de333b03fabb1e4 X-CR-MTA-TID: 64aa7808 Received: from 6f793b09fae7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D093DE0A-6E3D-45A9-80C7-A93ECE4CE115.1; Tue, 22 Nov 2022 13:09:58 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6f793b09fae7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 22 Nov 2022 13:09:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OTxWDPCZ6F9kthfbKEdZ/I8PXGsd4hYkza0Aqs8JoKe7pbBV8pjblLArhUk92wJUHxx9VhWT68JA9FBzIe+FLim4JxK2U8GEMQ4x4SuamRS/eM/SK6cR9vUJTn3ZNr1QqKWE8I8RbaUOwgMebgYLiw134tW4cnbbPRaFKcaGJ/N/4zgyGQ//GPkK1jma8USvZeRedx9OOh4ZAdt6j2+L9LHrQFcOBsImxhkTmfWB/3PKj7HPyuEAUx7Xc2fWb9a1M8ac/sQZE4k5TpN/8LcoyrhZXkAWxdc7g6fGKGl+XxhvVoC0J/ssqMazpQChe/qqfZBnAwQ6rdofaRoR4aCmdA== 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=5+sZl80+S7UVRslNKI7467Ya8IxjZbz9mAdIhEZYwyY=; b=ADl5bsW1AKDGASxaXxoVZhzrWNwMaufCgqu2s1NgUp3BCAEdSsUPCqzsegGyQvyo1fM/tn0E7qfiK1JWC7IX7NrBUewIFCns9abr13ANYYtTBkQcU+4/FkYyqEbUTCzlPc0d3xgwGtzojJjI58HZIQycV8N+YJIrc8HC5rjKEjleR86fl0ETbrcU2YqoFKDnE9l1kG3fM+w0Nz5P1UYJcPTYaQfAyunu4V3XjO3keHvAmamZ6aajPxQI3gqlxK+vK1N/1DBrncpzOZ7NlsWvdo3yxL4rQ9Ooe6mvUYkhu5+yNUIyBxTKe2UvVN/DqU9UlryPb1pGuTlgBwsrYE6kkA== 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=5+sZl80+S7UVRslNKI7467Ya8IxjZbz9mAdIhEZYwyY=; b=guF/1YK8vNS+zbXcxYpRR7AE945m8V2zU84M/nLXAuLhcmX84ZLLmY7eI5xxKbyUa9fP9g4ByMHw+QlT/54pxbnSq0m84YtI1AQ2CQPJ5BK5LaBbPOkLLNTxZgX7NVruDHjgC9E0CavLdtJvqt62R2QKw4+AN1TT3CBq6AFntzY= 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 AM8PR08MB5697.eurprd08.prod.outlook.com (2603:10a6:20b:1d7::24) 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 13:09:55 +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 13:09:55 +0000 Message-ID: Date: Tue, 22 Nov 2022 14:09:55 +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: 7bit X-ClientProxiedBy: LO2P265CA0452.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e::32) To VI1PR08MB3390.eurprd08.prod.outlook.com (2603:10a6:803:7d::27) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3390:EE_|AM8PR08MB5697:EE_|VI1EUR03FT042:EE_|AS8PR08MB9429:EE_ X-MS-Office365-Filtering-Correlation-Id: d8ae297a-ac08-42d5-49ba-08dacc8ae1f3 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: O8euxn9Uzd6eCaIIUvJdPD94t4IUGsgSyDNFYzDX0KzSyFJJpz2tNSosUoGpu3/3ctvJx1Gb276y7YZCTJV8rPpLJ+oqKk7bHCek/3M5vQHdXFxqEsynA60RHeUxMVyUBYDsqz6DDKqGubpBhY/yfsbyKviQeEiN1EJ37Nl4gnInPSERAQqvBChW1TK1esuPlMgL5Kpa/e4PeO1pPe3gKycaPnuU/c+7g2lSbezevEVgjVVxFxubwK4Sn/SS9/lKauvClO0q5D3J5rbZb4gDlukeo29HMmP5nRYJrhzWb+h3jIG3wIuQhQF8X7b1rMl/Hne3AwJ/UWlLQ/CRWYgnXv/umul1ydjVksyRDZqTjiUMiW9fvvFtRfC7MxuxQ3AfRx4d5FzPRDwwFSjMo+cXXl0JvBuUDSXxowajc0sRQeFtDHY3bDctWGccBgezrmlRbeN187CMCU+l9Zx33PGPTaqQsCSBjMA+mEZIK3w6Nj3DtUZTGBYQdgj+D47U341Sy/IR2kw1kz45BtV34MEyiKb5gNl5kxNoBiJhTjE92saYamxkR+KSSJJheq2yK0Qrq3vMTnu2eoJA6vXL5gi5Tb+Dqqba72qTxFcKFK8h+5ZTVe9+j8WmDWXULS9lgK1oz7KqClohikuUX2uKKGLgrt1M3eD1cz5+Mp6uhyrKOIMAmin2x6KMp2CTuYhl5KFg/CM54iDkIDguEpSO6mpCdBoJVmNKNFAEVGq1gvxURrWksEy0X+IVDluT5PibWSRek4AKtM3m7jkSWdTuSFwV+IMnbzgKNgLMVByZvlQsjuQ= 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)(396003)(136003)(376002)(366004)(346002)(39860400002)(451199015)(31686004)(2906002)(8936002)(44832011)(84970400001)(66946007)(8676002)(36756003)(38100700002)(66556008)(316002)(66476007)(6636002)(110136005)(6512007)(41300700001)(478600001)(6486002)(6506007)(26005)(5660300002)(53546011)(186003)(2616005)(31696002)(86362001)(83380400001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5697 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: VI1EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2bcba55a-1b8c-4948-2f62-08dacc8ad92d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7/oEIUmopXHXIcL6gamrmM5s93AYIMlrmOTHD/c49TQbXFX2EhlqrJu+rUBjANoUPLE8VUWzuX/1FbJ3+5211Zn0S2Dp986rbSUhSjb6oAki4XS/d7dWDpz2Jmp/7693iMw2GbsABTg9TKt3I1YfQLn171l3eSxHNmD6FJBITOsbJPVmOjcW64TTDtRRAxHDhrNVG49J4PSWTmO1LTxEs3lwx1OU7wT/NFY5GgEq5OIQs0VespFxIqFkFqWcR9naDFHyHApaQMPWvRP4VtFLpGf1cxM9l4oPiUZwpVwXvUnRaex+VOwTQ+l6vTJTMv7C+hneZ7U08GbdvGYgOod5zp+eXCzG2QgJWI8h0zwoK+pScHo58ewHyEIdDAahLeEBy/g5GauBWzL4W03H+MXaC2eRlcY1EPj0hH02we1TYaIuxdRFQJRZHnznA5BqxXMJRIs2TbbL7wXIud7wpTER0Jhb9XcLFxBu6k1gZFkekJ3dqXB5ZLm4gxKDYWxsktDGCgk7ogAoIjPA2dfyeJ8moFc4F9rU0qDFgfGrWdUhf2pkWV53687lg+taYiBqrrV+JI5HMhDrrCH51Zuhl/hRUdbhubBM/M8xTQ7FfOA+XFiDBlTi3RzAWKx7yKZfgBVZDy+O9wy5fMp+pn8SlnT3GTiTJX8RAQCqOfM1XDvJTq2NRgD4l+ltVcz2eTtg8YVaogPPZZnThbBUNmRd4nBzvJErwWqiGGqZIcxgS9GaQESDPkkMA2cQYJIikrpjk2t7oKbI2E92GblRqDO5+CsGvScgkE14OxRcWc7OnjBeZ+R813DoK8XURzdGQ1hSwLDL 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)(396003)(376002)(39860400002)(346002)(136003)(451199015)(46966006)(40470700004)(36840700001)(36756003)(84970400001)(31686004)(86362001)(81166007)(82740400003)(31696002)(8936002)(83380400001)(8676002)(356005)(2906002)(36860700001)(70206006)(70586007)(40480700001)(6636002)(110136005)(316002)(2616005)(47076005)(186003)(6486002)(336012)(478600001)(5660300002)(40460700003)(82310400005)(41300700001)(44832011)(6512007)(6506007)(26005)(53546011)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2022 13:10:09.3623 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d8ae297a-ac08-42d5-49ba-08dacc8ae1f3 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: VI1EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9429 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,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 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.