Messages in this thread | | | Date | Mon, 19 Jan 2015 16:00:23 +1200 | Subject | Re: [tip:core/types] bitops: Add sign_extend8(), 16 and 64 functions | From | Linus Torvalds <> |
| |
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
| |