
please wait
I would like to know if forcing 4-byte alignment for 8-byte primitive types (doubles and long longs) can have any negative effect on efficiency? I'm thinking about IA-32 architecture mostly here, but information about other 32-bit architectures could also be helpful.
Do you know if there are any (32-bit) processors which trigger exception when 'double' is not aligned to 8 bytes?
I'm asking because I'm writing a program which needs to be (quite) portable, but also should not waste those precious cycles ;) |
I personally don't see a reason why 8-byte aligned memory accesses could be faster than 4-byte aligned memory accesses on 32-bite architecture, but probably there's a reason under Windows 'doubles' are always aligned to 8 bytes.