From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757642AbbBEOMS (ORCPT ); Thu, 5 Feb 2015 09:12:18 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:58179 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757417AbbBEOMQ (ORCPT ); Thu, 5 Feb 2015 09:12:16 -0500 Message-ID: <54D37A2F.1010906@roeck-us.net> Date: Thu, 05 Feb 2015 06:11:59 -0800 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ingo Molnar , "H. Peter Anvin" CC: Peter Zijlstra , Linus Torvalds , jsrhbz@kanargh.force9.co.uk, christoph.muellner@theobroma-systems.com, 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 References: <1421083370-24924-1-git-send-email-martink@posteo.de> <20150119100439.GN25256@twins.programming.kicks-ass.net> <54C00A7B.1000808@zytor.com> <20150205071734.GA3203@gmail.com> In-Reply-To: <20150205071734.GA3203@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020202.54D37A3F.00FB,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.001 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: C_4847, X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 4 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/04/2015 11:17 PM, Ingo Molnar wrote: > > * 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? > Do you mean the two patches improving the documentation of sign_extend32 and adding sign_extend64 ? I thought those would be valuable. The discussion resulted in sign_extend32() being used for non-32-bit operations, so that by itself was quite useful. Guenter