Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946181AbbEVVyv (ORCPT ); Fri, 22 May 2015 17:54:51 -0400 Received: from mail-bn1bn0109.outbound.protection.outlook.com ([157.56.110.109]:50149 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1946082AbbEVVys (ORCPT ); Fri, 22 May 2015 17:54:48 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=scottwood@freescale.com; Message-ID: <1432331679.27761.278.camel@freescale.com> Subject: Re: [PATCH v3 2/2] powerpc: add support for csum_add() From: Scott Wood To: Segher Boessenkool CC: David Laight , "linux-kernel@vger.kernel.org" , Paul Mackerras , "linuxppc-dev@lists.ozlabs.org" , "Christophe Leroy" Date: Fri, 22 May 2015 16:54:39 -0500 In-Reply-To: <20150522213956.GC7305@gate.crashing.org> References: <1d1362c8aa696e316d3ba97dce2342df6f6ee6cf.1432047904.git.christophe.leroy@c-s.fr> <063D6719AE5E284EB5DD2968C1650D6D1CB3D471@AcuExch.aculab.com> <1432323162.27761.274.camel@freescale.com> <20150522213956.GC7305@gate.crashing.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Originating-IP: [2601:2:5800:3f7:12bf:48ff:fe84:c9a0] X-ClientProxiedBy: BLUPR02CA027.namprd02.prod.outlook.com (25.160.23.145) To BN3PR03MB1480.namprd03.prod.outlook.com (25.163.35.143) X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1480;2:EmhIzZ9FPh7J7+xjDiG3Gt9lYbhY86GFvRttwCzozPeeP7u1B8wt7sUJZbWmwZQc;2:5BTijqwwn/HeiuNL+LVPhYzBe3YSbWZrEL9/bcEg8bbJKUSU70xx6tEsVawEeCNzM3I50Jj+RYX575IJSf7A8IYdWZ2kxVyTiwU1asZtx0tLWMs/0Pt1LtkUGS2hCwhW+B9emKZG0TtzxmSYK8hbtA==;6:6Z4VZ93YrtJmk32xFBTk4cSClLLp7SYiP78TbtekmUPWNsYctseX/ofZ3AE4edNoabWrHD4fSw3uHVte8aDLhIPAzG4iMLQ6Fcj1xbd8xUC2US9c/QN6w+pLguumM1d2pX66gfxPHHpGbKpv1AwJ8otiJ9perkKEosi+SJkDjDSWEJXl/GAWARf49t9qtzExKOU5fTY6kKfI8eRmDg7u/sR/fyumf7LvP5tkpAu50l6llLpWeNmvuxnCKAYBYxxrwASMa1uGef1G902S/Xp/hnRTyxxkhDlXx32Eyh0CP21jBA1oMzkW448oWzR0t6hIAeW48apF3a6B/GhjhVSzNOJyMS0KZTmsfUjptrpM4Pq1liZMnbq9Vd3nSXu59KnEzMnQUZDUBZI/0nNylV33+pWvyGwm+9QF2MsfcpzMXeRTm2m4KNUwVR702i/q/3F463dekKXRpXJUJE2tzfwIJ4PU3/xvnlp7i83fmLm3/88VC0OSqejOLur1Z4sSbYKC X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1480; 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:BN3PR03MB1480;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1480; X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1480;3:Q9kCMgkMQ8Dvj9HxOBmyNzaPSfm080RBgj/nfVgrac3n61X5ImCSPZRPejUUgUV3+EF6Kk4WYtT5GBh2PqHcuNj2jrev/qgpc1b1D2QHYSQnfcnxXFr60RuJE7FzIP+e9xyiUHr5zZKbaNiFvQ+SYkzVP+WWkkZcCyL4LX+0oXGB8MRzAUze8ede+6YLkVsRNwuoR4G3reHHjCvRCoqmM644J884Qy97GY5ARGVGn2cqF1+e6mIM5hxLz3VrxD63zDhrJQ0UjkHdz0jRrd4O2U6JFemiA4dZ6gwBfAXRUfFpWn+nKimz56u37c10ENbM X-Forefront-PRVS: 058441C12A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(51704005)(189002)(377424004)(199003)(24454002)(189998001)(50986999)(101416001)(64706001)(5001830100001)(5001860100001)(46102003)(76176999)(47776003)(5001960100002)(110136002)(92566002)(50226001)(93886004)(5820100001)(87976001)(86362001)(23676002)(103116003)(36756003)(33646002)(105586002)(42186005)(106356001)(50466002)(77096005)(40100003)(77156002)(122386002)(68736005)(2950100001)(62966003)(4001540100001)(81156007)(97736004)(99106002)(3826002)(5001840100002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3PR03MB1480;H:[IPv6:2601:2:5800:3f7:12bf:48ff:fe84:c9a0];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjNQUjAzTUIxNDgwOzk6Vkt2NHo3c09SeW9mSERnc2R5TTRBYVE1a2xF?= =?utf-8?B?b0IyUnlTbVFQQlRTZG5aUlRPWVNqNFFuVHhwNUpIODI1cVZmOXRaalM0c1FD?= =?utf-8?B?d2YrakMrOE93cHQxZ2Mwd3NuM05JaWtFemlRSWJIeFE5cDZJL2VhV0dJSnVt?= =?utf-8?B?OXFLZWdOQkQ3VldSRWVNNEJrZHdQVzNnbkNUeFEzckkzRVNMZytaYjY2NFpG?= =?utf-8?B?NlBQR25rQkpTT1E2NUdvdWprUDVuOVdBc0I5MTlvdUVYTWgwOHJ6ME1meGt2?= =?utf-8?B?RVF1clpQK3FWZkZwUE43THBrbXhMeXVPSkdRL2ZLbEMxL1JmeTdRSVE0b2lQ?= =?utf-8?B?QmJTWkdNTXd5WFA3ZUZGRmdxWklZejY1VGZvZFZHVXJJYVM3TkNScmNyS3Az?= =?utf-8?B?c21uSGVsUHU3cThXVXdYZ0w2a0NhTkgrK1dKaGQyWHd2NkYwcGczaWsvdUNT?= =?utf-8?B?R1ZULzJPNmo1bEtNNENs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BSy9PWFRQRi9zaW1wNXdueFpwSzJWQzJJYWk0QVNFbDNDVllw?= =?utf-8?B?dkNreFg3ZEwyTnN2UURpYzdtYUwvL3JvaTlPVEFwa3RYTHBreHR0aFFaL2l1?= =?utf-8?Q?QUeNQEzg4oex+TpCDTCAUTIEqLKSF+JCp6hL8eaUjEI98?= X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1480;3:/o78E149LT/b95w4qIZvYMeA/b/6ZMIBgHH7X80r68GiuJ6qhMjrxjUnFqCBA9yvPo/aEgx11ZqihL4DHdUYNk3EONw+nQf3jUyNIZGdb+WXlfz2OUEkM7r4Vl78lHAPakQBE6kRFCj7gm0ZFUz85Q==;10:ZCrA3HA0RLkEMKjOG2OHSSDG5k94hCL/bN/sK6thIQy30kTVz+IjtZCoj1a21EFVsarnjwhYrrDKn6JtlFry2IqzwH8UliReEnvPYkyD36g=;6:XyKquudPU8xRCgFLm0Xyi6b2ioC1NzpTT6Lrw44jPN7ySUGcS63dgaOVMWCOqNbE X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2015 21:54:46.6541 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1480 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1165 Lines: 32 On Fri, 2015-05-22 at 16:39 -0500, Segher Boessenkool wrote: > On Fri, May 22, 2015 at 02:32:42PM -0500, Scott Wood wrote: > > > 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 > > Right. Don't expect older compilers to do sane things here. > > All this begs a question... If it is worth spending so much time > micro-optimising this, why not pick the low-hanging fruit first? > Having a 32-bit accumulator for ones' complement sums, on a 64-bit > system, is not such a great idea. That would be a more intrusive change -- not (comparatively) low-hanging fruit. Plus, the person submitting these patches is focused on 32-bit. -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/