From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2081.outbound.protection.outlook.com [40.107.22.81]) by sourceware.org (Postfix) with ESMTPS id 12F6B3858C54 for ; Tue, 22 Nov 2022 10:36:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 12F6B3858C54 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=WeU6oUuCx0zHqaLTX8EdiTBPt4mbOtn2zzvY+P1ISxA=; b=vvDUdxlJhCYSPCU5GDzEiBMEcQHvcefp72OMHrSGi9hr0dm8ZY2Iy9obEi3FEtTFI1GxZ4Ug8Pj2JrHCWH4iESwrEFoky/LHbXtIkZV0p+EThqaUtSZINhyqfuKbEZjkwr+0VDxBhtOmqAmSQkq1XbhaKwD/liewGdAWZx2IPBQ= Received: from AM7PR02CA0025.eurprd02.prod.outlook.com (2603:10a6:20b:100::35) by DB3PR08MB8961.eurprd08.prod.outlook.com (2603:10a6:10:428::14) 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 10:36:18 +0000 Received: from AM7EUR03FT018.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:100:cafe::3b) by AM7PR02CA0025.outlook.office365.com (2603:10a6:20b:100::35) 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 10:36:18 +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 AM7EUR03FT018.mail.protection.outlook.com (100.127.140.97) 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 10:36:18 +0000 Received: ("Tessian outbound 0800d254cb3b:v130"); Tue, 22 Nov 2022 10:36:18 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e9b95027cb9e44ba X-CR-MTA-TID: 64aa7808 Received: from 8d90c5b507b1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 93CFB138-B322-4951-A486-C4C1EA070F6A.1; Tue, 22 Nov 2022 10:36:07 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8d90c5b507b1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 22 Nov 2022 10:36:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JWxGADPD0OD2PQFvtnZl1FfRPrpRJpeopLUWLcFxZnOaMeDIxlb37lgC+49e777LrKhxVKiUqlkoFGDbn3cw6caDmyej+Z14NBiPcQyj+Y9VK6C43/5+7OyFoIo7ZkBqlCogOWGWwXAiT6k2fWlGj+TGWPpA8pMylYEm3ydxfIdK7j8p68dUu+56K2DO97UEHbzMzs+FfRjzIHgsHF+BtCVZXqIsd8j2SluGN+P+C6djB8F+OWiQhRb7bssIzvb71qpA1GPNqVy9n/6770pke2c9FAiupVVW38afQsvZ7bQc9oqOUn2sOpWk91bfpAvNCW+UvVTS5FHdRBKyIJK4EA== 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=WeU6oUuCx0zHqaLTX8EdiTBPt4mbOtn2zzvY+P1ISxA=; b=aC6PJ9x8JU+3f98731y8rGq5ch5fHRj0ebiHPO8LjZHuIzzSMMKC2rWXPs2YmAR00Jco88PPLLZy+OJUJpnAKD7XBKWuVG0xQOQXrDqDRJuRQgJnadO7Kl0jIP0ZEms2fI4DHPVOYu+UbaJt/FDqufClgadqTzkIOKxKyYbDGUy1w1Tk/BLL8x1Z4yr5/0++syDQZVLXHpk9GgM3qaztLwT2pQmXpiamIocrsmBQK++37jR5QfSoQn+tyF3qCbIHLoq3xxT6TKEGFnAnaAmWa8vMz/eQWGX0opSdCo8TZ9r3MlpFFDKS/sP6rh2tkaBkpVz06YbcPsjwqu4a7wUJFQ== 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=WeU6oUuCx0zHqaLTX8EdiTBPt4mbOtn2zzvY+P1ISxA=; b=vvDUdxlJhCYSPCU5GDzEiBMEcQHvcefp72OMHrSGi9hr0dm8ZY2Iy9obEi3FEtTFI1GxZ4Ug8Pj2JrHCWH4iESwrEFoky/LHbXtIkZV0p+EThqaUtSZINhyqfuKbEZjkwr+0VDxBhtOmqAmSQkq1XbhaKwD/liewGdAWZx2IPBQ= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by PAXPR08MB6367.eurprd08.prod.outlook.com (2603:10a6:102:15b::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 10:36:00 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::4c73:7d14:fc39:a3cb]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::4c73:7d14:fc39:a3cb%3]) with mapi id 15.20.5857.017; Tue, 22 Nov 2022 10:35:59 +0000 From: Wilco Dijkstra To: Richard Sandiford CC: GCC Patches Subject: Re: [PATCH] AArch64: Add fma_reassoc_width [PR107413] Thread-Topic: [PATCH] AArch64: Add fma_reassoc_width [PR107413] Thread-Index: AQHY9DgezXT8hXnv2EGnjnt4gJ97Ga5Kp/RSgAAmFfI= Date: Tue, 22 Nov 2022 10:35:59 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: PAWPR08MB8982:EE_|PAXPR08MB6367:EE_|AM7EUR03FT018:EE_|DB3PR08MB8961:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f036d57-4406-4136-f86f-08dacc756407 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: n8RDrYSueVhYdOfTSc+HDcWIHY2vrdn3k9Puaa5l0ypzW9hrw1lY6apdzOl+ON9cC4O3l+61/VGOxPMkUxH9R8dgke80eh55C1wJxjZOfECF4fCmtUPXjAsCuAoxq8wZrCwDwlyDeXpN8ToNRtMviosUGcxeJAwHV5Ww7ei0Sud/ly8ZTRqcj7cOC4+tGAuiHfc2OK5feyBbzhr+Njhe9PVv9ckmUSHflqZOC+St1eA1yHt6WGe52e0ZazfkgfbC9F6EI2gvGCOiAQQ/6wSFNUC85Ft0eNSsTJJY6NFx8GOMweNrB8G9mfFl388jka3B6KvW6uNMEz/D7oFgAn4vVl67LQHa0CBSSiu/cuI49eDfMIe5nfPWUMT6Hdzf5yqShXMDfnD9eMaL541J891OLVxMXOlxtKPq+smff3qwEm6VSZYiegABo/UQSFyIfVVp/iwrcQcClBOFUoBghZw806Q8sZXL2mkmWXe1KW6lgi01cROtu1z1s67Th+unZfCkZgTjuxjbvYtiA8u7nvnO+aobR98Y6T2q/uy0s7dLUFE+o5FFmYs9pvuMfsP9F80shJLItkBm0q1at2CBcWFTrjwa4qnM73sy2xJsHMQ/CfiCY3kQzc/vZIeOAo+HTsxWJxV4xRy3yINlmI7I72m9BUiqUneoqkgDB+NvtolibUiMs9nSdT9oWioo1U7QyedZ88/+CoQRao2cZi4+keLJUg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAWPR08MB8982.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(366004)(136003)(396003)(39860400002)(376002)(451199015)(41300700001)(6862004)(8936002)(5660300002)(66899015)(4326008)(316002)(6636002)(76116006)(66556008)(66946007)(66476007)(64756008)(8676002)(66446008)(91956017)(52536014)(478600001)(71200400001)(2906002)(9686003)(6506007)(7696005)(186003)(122000001)(26005)(38100700002)(38070700005)(86362001)(55016003)(33656002);DIR:OUT;SFP:1101; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6367 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: AM7EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b489253c-8132-4b1a-88e4-08dacc7558bd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fquC9ofZ9F/gdLS0IKCrccL1Y97nUslma/sRoCumZWKNTzZ38kLVijrm5Lr8pR8k6FNKApDNu30OilD204Te3GsQbDDrNEBq/6cfcODoSyIZPuCViZYh7letb+E8l9HJBN3k9z0T/SLBiJsPfpAabV7lFHX8T9Z/hAjB5l0fchBG9XySUUdkzlXqU6V7qdcOv8SyRcq+iz+kGBnJ0+DOT/6zYEdizPGP9E9qTzI5m6B0Bny1nn9XbvB48wwbrcoTjkPCITHH8Zcrfx7WvNBMRyhQptk8jrk1Uk9vZCSBa3I/Ex+iJurf2izGovNMzBvRaBo6QyiHP7ZS9JMtq31J8hWSPPgC+97aNNLz5ojD4bW4PaEawpNqGe1BkbOhbJjC0r8rteyabvrBko49E72VBTpyR2TgruuLATDJV0WjID8hAz5A9noh5Nr/TbcS9Bm40HKy+aHAat045GeEUB2rDigQbqFGHmqaBPUp80U54zDgzz3nubFaflRDSXxSJ5rkDrE+dhehFrch00ok+ybQGwYB7nO/vALVbk1/u8vczzEmcpu/8R1ayH8LuDiBNOP4oMf59tmBebojbIYTFb9m+n8qAbZbK5VQ72cGA/wp9fmojU/H4ty9wJzGWbwfIOjzpY9gLZd+A1QNe7ZWIDHijrLgz/tZkHztCu3l1OsTdfjoEooPfkdMQHSM9Te3bDegKsF5WK81lQjL9q6WXo5zVw== 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)(39860400002)(346002)(376002)(396003)(136003)(451199015)(40470700004)(46966006)(36840700001)(8936002)(66899015)(6862004)(5660300002)(52536014)(9686003)(41300700001)(82740400003)(8676002)(6636002)(356005)(81166007)(40480700001)(478600001)(33656002)(4326008)(70206006)(70586007)(86362001)(7696005)(6506007)(316002)(2906002)(47076005)(186003)(36860700001)(336012)(55016003)(26005)(82310400005)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2022 10:36:18.7205 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f036d57-4406-4136-f86f-08dacc756407 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: AM7EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8961 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Richard,=0A= =0A= > I guess an obvious question is: if 1 (rather than 2) was the right value= =0A= > for cores with 2 FMA pipes, why is 4 the right value for cores with 4 FMA= =0A= > pipes?=A0 It would be good to clarify how, conceptually, the core propert= y=0A= > should map to the fma_reassoc_width value.=0A= =0A= 1 turns off reassociation so that FMAs get properly formed. After reassocia= tion far=0A= fewer FMAs get formed so we end up with more FLOPS which means slower execu= tion.=0A= It's a significant slowdown on cores that are not wide, have only 1 or 2 FP= pipes and=0A= may have high FP latencies. So we turn it off by default on all older cores= .=0A= =0A= > It sounds from the existing comment like the main motivation for returnin= g 1=0A= > was to encourage more FMAs to be formed, rather than to prevent FMAs from= =0A= > being reassociated.=A0 Is that no longer an issue?=A0 Or is the point tha= t,=0A= > with more FMA pipes, lower FMA formation is a price worth paying for=0A= > the better parallelism we get when FMAs can be formed?=0A= =0A= Exactly. A wide CPU can deal with the extra instructions, so the loss from = fewer=0A= FMAs ends up lower than the speedup from the extra parallelism. Having more= FMAs=0A= will be even faster of course.=0A= =0A= > Does this code ever see opc =3D=3D FMA?=0A= =0A= No, that's the problem, reassociation ignores the fact that we actually wan= t FMAs. A smart=0A= reassociation pass could form more FMAs while also increasing parallelism, = but the way it=0A= currently works always results in fewer FMAs.=0A= =0A= Cheers,=0A= Wilco=