6

I see that ARMv8 is merely an extension of ARMv7 architecture and all code compiled on ARMv7 should run on ARMv8. I am interested in the backward compatibility of ARMv8 to ARMv7. Will code that was compiled on ARMv8 run on ARMv7?

I have a particular exact case of interest: I would like to run the comma.ai's Openpilot visiond binary which was compiled for the OnePlus 3 smartphone (Qualcomm MSM8996 Snapdragon 820 CPU) on the Nvidia Jetson TK1 (NVIDIA Cortex-A15 CPU). Will the visiond run on Jetson?

EDIT: There may be more in question than CPU compatibility since visiond probably heavily uses GPU on that phone. Will probably depend whether they use some standard parallelization ways (OpenCL, NEON etc.) or have some custom code for Snapdragons GPU. Even with OpenCL the chance of compatibility is probably quite low on different HW.

Kozuch
  • 2,272
  • 3
  • 26
  • 38
  • 3
    If your binary was compiled for ARMv8, it will not run on ARMv7. The register model and instruction set have changed. An ARMv8 processor can run ARMv7 code, but it needs to be specifically run in ARMv7 mode. You cannot mix the two types of code. – BitBank Mar 23 '17 at 15:51
  • 1
    @BitBank ARMv8 does not mean AArch64. ARMv8 AArch32 does add new instructions, but not new application-level state or even a new ABI. A program targeting AArch64 (which only became available at ARMv8) would not run natively on an ARMv7 implementation; a program using new ARMv8 AArch32 instructions would also not run natively on an ARMv7 implementation. It is also possible to have an ARMv8 AArch64 implementation that *does not support AArch32*, such an ARMv8 implementation would not be able to run AArch32 code natively. –  Mar 25 '17 at 00:00
  • ARMv8 and ARMv7 are completely incompatible instruction sets. Many/most ARMv8 cores have an ARMv7 compatibility mode (as documented some dont but dont know if I have seen any of those yet). So your statement that all code compiled on armv7 can run on armv8 well in an aarch32 mode yes, but that is an armv7 mode not an armv8 mode. armv8 aarch64 will not run on armv7, no. as far as armv7 code running between two different processors look at the raspberry pi for your answer. Yes... – old_timer Feb 15 '19 at 11:39
  • you can build an armv7 project and run it both on an armv7 processor and an armv8 in aarch32 (armv7 compatibility) mode. – old_timer Feb 15 '19 at 11:40
  • 99% of your portability problem has nothing to do with the instruction set though so whether or not the instruction set matches isnt really relevant. as your edit shows you might be starting to understand. – old_timer Feb 15 '19 at 11:41
  • As Ciro points out though you are going further and asking about user/app level which will give you more compatibility. But that is an operating system and version and libraries question as well as instruction set. Simple answer is just try it...It will either work or it wont. – old_timer Feb 15 '19 at 11:44
  • to understand everything else discussed read the arm and chip documentation. – old_timer Feb 15 '19 at 11:45

1 Answers1

2

I believe that aarch32 userland is fully or very highly backwards compatible with ARMv7, i.e. userland programs compiled for ARMv7 should just work in AArch32, but I couldn't find a precise quote in the ARM manual.

aarch32 does have new instructions added over ARMv7 however, most of them seem to be functionality that ARMv8 added and the designers decided to expose on aarch32. Therefore, aarch32 is not forward compatible with ARMv7, i.e., programs compiled for aarch32 might not run on ARMv7.

I'm not sure about system land. See also: Does ARMv8 AArch32 mode has backward compatible with armv4 , armv5 or armv6?

Ciro Santilli
  • 3,693
  • 1
  • 18
  • 44