mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Add ARMv7 architecture, Cortex processors and different FPU modes handling.
llvm-svn: 72337
This commit is contained in:
parent
c16f747585
commit
1fe3d6d47b
@ -28,8 +28,14 @@ def ArchV5TE : SubtargetFeature<"v5te", "ARMArchVersion", "V5TE",
|
|||||||
"ARM v5TE, v5TEj, v5TExp">;
|
"ARM v5TE, v5TEj, v5TExp">;
|
||||||
def ArchV6 : SubtargetFeature<"v6", "ARMArchVersion", "V6",
|
def ArchV6 : SubtargetFeature<"v6", "ARMArchVersion", "V6",
|
||||||
"ARM v6">;
|
"ARM v6">;
|
||||||
def FeatureVFP2 : SubtargetFeature<"vfp2", "HasVFP2", "true",
|
def ArchV7A : SubtargetFeature<"v7a", "ARMArchVersion", "V7A",
|
||||||
|
"ARM v7A">;
|
||||||
|
def FeatureVFP2 : SubtargetFeature<"vfp2", "ARMFPUType", "VFPv2",
|
||||||
"Enable VFP2 instructions ">;
|
"Enable VFP2 instructions ">;
|
||||||
|
def FeatureVFP3 : SubtargetFeature<"vfp3", "ARMFPUType", "VFPv3",
|
||||||
|
"Enable VFP3 instructions ">;
|
||||||
|
def FeatureNEON : SubtargetFeature<"neon", "ARMFPUType", "NEON",
|
||||||
|
"Enable NEON instructions ">;
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// ARM Processors supported.
|
// ARM Processors supported.
|
||||||
@ -84,6 +90,9 @@ def : Proc<"arm1176jzf-s", [ArchV6, FeatureVFP2]>;
|
|||||||
def : Proc<"mpcorenovfp", [ArchV6]>;
|
def : Proc<"mpcorenovfp", [ArchV6]>;
|
||||||
def : Proc<"mpcore", [ArchV6, FeatureVFP2]>;
|
def : Proc<"mpcore", [ArchV6, FeatureVFP2]>;
|
||||||
|
|
||||||
|
def : Proc<"cortex-a8", [ArchV7A, FeatureNEON]>;
|
||||||
|
def : Proc<"cortex-a9", [ArchV7A, FeatureNEON]>;
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Register File Description
|
// Register File Description
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -18,7 +18,7 @@ using namespace llvm;
|
|||||||
|
|
||||||
ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, bool thumb)
|
ARMSubtarget::ARMSubtarget(const Module &M, const std::string &FS, bool thumb)
|
||||||
: ARMArchVersion(V4T)
|
: ARMArchVersion(V4T)
|
||||||
, HasVFP2(false)
|
, ARMFPUType(None)
|
||||||
, IsThumb(thumb)
|
, IsThumb(thumb)
|
||||||
, UseThumbBacktraces(false)
|
, UseThumbBacktraces(false)
|
||||||
, IsR9Reserved(false)
|
, IsR9Reserved(false)
|
||||||
|
@ -23,16 +23,19 @@ class Module;
|
|||||||
class ARMSubtarget : public TargetSubtarget {
|
class ARMSubtarget : public TargetSubtarget {
|
||||||
protected:
|
protected:
|
||||||
enum ARMArchEnum {
|
enum ARMArchEnum {
|
||||||
V4T, V5T, V5TE, V6
|
V4T, V5T, V5TE, V6, V7A
|
||||||
};
|
};
|
||||||
|
|
||||||
/// ARMArchVersion - ARM architecture vecrsion: V4T (base), V5T, V5TE,
|
enum ARMFPEnum {
|
||||||
/// and V6.
|
None, VFPv2, VFPv3, NEON
|
||||||
|
};
|
||||||
|
|
||||||
|
/// ARMArchVersion - ARM architecture version: V4T (base), V5T, V5TE,
|
||||||
|
/// V6, V7A.
|
||||||
ARMArchEnum ARMArchVersion;
|
ARMArchEnum ARMArchVersion;
|
||||||
|
|
||||||
/// HasVFP2 - True if the processor supports Vector Floating Point (VFP) V2
|
/// ARMFPUType - Floating Point Unit type.
|
||||||
/// instructions.
|
ARMFPEnum ARMFPUType;
|
||||||
bool HasVFP2;
|
|
||||||
|
|
||||||
/// IsThumb - True if we are in thumb mode, false if in ARM mode.
|
/// IsThumb - True if we are in thumb mode, false if in ARM mode.
|
||||||
bool IsThumb;
|
bool IsThumb;
|
||||||
@ -77,12 +80,15 @@ protected:
|
|||||||
std::string ParseSubtargetFeatures(const std::string &FS,
|
std::string ParseSubtargetFeatures(const std::string &FS,
|
||||||
const std::string &CPU);
|
const std::string &CPU);
|
||||||
|
|
||||||
bool hasV4TOps() const { return ARMArchVersion >= V4T; }
|
bool hasV4TOps() const { return ARMArchVersion >= V4T; }
|
||||||
bool hasV5TOps() const { return ARMArchVersion >= V5T; }
|
bool hasV5TOps() const { return ARMArchVersion >= V5T; }
|
||||||
bool hasV5TEOps() const { return ARMArchVersion >= V5TE; }
|
bool hasV5TEOps() const { return ARMArchVersion >= V5TE; }
|
||||||
bool hasV6Ops() const { return ARMArchVersion >= V6; }
|
bool hasV6Ops() const { return ARMArchVersion >= V6; }
|
||||||
|
bool hasV7Ops() const { return ARMArchVersion >= V7A; }
|
||||||
|
|
||||||
bool hasVFP2() const { return HasVFP2; }
|
bool hasVFP2() const { return ARMFPUType >= VFPv2; }
|
||||||
|
bool hasVFP3() const { return ARMFPUType >= VFPv3; }
|
||||||
|
bool hasNEON() const { return ARMFPUType >= NEON; }
|
||||||
|
|
||||||
bool isTargetDarwin() const { return TargetType == isDarwin; }
|
bool isTargetDarwin() const { return TargetType == isDarwin; }
|
||||||
bool isTargetELF() const { return TargetType == isELF; }
|
bool isTargetELF() const { return TargetType == isELF; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user