lkml.org 
[lkml]   [2015]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [tip:core/types] bitops: Add sign_extend8(), 16 and 64 functions
From
On Mon, Jan 19, 2015 at 7:54 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> The 8- and 16- bit versions are the same as the 32-bit one.

Side note: the 64-bit one is actually different on 32-bit
architectures, not because it would generate a different value, but
because the 64-bit overhead likely kills you. It might be that the
compiler is smart enough that we'd *only* need the 64-bit version, but
for non-constant bit numbers, it's likely hard for gcc to generate
sane single-register versions, and so the 64-bit version is likely
fine.

But I don't see the 8-bit and 16-bit versions generating better code
on any sane architecture.

Linus


\
 
 \ /
  Last update: 2015-01-19 05:21    [W:0.149 / U:1.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site