From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752336AbdJaMRC (ORCPT ); Tue, 31 Oct 2017 08:17:02 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35030 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbdJaMRB (ORCPT ); Tue, 31 Oct 2017 08:17:01 -0400 Date: Tue, 31 Oct 2017 12:17:02 +0000 From: Will Deacon To: "Jason A. Donenfeld" Cc: linux-arm-kernel@lists.infradead.org, LKML , Mark Rutland Subject: Re: [PATCH] arm64: support __int128 on gcc 5+ Message-ID: <20171031121701.GI5584@arm.com> References: <20171031114319.24436-1-Jason@zx2c4.com> <20171031115156.GF5584@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jason, On Tue, Oct 31, 2017 at 12:57:29PM +0100, Jason A. Donenfeld wrote: > On Tue, Oct 31, 2017 at 12:51 PM, Will Deacon wrote: > > Which code in the kernel actually uses 128-bit types directly? I know we > > have some unfortunate occurences in our headers (including uapi) for the > > vector registers, but I thought we generally used asm or copy routines to > > access those. > > math64.h provides it, and various things throughout use those > functions. Notably, the scheduler and kvm use those the __int128 > functions. There's also an elliptic curve implementation that uses it, > which makes a big difference. And soon I'll be adding an > implementation of curve25519 that will make heavy use of these > instructions for significant speedups as well. Thanks for the info. It does indeed look like mul_u64_u64_shr improves pretty drastically with this patch, so that sounds good to me. We don't ever call that function on arm64, but hey. > Generally, adding this CONFIG_ARCH key is a hint for current and > future bits of code, so that they can use the faster 128-bit > implementations when available. Not providing it when it's there and > available would be silly. This wasn't originally added to the > architecture, because when the Kconfig symbol was added, gcc didn't > have sane support for it on aarch64. But now it does, so let's support > it. Sure, I'll wait for your patch that matches the relevant compiler versions. Will