From: Ken Hagan (k.hagan_at_[hidden])
Date: 2000-09-26 09:02:50
John Maddock asked
> Shouldn't the int_fastX_t's be at least int sized?
Not for x86-family machines they shouldn't. For the 386
and above, byte arithmetic and load/stores are as fast
as "int" sized ones. It would be unfair to force everyone
to use four times as much space when there is no speedup.
Considering how common the x86 is, it would be nice to
get this one right.
I have a suspicion that 16-bit operations carry no penalty
on Pentium II and higher, although these certainly took
a hit on earlier Intel processors. (I think AMD chips were
better in this regard. I don't know about Cyrix.)
16-bit values do carry a code _size_ penalty, since the
actual instructions are 1 byte longer. However, I don't
think either the "fast" or the "small" typedefs consider
this as an issue.
On balance, I would reckon that most x86 machines around
today would be fairly represented by defining the "fast"
types the same way as the "small" ones. The only possible
exception is int_fast16_t, which might be 32-bit for the
benefit of older Intel CPUs.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk