4 ms·
> its not true that unsigned is faster because the compiler can optimize. It’s not false either. For instance, casting int32_t into int64_t requires an instruc
by Const-me 5y ago
> its not true that unsigned is faster because the compiler can optimize.
It’s not false either. For instance, casting int32_t into int64_t requires an instruction like movsxd which does sign extend. Casting uint32_t into uint64_t can often be merged into the instruction who computed the uint32_t value, because the instruction which write 4 bytes registers like eax zero out old data in the higher 4 bytes of the corresponding 8 bytes rax register.
- quelsolaar 5y agoThanks! I didn't know that!