forked from OSchip/llvm-project
Add ARM Archv6M and let it implies FeatureDB (having dmb, etc.)
llvm-svn: 110795
This commit is contained in:
parent
188b47b214
commit
40921a4e62
|
@ -20,20 +20,6 @@ include "llvm/Target/Target.td"
|
||||||
// ARM Subtarget features.
|
// ARM Subtarget features.
|
||||||
//
|
//
|
||||||
|
|
||||||
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 ArchV6T2 : SubtargetFeature<"v6t2", "ARMArchVersion", "V6T2",
|
|
||||||
"ARM v6t2">;
|
|
||||||
def ArchV7A : SubtargetFeature<"v7a", "ARMArchVersion", "V7A",
|
|
||||||
"ARM v7A">;
|
|
||||||
def ArchV7M : SubtargetFeature<"v7m", "ARMArchVersion", "V7M",
|
|
||||||
"ARM v7M">;
|
|
||||||
def FeatureVFP2 : SubtargetFeature<"vfp2", "ARMFPUType", "VFPv2",
|
def FeatureVFP2 : SubtargetFeature<"vfp2", "ARMFPUType", "VFPv2",
|
||||||
"Enable VFP2 instructions">;
|
"Enable VFP2 instructions">;
|
||||||
def FeatureVFP3 : SubtargetFeature<"vfp3", "ARMFPUType", "VFPv3",
|
def FeatureVFP3 : SubtargetFeature<"vfp3", "ARMFPUType", "VFPv3",
|
||||||
|
@ -46,10 +32,10 @@ def FeatureFP16 : SubtargetFeature<"fp16", "HasFP16", "true",
|
||||||
"Enable half-precision floating point">;
|
"Enable half-precision floating point">;
|
||||||
def FeatureHWDiv : SubtargetFeature<"hwdiv", "HasHardwareDivide", "true",
|
def FeatureHWDiv : SubtargetFeature<"hwdiv", "HasHardwareDivide", "true",
|
||||||
"Enable divide instructions">;
|
"Enable divide instructions">;
|
||||||
def FeatureT2ExtractPack: SubtargetFeature<"t2xtpk", "HasT2ExtractPack", "true",
|
def FeatureT2XtPk : SubtargetFeature<"t2xtpk", "HasT2ExtractPack", "true",
|
||||||
"Enable Thumb2 extract and pack instructions">;
|
"Enable Thumb2 extract and pack instructions">;
|
||||||
def FeatureDB : SubtargetFeature<"db", "HasDataBarrier", "true",
|
def FeatureDB : SubtargetFeature<"db", "HasDataBarrier", "true",
|
||||||
"Has data barrier (dmb / dsb) instructions">;
|
"Has data barrier (dmb / dsb) instructions">;
|
||||||
def FeatureSlowFPBrcc : SubtargetFeature<"slow-fp-brcc", "SlowFPBrcc", "true",
|
def FeatureSlowFPBrcc : SubtargetFeature<"slow-fp-brcc", "SlowFPBrcc", "true",
|
||||||
"FP compare + branch is slow">;
|
"FP compare + branch is slow">;
|
||||||
|
|
||||||
|
@ -59,18 +45,40 @@ def FeatureSlowFPBrcc : SubtargetFeature<"slow-fp-brcc", "SlowFPBrcc", "true",
|
||||||
// FIXME: Currently, this is only flagged for Cortex-A8. It may be true for
|
// FIXME: Currently, this is only flagged for Cortex-A8. It may be true for
|
||||||
// others as well. We should do more benchmarking and confirm one way or
|
// others as well. We should do more benchmarking and confirm one way or
|
||||||
// the other.
|
// the other.
|
||||||
def FeatureHasSlowVMLx : SubtargetFeature<"vmlx", "SlowVMLx", "true",
|
def FeatureHasSlowVMLx : SubtargetFeature<"vmlx", "SlowVMLx", "true",
|
||||||
"Disable VFP MAC instructions">;
|
"Disable VFP MAC instructions">;
|
||||||
// Some processors benefit from using NEON instructions for scalar
|
// Some processors benefit from using NEON instructions for scalar
|
||||||
// single-precision FP operations.
|
// single-precision FP operations.
|
||||||
def FeatureNEONForFP : SubtargetFeature<"neonfp", "UseNEONForSinglePrecisionFP",
|
def FeatureNEONForFP : SubtargetFeature<"neonfp", "UseNEONForSinglePrecisionFP",
|
||||||
"true",
|
"true",
|
||||||
"Use NEON for single precision FP">;
|
"Use NEON for single precision FP">;
|
||||||
|
|
||||||
// Disable 32-bit to 16-bit narrowing for experimentation.
|
// Disable 32-bit to 16-bit narrowing for experimentation.
|
||||||
def FeaturePref32BitThumb : SubtargetFeature<"32bit", "Pref32BitThumb", "true",
|
def FeaturePref32BitThumb : SubtargetFeature<"32bit", "Pref32BitThumb", "true",
|
||||||
"Prefer 32-bit Thumb instrs">;
|
"Prefer 32-bit Thumb instrs">;
|
||||||
|
|
||||||
|
|
||||||
|
// 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",
|
||||||
|
[FeatureDB]>;
|
||||||
|
def ArchV6T2 : SubtargetFeature<"v6t2", "ARMArchVersion", "V6T2",
|
||||||
|
"ARM v6t2">;
|
||||||
|
def ArchV7A : SubtargetFeature<"v7a", "ARMArchVersion", "V7A",
|
||||||
|
"ARM v7A",
|
||||||
|
[FeatureDB]>;
|
||||||
|
def ArchV7M : SubtargetFeature<"v7m", "ARMArchVersion", "V7M",
|
||||||
|
"ARM v7M",
|
||||||
|
[FeatureDB]>;
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// ARM Processors supported.
|
// ARM Processors supported.
|
||||||
//
|
//
|
||||||
|
@ -128,7 +136,7 @@ def : Processor<"mpcorenovfp", ARMV6Itineraries, [ArchV6]>;
|
||||||
def : Processor<"mpcore", ARMV6Itineraries, [ArchV6, FeatureVFP2]>;
|
def : Processor<"mpcore", ARMV6Itineraries, [ArchV6, FeatureVFP2]>;
|
||||||
|
|
||||||
// V6M Processors.
|
// V6M Processors.
|
||||||
def : Processor<"cortex-m0", ARMV6Itineraries, [ArchV6, FeatureDB]>;
|
def : Processor<"cortex-m0", ARMV6Itineraries, [ArchV6M]>;
|
||||||
|
|
||||||
// V6T2 Processors.
|
// V6T2 Processors.
|
||||||
def : Processor<"arm1156t2-s", ARMV6Itineraries,
|
def : Processor<"arm1156t2-s", ARMV6Itineraries,
|
||||||
|
@ -139,17 +147,13 @@ def : Processor<"arm1156t2f-s", ARMV6Itineraries,
|
||||||
// V7 Processors.
|
// V7 Processors.
|
||||||
def : Processor<"cortex-a8", CortexA8Itineraries,
|
def : Processor<"cortex-a8", CortexA8Itineraries,
|
||||||
[ArchV7A, FeatureThumb2, FeatureNEON, FeatureHasSlowVMLx,
|
[ArchV7A, FeatureThumb2, FeatureNEON, FeatureHasSlowVMLx,
|
||||||
FeatureSlowFPBrcc, FeatureNEONForFP, FeatureT2ExtractPack,
|
FeatureSlowFPBrcc, FeatureNEONForFP, FeatureT2XtPk]>;
|
||||||
FeatureDB]>;
|
|
||||||
def : Processor<"cortex-a9", CortexA9Itineraries,
|
def : Processor<"cortex-a9", CortexA9Itineraries,
|
||||||
[ArchV7A, FeatureThumb2, FeatureNEON, FeatureT2ExtractPack,
|
[ArchV7A, FeatureThumb2, FeatureNEON, FeatureT2XtPk]>;
|
||||||
FeatureDB]>;
|
|
||||||
|
|
||||||
// V7M Processors.
|
// V7M Processors.
|
||||||
def : ProcNoItin<"cortex-m3", [ArchV7M, FeatureThumb2, FeatureHWDiv,
|
def : ProcNoItin<"cortex-m3", [ArchV7M, FeatureThumb2, FeatureHWDiv]>;
|
||||||
FeatureDB]>;
|
def : ProcNoItin<"cortex-m4", [ArchV7M, FeatureThumb2, FeatureHWDiv]>;
|
||||||
def : ProcNoItin<"cortex-m4", [ArchV7M, FeatureThumb2, FeatureHWDiv,
|
|
||||||
FeatureDB]>;
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Register File Description
|
// Register File Description
|
||||||
|
|
|
@ -26,7 +26,7 @@ class GlobalValue;
|
||||||
class ARMSubtarget : public TargetSubtarget {
|
class ARMSubtarget : public TargetSubtarget {
|
||||||
protected:
|
protected:
|
||||||
enum ARMArchEnum {
|
enum ARMArchEnum {
|
||||||
V4, V4T, V5T, V5TE, V6, V6T2, V7A, V7M
|
V4, V4T, V5T, V5TE, V6, V6M, V6T2, V7A, V7M
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ARMFPEnum {
|
enum ARMFPEnum {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
; RUN: llc < %s -march=thumb -mattr=+v6 | FileCheck %s -check-prefix=V6
|
; RUN: llc < %s -march=thumb -mattr=+v6 | FileCheck %s -check-prefix=V6
|
||||||
; RUN: llc < %s -march=thumb -mcpu=cortex-m0 | FileCheck %s -check-prefix=M0
|
; RUN: llc < %s -march=thumb -mattr=+v6m | FileCheck %s -check-prefix=V6M
|
||||||
|
|
||||||
declare void @llvm.memory.barrier( i1 , i1 , i1 , i1 , i1 )
|
declare void @llvm.memory.barrier( i1 , i1 , i1 , i1 , i1 )
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@ define void @t1() {
|
||||||
; V6: t1:
|
; V6: t1:
|
||||||
; V6: blx {{_*}}sync_synchronize
|
; V6: blx {{_*}}sync_synchronize
|
||||||
|
|
||||||
; M0: t1:
|
; V6M: t1:
|
||||||
; M0: dsb
|
; V6M: dsb
|
||||||
call void @llvm.memory.barrier( i1 false, i1 false, i1 false, i1 true, i1 true )
|
call void @llvm.memory.barrier( i1 false, i1 false, i1 false, i1 true, i1 true )
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,8 @@ define void @t2() {
|
||||||
; V6: t2:
|
; V6: t2:
|
||||||
; V6: blx {{_*}}sync_synchronize
|
; V6: blx {{_*}}sync_synchronize
|
||||||
|
|
||||||
; M0: t2:
|
; V6M: t2:
|
||||||
; M0: dmb
|
; V6M: dmb
|
||||||
call void @llvm.memory.barrier( i1 false, i1 false, i1 false, i1 true, i1 false )
|
call void @llvm.memory.barrier( i1 false, i1 false, i1 false, i1 true, i1 false )
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue