Re: [SOLVED] Possible to set the armv7 chip into using unaligned, memory accesses?
Re: [SOLVED] Possible to set the armv7 chip into using unaligned, memory accesses?
- Subject: Re: [SOLVED] Possible to set the armv7 chip into using unaligned, memory accesses?
- From: Jeffrey Walton <email@hidden>
- Date: Wed, 11 Jan 2012 16:05:35 -0500
On Wed, Jan 11, 2012 at 3:52 PM, David Hoerl <email@hidden> wrote:
> I omitted from the original post that the code worked fine in the simulator,
> but crashed on the iPhone with an access violation message.
Code debugged under the emulator is compiled for i386 - its not
interpreted ARM instructions. x86/x64 processors are a bit more
tolerant on unaligned data access.
> Turns out that for many data types, ARMv7 permits unaligned access (though
> with serious performance issues).
What about ARM[4-6]? Is your library used elsewhere (or is it just iOS
with ARM7)? Its been my experience from Windows Mobile that unaligned
data access on ARMs are bad news (and intermittent due to lucky
alignment).
> In looking further what I found was that the crashes happened when the
> library was trying to access unaligned doubles (8 bytes). I then searched
> around and found many posts claiming that the instruction used to load
> doubles (and probably long longs) only works on aligned data.
Just doubles? How about floats. doubles can be downcast to 80 bit
floats on some platforms behind the scenes (I'm not sure about iOS).
> So, I switched all 8 byte casts to use memcpy, and everything fell into
> place.
Yes, I usually memcpy data out (and I don't encounter unaligned access on ARMs).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden