This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is there a way to prevent the C compiler from generating ldrd instructions (which assume 64-bit alignment)

I'm using the GCC compiler to load packed 16-bit data (i.e. two 16-bit words in a 32-bit value). My pointer is to a 32-bit type because I want to load two 16-bit values in a single cycle but the pointer is not necessarily aligned to a 4 byte boundary. GNU GCC generates LDRD to load two 32-bit values. This results in an alignment fault a run-time. Is there a compile option to prevent the compiler from using LDRD ? or an option to control alignment assumptions? Otherwise what's the best way to get the compiler to load packed data efficiently.