Use of C99 int types

2005-04-03 Thread Dag Arne Osvik
Hi, I've been working on a new DES implementation for Linux, and ran into the problem of how to get access to C99 types like uint_fast32_t for internal (not interface) use. In my tests, key setup on Athlon 64 slows down by 40% when using u32 instead of uint_fast32_t. So I wonder if there is any st

Re: Use of C99 int types

2005-04-03 Thread Dag Arne Osvik
Stephen Rothwell wrote: On Sun, 03 Apr 2005 13:55:39 +0200 Dag Arne Osvik <[EMAIL PROTECTED]> wrote: I've been working on a new DES implementation for Linux, and ran into the problem of how to get access to C99 types like uint_fast32_t for internal (not interface) use. In my tests

Re: Use of C99 int types

2005-04-03 Thread Dag Arne Osvik
Andreas Schwab wrote: Dag Arne Osvik <[EMAIL PROTECTED]> writes: Yes, but wouldn't it be much better to avoid code like the following, which may also be wrong (in terms of speed)? #ifdef CONFIG_64BIT // or maybe CONFIG_X86_64? #define fast_u32 u64 #else #define fast_u32 u32 #end

Re: Use of C99 int types

2005-04-03 Thread Dag Arne Osvik
Al Viro wrote: On Sun, Apr 03, 2005 at 02:30:11PM +0200, Dag Arne Osvik wrote: Yes, but wouldn't it be much better to avoid code like the following, which may also be wrong (in terms of speed)? #ifdef CONFIG_64BIT // or maybe CONFIG_X86_64? #define fast_u32 u64 #else #define fast_u3

Re: Use of C99 int types

2005-04-03 Thread Dag Arne Osvik
Grzegorz Kulewski wrote: On Mon, 4 Apr 2005, Dag Arne Osvik wrote: (...) And, at least in theory, long may even provide less than 32 bits. Are you sure? My copy of famous C book by B. W. Kernighan and D. Ritchie says that sizeof(short) <= sizeof(int) <= sizeof(long) and sizeof(short)

Re: Use of C99 int types

2005-04-04 Thread Dag Arne Osvik
Herbert Xu wrote: Dag Arne Osvik <[EMAIL PROTECTED]> wrote: ... and with such name 99% will assume (at least at the first reading) that it _is_ 32bits. We have more than enough portability bugs as it is, no need to invite more by bad names. Agreed. The way I see it there a

Re: Use of C99 int types

2005-04-04 Thread Dag Arne Osvik
Renate Meijer wrote: On Apr 4, 2005, at 12:08 AM, Kyle Moffett wrote: On Apr 03, 2005, at 16:25, Kenneth Johansson wrote: But is this not exactly what Dag Arne Osvik was trying to do ?? uint_fast32_t means that we want at least 32 bits but it's OK with more if that happens to be faster on