What parts of ARMv4/5/6 code will not work on ARMv7?
Asked Answered
L

2

8

It is my understanding that ARMv7 processors, such as the Cortex-A9, are mostly backwards-compatible with code for older ARM architecture versions. However, I've read reports of segfaults trying to run ARM9 code on a Cortex-A8, for example.

What parts of ARMv4/5/6 (ARM7TDMI/ARM9/ARM11) code will not work on an ARMv7 processor? What features or architectural characteristics exist in these older ARM architecture versions that can cause a program built for these versions to fail on ARMv7?

Linneman answered 26/10, 2013 at 15:41 Comment(7)
infocenter.arm.com all the documentation you need for this question is there, look at the architectural reference manuals and the technical reference manuals.Hackett
That's a bit too complicated, can someone distill this information to something easily understood? I'm looking for an answer like "older ARM code will generally run on an ARMv7 processor, but with the following exceptions..."Linneman
Have you read appendices 'M' and 'O' of the ARMv7a Architecture reference manual? They seem to give the closest answer to what you are looking for.Verada
I don't have access to that documentation; only ARM customers can download these files.Linneman
They require registration and acceptance of a click through license, but are otherwise free to access. If that helps.Verada
@DragonLord Incorrect - accessing the architecture documentation requires registration, but there is no requirement on being a customer.Hydrophone
I'd be very surprised to find a real backward incompatability, that could really harm the ARM business. However the code itself may query for the exact architecture (or elements in it) and choose to behave differently - that happens often.Proselytize
D
4

For application code the principal problem is unaligned memory accesses. Before ARMv4 and configurable on ARMv4 to ARMv6 a LDR load from an unaligned address would result in the read data being rotated, and other memory access act as if the least significant 2 bits of the address are zero.

Deciare answered 27/10, 2013 at 15:8 Comment(2)
That is, in fact, the behavior seen in this question. In essence, you're saying that the rotated output the OP of the linked question got is characteristic of ARMv6 and earlier, and that the same code would crash on ARMv7?Linneman
@Linneman You can configure what happens on ARMv7: either it crashes or it yields the correct datum. There's a switch somewhere for this.Amplification
H
2

Compiling for arm instructions armv4 should work all the way through.

The real problem with your question other than not doing your own research on the topic (took you far longer to avoid looking into it than to look into it) is that the majority of the code that you may wish to port from one platform to the next has to do with the peripherals not the instruction set. Most of your code will not port not due to the instruction set but because of the timers, and uarts, and video and usb controllers and such. These are not wintel boxes they dont attempt to be reverse compatible.

The question you linked really has no meat to it since the OP didnt put any code down didnt do any work on the topic, at least not publicly at stackoverflow, it could be a simple case of bad code and have nothing to do with the processor cores, or it could be a case of peripherals that arent there and accessing those, one would expect a hang or crash.

Hackett answered 26/10, 2013 at 22:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.