Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][tlug] Byte Endian Portability and Efficiency . . . . . . . . . . (was Re: Portability of Misaligned Data Access)
- Date: Fri, 28 Jul 2006 22:27:23 -0400
- From: Jim <jep200404@example.com>
- Subject: [tlug] Byte Endian Portability and Efficiency . . . . . . . . . . (was Re: Portability of Misaligned Data Access)
- References: <20060726125907.GH5111@example.com> <87ejw8corz.fsf@example.com> <20060726164125.4959ce4e.jep200404@example.com> <Pine.BSF.4.58.0607261946521.68592@example.com> <87r707bv1o.fsf@example.com> <Pine.BSF.4.58.0607270219370.17463@example.com> <87ac6vbd3l.fsf@example.com> <30ce84360607280348g14ca61degac95f2fbb5ebdc85@example.com>
On Fri, 28 Jul 2006 11:48:21 +0100 Ian Wells <ijw@example.com> wrote: > > uint16_t read_le_u16(char *x) { > return (uint16_t)x[0]+(((uint16_t)x[1]) <<8); > } > > In the nature of these things, this looks obviously inefficient and > slow, and therefore it's almost guaranteed not to be the thing that > takes up the majority of the time (rule #3). Yup. Even on the creaky buggy compilers I use for the crummy 8-bit micros I code for, they generate efficient code for shifts by multiples of 8.
- References:
- [tlug] issues with format of double (or IEEE754)
- From: Michal Hajek
- Re: [tlug] issues with format of double (or IEEE754)
- From: Stephen J. Turnbull
- [tlug] Portability of Misaligned Data Access . . . . . . . (was Re: issues with format of double (or IEEE754))
- From: Jim
- Re: [tlug] Portability of Misaligned Data Access . . . . . . . (was Re: issues with format of double (or IEEE754))
- From: Joe Larabell
- Re: [tlug] Portability of Misaligned Data Access . . . . . . .
- From: Stephen J. Turnbull
- Re: [tlug] Portability of Misaligned Data Access . . . . . . .
- From: Joe Larabell
- Re: [tlug] Portability of Misaligned Data Access . . . . . . .
- From: Stephen J. Turnbull
- Re: [tlug] Portability of Misaligned Data Access . . . . . . .
- From: Ian Wells
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] FireFox Update (1.5.0.5)
- Next by Date: [tlug] Linux Kanji Optical Character Recognition (OCR) software?
- Previous by thread: Re: [tlug] Portability of Misaligned Data Access . . . . . . .
- Next by thread: [tlug] Floating Point Formats. . . . . . . . . . (was Re: Portability of Misaligned Data Access)
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links