From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756574AbbBEHRk (ORCPT ); Thu, 5 Feb 2015 02:17:40 -0500 Received: from mail-wi0-f182.google.com ([209.85.212.182]:55155 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751808AbbBEHRi (ORCPT ); Thu, 5 Feb 2015 02:17:38 -0500 Date: Thu, 5 Feb 2015 08:17:34 +0100 From: Ingo Molnar To: "H. Peter Anvin" Cc: Peter Zijlstra , Linus Torvalds , jsrhbz@kanargh.force9.co.uk, christoph.muellner@theobroma-systems.com, linux@roeck-us.net, linux@rasmusvillemoes.dk, paulmck@linux.vnet.ibm.com, tglx@linutronix.de, akpm@linux-foundation.org, maxime.coquelin@st.com, linux-kernel@vger.kernel.org, martink@posteo.de, tytso@mit.edu, linux-tip-commits@vger.kernel.org Subject: Re: [tip:core/types] bitops: Add sign_extend8(), 16 and 64 functions Message-ID: <20150205071734.GA3203@gmail.com> References: <1421083370-24924-1-git-send-email-martink@posteo.de> <20150119100439.GN25256@twins.programming.kicks-ass.net> <54C00A7B.1000808@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54C00A7B.1000808@zytor.com> 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 * H. Peter Anvin wrote: > On 01/19/2015 02:04 AM, Peter Zijlstra wrote: > > On Mon, Jan 19, 2015 at 07:54:22AM +1200, Linus Torvalds wrote: > >> Why? > >> > >> The 8- and 16- bit versions are the same as the 32-bit one. > >> This seems pointless. If you want something where the sign > >> is in bit 3, they all return the same value, just the return > >> type differs, but that's really a *caller* thing, no? > > > > Even for the 8bit ones? Since we have the *H and *L register > > we have more 8 bit regs than we have 16/32 bit regs and it > > might just be worth it. > > Fewer, actually. gcc doesn't really use the H registers much, Is that true for other compilers as well? > and instead considers 8-bit values to occupy the whole > register, but that means only four are available in 32-bit > mode. So where are we with this? Should I consider: 7e9358073d3f ("bitops: Add sign_extend8(), 16 and 64 functions") NAK-ed due to having marginal benefits, or due to having no benefits whatsoever? How about the two patch series from Martin Keppling - that does seem to be both beneficial and correct, agreed? Thanks, Ingo