Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751976AbbEZTmt (ORCPT ); Tue, 26 May 2015 15:42:49 -0400 Received: from mail-bn1bon0114.outbound.protection.outlook.com ([157.56.111.114]:14240 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751416AbbEZTmr (ORCPT ); Tue, 26 May 2015 15:42:47 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=scottwood@freescale.com; Message-ID: <1432669355.7862.16.camel@freescale.com> Subject: Re: [PATCH v3 2/2] powerpc: add support for csum_add() From: Scott Wood To: David Laight CC: "'Christophe Leroy'" , Benjamin Herrenschmidt , Paul Mackerras , "Michael Ellerman" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Date: Tue, 26 May 2015 14:42:35 -0500 In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CB3EB5F@AcuExch.aculab.com> References: <1d1362c8aa696e316d3ba97dce2342df6f6ee6cf.1432047904.git.christophe.leroy@c-s.fr> <063D6719AE5E284EB5DD2968C1650D6D1CB3D471@AcuExch.aculab.com> <1432323162.27761.274.camel@freescale.com> <063D6719AE5E284EB5DD2968C1650D6D1CB3EB5F@AcuExch.aculab.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.0-fta1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Originating-IP: [2601:2:5800:3f7:12bf:48ff:fe84:c9a0] X-ClientProxiedBy: CY1PR14CA0005.namprd14.prod.outlook.com (25.163.13.143) To BY1PR03MB1481.namprd03.prod.outlook.com (25.162.210.14) X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1481;2:MkR2cfnizBj+cQDqBe7MFQX/3BqpyXNgPF9FGZcZjnG1FEb9sDgwieOhMwDhAIbr;2:qnoRSiQaxY0WaGr3rfzBjoA4ipiJZQkQtSVPj1qxUcnsPieqEkDgXQMAX2k+mvj+/L1f6uqA8KZzxtRlqN6er3K8caFhqrDvDfJ8NcLprDQOW6aY+nH6jMpMVTI7jSE0DWHtfjqYlRIF385iNPMvpQ==;6:wFjSd4nTwdDD8Anwz7d8xgh+OxA5iIx0GErQBfK7CNR5wwgy9u435PB4PliaYDTcfQ1UxB7JG3LJW3NaTBYZYwqm906ag4DKmLrDIJ+zgUCZIP7VMwn8XMMiApKL+uiqWBKbEc+tTd1/5m/5BuLkCX+0obISpo7RDESI8cgWmBi/HYHpoIDsHjqh8AOOvPTVxPpkQD7/bY9kH8sbmknBQTz+E2pA53Zv3/n9DAnyEqyrmbjVZaTKcaHlGqY0diBZdGdNafPtGbw7coOUzBWCHofYiJsSGNMsPq7c1w4cEf7YJUS8VQ3PmKwK/frlytWj9cKBJeWpTjJNiPXjIlyLiL24qLB/FYjMLUKf9B+YejftUlnOoKuHU/H8cMuxy9V/OkQd6rJl/ExAN6m8pPPKU3rC1rKxyDW3mt3yXtZJlSq1Jqsb7K1qw1qfliy6NhdNO/vRqMSwqO6yzpa4nnMDSTWWe3yrjYZ3jASY3jGbI/nyQdq4GQGjDd2KIJILX2Bb X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1481;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1356; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520002)(3002001);SRVR:BY1PR03MB1481;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1481; X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1481;3:/cFkUCgDQaTL2hMoVNmRkuF1RXnHU+NZy9XQT4kmzJw/FtXpW9wG1DwxooyLoK5MK7ZcDsd7i3CsyK9lO4tiCSlObXvPq3x0gW3GK0ZTAzhpjCbHo5QbHo4laRU9wOYn7CQbLB7GAZv0wWMcM8IMdPpK9lMzK67ZDUzYYnU6b2BiUkNLoNfMWyizwO1PPnPPObuhxT1asxxaDz4Jfuhcd61dYSBb4AVFcBCdhLwCLZZ3h01F6cqgjMclommC8I+33PNIYGL9KY07nKp5bzf588JqFPEn319BhIRXpY3GKlTFwCI7T0uz9gCNVj9veKBX X-Forefront-PRVS: 0588B2BD96 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(377424004)(199003)(189002)(24454002)(51704005)(62966003)(81156007)(77156002)(105586002)(77096005)(5001860100001)(68736005)(33646002)(5001830100001)(93886004)(23676002)(36756003)(106356001)(40100003)(5001960100002)(110136002)(189998001)(97736004)(4001540100001)(46102003)(2950100001)(122386002)(50226001)(47776003)(64706001)(50986999)(76176999)(103116003)(5820100001)(50466002)(92566002)(101416001)(86362001)(42186005)(87976001)(99106002)(3826002)(5001840100002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1481;H:[IPv6:2601:2:5800:3f7:12bf:48ff:fe84:c9a0];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTFQUjAzTUIxNDgxOzk6TGhpUmM1QXNwb2d0NDFXWXhQam9MSjNRZTh1?= =?utf-8?B?aUFSdDR5VytGTVpVVlU0cVp6TEp1YkhlSGN3MmtqSTVzZEFSd1RuRnljWVlZ?= =?utf-8?B?N3dSaHBLOW8yZUw2dkVLYW9LZWtyWlV2UXh3cElaZEJmQmFyVHp4UjA4cFhF?= =?utf-8?B?QzIzTFFSUjY5V0dKMkMrWExyNVlhTEpCcnFrdWhlMTFXYVdqRlE2d0lMQzdm?= =?utf-8?B?OU5hVG8xbG1HdjNldUtwVWR2aVZDY2xZMXVNOHh4emN0aXQvWWJDQXF0L1VL?= =?utf-8?B?b0hYU055NjJ5cjJTbjBkVDlOejdjVDlFV0lDcE91RTVEZmJiTDNqNW5JaDVr?= =?utf-8?B?Z3R4b1RXbXlLNSszek1DeE05Z2hEb1dwZG5KeGx5N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HUXRaUkhVK09ZV1VIZGJ6Mm9Sc2d0VktKNXZFLytU?= =?utf-8?B?Ris0NXZKaEN5WHpESy9GLzUxVG1ac3ZQaDJZOTlNUHc3c1Ywa1hiazE2N0h1?= =?utf-8?B?NDFQajFQNG5wN2tkaUc0czdRR0tRVVJhaWMxcW9DL2RQaGVyUXJ2elJYcWhl?= =?utf-8?B?Z2xuWW9iemZQV1VTRTA2VzdlbmUyektCc1pSb0J2UmpwRXhHanBhU0M5cUtI?= =?utf-8?Q?8r9OsUnLvVidQV2sU1ymULigEjrKlDOBCguvBo0Y6CInI?= X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1481;3:cm2z0NAeB6dAluy0hGsH/RiQjP4Z+zMd9TD/+pS5qPItagFKg+0BhlykdqtBe3Ttc9Bki3aC/Q2XbLsP0P9DiRNxm/9fVrBerNgACJ+RnqUi/jGlMhTdWU6dZ0IEUT9m67d0oQhJMh6wPflGZOVolQ==;10:+LL1ug/B4xp5p2xvuTYgGdHZuDa4keIxuUZM4kk533v7Ayg22Qr+xS4K8wKwP03qdU6jXddehwl2TfHiupUtLHa8WoxWOcVoYj3RVDGnIj4=;6:6QX2PoN21AGbJcAY30b0Qw1lbfxMfATYpsdozJH+pT7AkF7nIkekbyqw5PHIYmEq X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2015 19:42:43.4421 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1481 X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1356;2:1QC0KmtonorHqxS9EGRg2TTabO3jiVp4+AsjGnwVmYcH6t5cJaEzLiayd8e76Zl0;2:CeswaSMsCkXfvQyBrytATSj6+P7DgKK4KmF2Cq2yho+QZCAaBxhuqKJ1kEViNE/mWWc0WUz1ojk/DCbbw1mLI/hUtiVRi1+fveh4IgRLTzt6w9ZxDCb79X21CWMYQNwYOXRkl2ocVfJh7eEQyhVn0A==;9:DOZHY12Aoz/lGZ91B0+5NtByS9MYWSFK7eKFBz92HwyZlK+5XqcUUuixOheHStgyCkM8Rx6cg7MZPjFsv+Zf/9odUVGBucj3jFJrBZDFsNI9xRwugPB9sQpNr5jv8D9Klzh28xjA3qWcea+h8BycgQ== X-OriginatorOrg: freescale.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1084 Lines: 31 On Tue, 2015-05-26 at 13:57 +0000, David Laight wrote: > From: Scott Wood ... > > > I'd also have thought that the 64bit C version above would be > > > generally 'good'. > > > > It doesn't generate the addc/addze sequence. At least with GCC > > 4.8.2, > > it does something like: > > > > mr tmp0, csum > > li tmp1, 0 > > li tmp2, 0 > > addc tmp3, addend, tmp0 > > adde csum, tmp2, tmp1 > > add csum, csum, tmp3 > > I was thinking of all 64bit targets, not 32bit ones. Oh, you mean move it out of arch/powerpc? Sounds reasonable, but someone should probably check what the resulting code looks like on other common arches. OTOH, if we're going to modify non-arch code, that might be a good opportunity to implement Segher's suggestion and move to a 64-bit accumulator. -Scott -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/