Liste des Groupes | Revenir à cl c |
David Brown <david.brown@hesbynett.no> wrote:Technically, both are right - implementations can use any integer type of at least 16 bits here, whatever they think is fastest in general. But it surprises me somewhat, given that clang for x86-64 on Linux uses 64-bit for int_fast16_t.>BTW, I just played with Clang 18 on 64-bit FreeBSD. It has 32-bit
On many cpus, using sizes smaller than the full register size means
doing sign extensions or masking operations at various times - thus full
size register operations can often be more efficient. On such systems
you will find that int_fast16_t is 32-bit or 64-bit, according to the
register width. On other cpus, some common ALU operations on full-size
operands can be slower than for smaller operands (such as on the 68000).
There, int_fast16_t will be 16-bit.
>
Compiler authors know what will usually be faster on the target. There
will always be some exceptions (division is usually faster on smaller
operands, for example). But if you don't know the target - as is the
case of portable code - the compiler will usually make a better choice
here than you would.
int_fast16_t. gcc in Linux makes it 64-bit. Who is right?
Les messages affichés proviennent d'usenet.