Re: [PATCH] NIPQUAD macro broken on big endian

Linus Torvalds (torvalds@transmeta.com)
Wed, 7 Oct 1998 09:16:11 -0700 (PDT)


On 7 Oct 1998, Andreas Schwab wrote:
>
> My point is to make it work, nothing more and nothing less. Of course, it
> doesn't *have* to be slow on little endian if the ntohl macro is properly
> written so that gcc can combine the shifts inside and outside of it.

Umm:
- it's not so much slowness as code expansion (NIPQUAD is only used by
various printk's, so performance per se is secondary)
- a well-written htonl() macro will not do just the stupid expansion of
shifts, it will use inline assembly to generate a "bswap" instruction.
- gcc isn't that clever.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/