From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932143AbcELScf (ORCPT ); Thu, 12 May 2016 14:32:35 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:35392 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752777AbcELScd (ORCPT ); Thu, 12 May 2016 14:32:33 -0400 Subject: Re: [PATCH] arm64: Implement optimised IP checksum helpers To: Robin Murphy , will.deacon@arm.com, catalin.marinas@arm.com References: <6ca77904d1eced60d86145dc5da361f3aefc6fec.1463062758.git.robin.murphy@arm.com> <5734B899.3040207@arm.com> Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com From: Luke Starrett Message-ID: <49017ef4-1e96-3684-dec1-5f013724f8f2@broadcom.com> Date: Thu, 12 May 2016 14:32:25 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <5734B899.3040207@arm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robin, On 5/12/2016 1:08 PM, Robin Murphy wrote: > Hi Luke, > > On 12/05/16 16:34, Luke Starrett wrote: >> Hi Robin, >> >> I pulled this in to a userspace test app expecting that the __uint128_t >> type might cause GCC to emit 'ldp'. Seems like that was that your >> intent based on your commit note. Instead I see two 64b loads (ldr Xn), >> and a single 32b load (ldr Wn) for the trailing 4B. This was with >> Linaro GCC 4.9-2015.06. > > GCC 5 happily emits ldp there, but indeed I couldn't figure out how to > convince GCC 4 to do so. From a quick ferret around in the GCC Git, it > looks like the relevant optimisations may have only gone in post-4.9. > Not a problem. I was just curious for my own selfish reasons. >> Otherwise, the C cycle count looks good enough compared to the asm >> version. > > Yeah, compiling as standalone functions with GCC 5 I get 19 > instructions vs. 17 for the asm, but the loop logic gets optimised out > completely when ihl is a compile-time constant (e.g. inet_gro_receive()) > I updated to Linaro GCC 5.3-2016.02, and saw what you described. I ran some smoke testing against a random header generator. LGTM. Acked-by: Luke Starrett