From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2053.outbound.protection.outlook.com [40.107.13.53]) by sourceware.org (Postfix) with ESMTPS id A9B86385841E for ; Mon, 27 Nov 2023 14:38:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A9B86385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A9B86385841E Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.13.53 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1701095909; cv=pass; b=Z1CLuz1LWKHeyMs9D9+6M4eqOqg69CgpCVhe3H1UCm6bH1JhRgUq8LeFR5n+m1ZKZCkVxTc3YPwxTXG+92MNc1ayBduLw+34kiS4bTRgxo+wQH2/7hiFc9rH68T6HekGdiuqLANrWHkA3T5KAROAZcKXvjbp/R2wj4yLwcqN4yc= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1701095909; c=relaxed/simple; bh=bVoT67A6WIqVRF24nt7sy66oGnALp5LD9JMI1e+cPM0=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=ezCeB4pdDgQA3GI8u/7rpJQeWWoJo87DwZ+a8gPyPDLlLqeWmdpTydCMTE/KCAA3FaXEWr0c11dEVp08VkcdyRmFvT4iC6jw5Tt/VxFMO/FT814UfvOjhLbzxwC//4qafpykVb5jqLNhqz7bn2OpPA/+CgpaJVyCnS49IcLIxaQ= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=e+3TlyexYXNzE6n73oUJg1R5cUP6vJ0Wne+3Pm1yVv5XaQg61qOHAFGlDAs4yLcrbij5WEk/BMvrd1orrScz5ThfCf5x/K9nx1+AcUQUKw5pg9q1znb0ZgGhp8EtyQncSHraE3Gl9Zug6p/XeIPlcvrlM2fFLnHYrrJ0DASx5xczTGj7BhMNm/fNn+NZXLGxubRudk4qGlIwkDggYlyA5xuL4UvtYMfilFZOunuP2zsSIJDMHoJhciudRIG4xZ5lkYgdCHgSyJ4pC0u1TUINBAEytYOoEVJ6MfnbJBXwJj/SlLoMm6WcNjMo3ZuEm+ko027PwTkY/oPZhNLUr0C2qw== ARC-Message-Signature: i=2; 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=bVoT67A6WIqVRF24nt7sy66oGnALp5LD9JMI1e+cPM0=; b=dJiPt9GGarZBp64WOGILsbYr4QnRso3vz9KTfnCPKq3U6djkejYiUIKVSLywSOp16vXkjwIFhvG+GV0BTunH6t6JmihvpGukq9UgpuguOwXkuvIqfBpPbONg+38ROfk9WglwsqP50mRzAWRs2NCnjAqrNou2RtOnyqXRomiRp66QZVOVqUT01GDsduAXV4dMsYFHP+Dfw6yWmP8J578fEuxyZ3ICFR4ZNzWMb1biR0o6OZ2mg1U3Ea0BV0eHcnk6J0XIkeI9SSbMp+EzgWHo6gfU4t1tMg/hlh13eXBoOv9LJ3VT8DundcYZN2hEP4ojoGzBB3kHhYSCfYprfgUQwQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=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=bVoT67A6WIqVRF24nt7sy66oGnALp5LD9JMI1e+cPM0=; b=J0kUGtpn7MZfeFg9okb3lN+a8BVsS/pBXBPQ4vbSb+tDfGE5ZYj0ryZyQO3UEC05JPc25sRlpGD5E6o65ZucPBymJuK0FkaNrst5vKjA70Fz7Mg0j1aRhU3jW5eIRNw2yVvzGb7JytyKGTkXa0zAX1ylY7qfYRXHqgyRXwblVfY= Received: from DU2PR04CA0068.eurprd04.prod.outlook.com (2603:10a6:10:232::13) by PAVPR08MB9090.eurprd08.prod.outlook.com (2603:10a6:102:327::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.28; Mon, 27 Nov 2023 14:38:22 +0000 Received: from DU6PEPF0000B61C.eurprd02.prod.outlook.com (2603:10a6:10:232:cafe::38) by DU2PR04CA0068.outlook.office365.com (2603:10a6:10:232::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27 via Frontend Transport; Mon, 27 Nov 2023 14:38:22 +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 DU6PEPF0000B61C.mail.protection.outlook.com (10.167.8.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.17 via Frontend Transport; Mon, 27 Nov 2023 14:38:22 +0000 Received: ("Tessian outbound e243565b0037:v228"); Mon, 27 Nov 2023 14:38:22 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 15a2eda2f876066b X-CR-MTA-TID: 64aa7808 Received: from 46cb19474bef.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 88186A94-A317-4122-8B6F-20D986F2EE97.1; Mon, 27 Nov 2023 14:38:15 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 46cb19474bef.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 27 Nov 2023 14:38:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MKhFt0doZNaWpHdN2KkVHL6ktf80yGLxKWqnSwdhH69mMShWUXuh6PGFR/6f5J1to7S6JUh9BeJz2CZh00w6+wv5DjsLDX8XZoy30wnTHDuPK4d90uuBGua+omHOVKQbfPafBUVCugFKKbDwuoaY7Ji8FTlJW4WcQEXbYsKGbW4hqeK1TwlMpvMXx46kss9CpFVIfiDZvEfiHy9NF1EFlROn53VCbkw7HoHHRTbeHR+nwfKUHx6j//0aOdkKpA+NlJX93QFBNnsxAB/mLrar97kTe8YNOpPGHHTv+dk3xRqqdytiaAm/XkMof2cE6IP+mmQdoQ1URD1en0ndnTg5nA== 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=bVoT67A6WIqVRF24nt7sy66oGnALp5LD9JMI1e+cPM0=; b=WevJF6o2kDf3kPI6xNHsemUjLT6T1K0ccBZ6YcuquQ1drJy3ANzTSGEz+R5CYMxa7GofD9a2NftVh5QCJ2xWuJwWCgF15S7Npjk+fCwcLr2jJCIT/475XIwbAhQ5MN6bzzrW2+rz6+j+XwCcTiimO+exauMC41CpzkYS38wrUrhy3SGy5ozAtTPq1tuaBfly7YgnOYB5cfTn2NxJpV1ZU1E33tEV57YWaRG6O5qa7dbn3Zq8u2ER4wGKemc9EmPcp1Qx4DfFa0+oENyJF1YNfsQO0MSziHrZSzPb7pYw57MiYfTA5ROfMmkbQe8/yMXUxhzdWKBJv3LKC+K2EyM6sg== 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=bVoT67A6WIqVRF24nt7sy66oGnALp5LD9JMI1e+cPM0=; b=J0kUGtpn7MZfeFg9okb3lN+a8BVsS/pBXBPQ4vbSb+tDfGE5ZYj0ryZyQO3UEC05JPc25sRlpGD5E6o65ZucPBymJuK0FkaNrst5vKjA70Fz7Mg0j1aRhU3jW5eIRNw2yVvzGb7JytyKGTkXa0zAX1ylY7qfYRXHqgyRXwblVfY= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by PA4PR08MB7572.eurprd08.prod.outlook.com (2603:10a6:102:271::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.28; Mon, 27 Nov 2023 14:38:09 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::2ed5:dc23:2624:df0a]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::2ed5:dc23:2624:df0a%7]) with mapi id 15.20.7025.022; Mon, 27 Nov 2023 14:38:08 +0000 From: Wilco Dijkstra To: "post@ralfj.de" CC: 'GNU C Library' Subject: Support for memcpy with equal source and destination Thread-Topic: Support for memcpy with equal source and destination Thread-Index: AQHaITdX9mWDQAMyFEiM1b28bGG8Qg== Date: Mon, 27 Nov 2023 14:38:08 +0000 Message-ID: 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_|PA4PR08MB7572:EE_|DU6PEPF0000B61C:EE_|PAVPR08MB9090:EE_ X-MS-Office365-Filtering-Correlation-Id: d2365e40-9c39-474e-f23d-08dbef568181 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: h2oDaVdSKKLysOFaQVI9pQpGgWZ5KgotPPvqm6SkvcrnhC2I6ve3ya169uuGxqZ2EV89B7Vbhdxb5Aup72l2H4fXvkfkfLe+o7tezbRVKyMoZ05QfL/QD5dTnvQ+H9h6xF3Px3MnQOBUQ8Oq/X0B17VKT/i+70WWxcatG8oWPA9W3MhJzPzrc1eKAeNoumG9KpSZt0ebIwODabjia4AYLk6vG/SEMccxVOYd7JPjLLY3FubNe5JfZVOoJ0q5mo4H16/DEsEiag9xBdXBNlf492QMOBkWJAsGQjgGPcZk7+dTxGjeW9blrax/NkKZyAgOdrVoZ9xq8hE2v4By6HhSUqeL3lxJSDLpHzv39COQd6ZhLTE1LDuAobyRLgKM9eeQtM+Am6PsGAbMc36swiTeDAF8OALKMzwWTzOtl4Hz5vCsVl/bgeX9vN5OmRz0W//r7+pB/gDigeq/rpD6MZcTW4yPKKpeYPbCIknIAnGXVNDOSlDRCR5eJSln+qcFrmIXXoYkD+/HNWabRPpK0epEY7Ja3UmuITpj4hn6gQ+QyUHuYRUVSz+iCfO3KzGphuaeIVHXvuWjaHnCSaQyRXXuJm7Al9YBioF8PoeqP1o0eO95lG35C4brNJaaEE9z5Qrj 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:(13230031)(39860400002)(346002)(366004)(376002)(136003)(396003)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(26005)(71200400001)(6506007)(9686003)(55016003)(52536014)(4326008)(8676002)(8936002)(5660300002)(86362001)(478600001)(316002)(66946007)(76116006)(91956017)(66556008)(6916009)(64756008)(66446008)(66476007)(38100700002)(122000001)(7696005)(38070700009)(33656002)(4744005)(41300700001)(2906002);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: PA4PR08MB7572 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: DU6PEPF0000B61C.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a011ce44-6df0-4201-7a79-08dbef56798f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g3Mm8P6//242JgPqSl8VFVTFIgf3VGO67jk+i370izTOH56nQmnYzM0Kdsni92tYeMa9D3N+l2lp+zV2PmAFEH9KAZo/FBxtDoWwhL5YlS9m8w/HThzO0WgF+O6kudUDlcyNdebN5lKGwf10HFS5qu8EC+VxjyHCiPlqLbGCtBXG82vU40YyPlszbtIRA6pwTD6KfPHR5z+v4PsVK+0ui9HNDsJItu16fjpCNCQkG145B+nI6SVSd0QIJwgQ+ao5vCTCfQc7b1eB2PPdmuV7xrQBhhFzFtSWZl3bsJhpkcvXl4T8jg/Ks9E/NNfIFRp6blRoQtn0uYg7BChzOCCL9ObHamCOwSTGhiTvsv9T01QSKpYPK5roIfoM0DUkFT8dShgjUbfM6f4KGaoq0o/1xxXPWTloCvpcy2yx+GVs2qEGMTOvbkHTvFwvlW2ZyVYBEE3NjfWXyWKCFeErucYiZ96NDzt8F3qduFqQT90j12vw6Bi7LTfm/W32aGfPjXC7H0HQlwYouiJoyHyG5ruIfYV5XjF9RA62/tN5KM6eLjMNa8Yx3MbUtO12YEoB2YTgrIJZQIMWEMxFi3CrlaIsW5PdLMpl8aRpgvZnUfJagl43RRwD59KOeckBjpyg1jhtxmVD/yLRdHGNpRNUAJRSDqOgp7DJnSmYN1+xFc6v783tNopPHy0wXPm0a+aRq9PT0nVqAXu3xwvR+o/bBM9VnC4HWjn4rlUgi/sY+m8WLvZo0/zMv+ISH/aqp+vZHymy 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:(13230031)(4636009)(136003)(346002)(376002)(396003)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(82310400011)(1800799012)(36840700001)(46966006)(40470700004)(40460700003)(26005)(6506007)(9686003)(55016003)(8676002)(336012)(8936002)(6862004)(4326008)(82740400003)(86362001)(5660300002)(52536014)(478600001)(316002)(70206006)(70586007)(36860700001)(356005)(47076005)(81166007)(7696005)(33656002)(2906002)(4744005)(41300700001)(40480700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 14:38:22.1902 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d2365e40-9c39-474e-f23d-08dbef568181 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: DU6PEPF0000B61C.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9090 X-Spam-Status: No, score=-4.7 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,T_SCC_BODY_TEXT_LINE,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 Ralf,=0A= =0A= > However, at that point it seems unclear why that branch should live insid= e =0A= > `memcpy`, rather than being performed by the caller. The entire argument = made =0A= > all along by compiler developers (as I understood it) was that the existi= ng =0A= > `memcpy` are already working fine for the src=3D=3Ddest case; if new bran= ches need =0A= > to be added, that's a different discussion.=0A= =0A= Existing implementations don't need (or want) any extra branches. We also d= on't=0A= want to complicate inline memcpy expansions. They all work fine if src=3D= =3Ddst.=0A= =0A= Paul's example was to show that with restrict you could write a conformant= =0A= C implementation. I think it is sufficient to cast away restrict without ad= ding an=0A= extra branch (the existing generic C version does this).=0A= =0A= >> When n is zero, this implementation also supports NULL dest or src, thou= gh =0A= >> that's a separate issue.=0A= >=0A= > Yeah I'd like to see that guarantee as well, if possible. :)=0A= =0A= That should also work fine on existing implementations.=0A= =0A= Cheers,=0A= Wilco=