Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What ARM architectures does LLVM support?

I work on software written in C that runs on a variety of ARM processors with different architectures (ARMv5, ARMv6 mostly). We currently compile our code with a few different versions of RVDS, but we are looking at compiling some code with LLVM in order to add some custom instrumentation.

I know LLVM has ARM and Thumb targets, but what architectures does it support, specifically? Will LLVM generated code work on ARMv5? What limitations should I be aware of?

like image 513
Jay Conrod Avatar asked Dec 08 '10 18:12

Jay Conrod


2 Answers

Their source code lists the following archs:

// ARM architectures.
def ArchV4T     : SubtargetFeature<"v4t",  "ARMArchVersion", "V4T",  "ARM v4T">;
def ArchV5T     : SubtargetFeature<"v5t",  "ARMArchVersion", "V5T",  "ARM v5T">;
def ArchV5TE    : SubtargetFeature<"v5te", "ARMArchVersion", "V5TE", "ARM v5TE, v5TEj, v5TExp">;
def ArchV6      : SubtargetFeature<"v6",   "ARMArchVersion", "V6",   "ARM v6">;
def ArchV6M     : SubtargetFeature<"v6m",  "ARMArchVersion", "V6M",  "ARM v6m",  [FeatureNoARM, FeatureDB]>;
def ArchV6T2    : SubtargetFeature<"v6t2", "ARMArchVersion", "V6T2", "ARM v6t2", [FeatureThumb2]>;
def ArchV7A     : SubtargetFeature<"v7a",  "ARMArchVersion", "V7A",  "ARM v7A",  [FeatureThumb2, FeatureNEON, FeatureDB]>;
def ArchV7M     : SubtargetFeature<"v7m",  "ARMArchVersion", "V7M",  "ARM v7M",  [FeatureThumb2, FeatureNoARM, FeatureDB, FeatureHWDiv]>;
like image 58
Bill Lynch Avatar answered Sep 28 '22 09:09

Bill Lynch


I have run llvm generated code on ARMv4, and ARMv6 definitely. I have some ARMv5 platforms but dont remember if I tried it there. I would assume the output of a generic -march=arm would give least common denominator (ARMv4) code, which means it will run on ARMv5. This was all embedded, no operating system type work mind you, I have not used llvm to create arm linux binaries or anything like that.

like image 43
old_timer Avatar answered Sep 28 '22 09:09

old_timer