2010-08-18 00:20:04 +08:00
|
|
|
//===- ARM.td - Describe the ARM Target Machine ------------*- tablegen -*-===//
|
2006-05-15 06:18:28 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 04:36:04 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
2006-05-15 06:18:28 +08:00
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Target-independent interfaces which we are implementing
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2008-11-24 15:34:46 +08:00
|
|
|
include "llvm/Target/Target.td"
|
2006-05-15 06:18:28 +08:00
|
|
|
|
2010-09-30 09:57:53 +08:00
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// ARM Subtarget features.
|
|
|
|
//
|
|
|
|
|
2009-05-24 03:51:43 +08:00
|
|
|
def FeatureVFP2 : SubtargetFeature<"vfp2", "ARMFPUType", "VFPv2",
|
2009-05-30 07:41:08 +08:00
|
|
|
"Enable VFP2 instructions">;
|
2009-05-24 03:51:43 +08:00
|
|
|
def FeatureVFP3 : SubtargetFeature<"vfp3", "ARMFPUType", "VFPv3",
|
2009-05-30 07:41:08 +08:00
|
|
|
"Enable VFP3 instructions">;
|
2009-05-24 03:51:43 +08:00
|
|
|
def FeatureNEON : SubtargetFeature<"neon", "ARMFPUType", "NEON",
|
2009-05-30 07:41:08 +08:00
|
|
|
"Enable NEON instructions">;
|
|
|
|
def FeatureThumb2 : SubtargetFeature<"thumb2", "ThumbMode", "Thumb2",
|
|
|
|
"Enable Thumb2 instructions">;
|
2010-08-11 15:17:46 +08:00
|
|
|
def FeatureNoARM : SubtargetFeature<"noarm", "NoARM", "true",
|
|
|
|
"Does not support ARM mode execution">;
|
2010-03-15 02:42:38 +08:00
|
|
|
def FeatureFP16 : SubtargetFeature<"fp16", "HasFP16", "true",
|
|
|
|
"Enable half-precision floating point">;
|
2010-10-13 00:22:47 +08:00
|
|
|
def FeatureD16 : SubtargetFeature<"d16", "HasD16", "true",
|
|
|
|
"Restrict VFP3 to 16 double registers">;
|
2010-05-06 07:44:43 +08:00
|
|
|
def FeatureHWDiv : SubtargetFeature<"hwdiv", "HasHardwareDivide", "true",
|
|
|
|
"Enable divide instructions">;
|
2010-08-11 14:51:54 +08:00
|
|
|
def FeatureT2XtPk : SubtargetFeature<"t2xtpk", "HasT2ExtractPack", "true",
|
2010-05-06 07:44:43 +08:00
|
|
|
"Enable Thumb2 extract and pack instructions">;
|
2010-08-11 14:51:54 +08:00
|
|
|
def FeatureDB : SubtargetFeature<"db", "HasDataBarrier", "true",
|
|
|
|
"Has data barrier (dmb / dsb) instructions">;
|
2010-07-14 03:21:50 +08:00
|
|
|
def FeatureSlowFPBrcc : SubtargetFeature<"slow-fp-brcc", "SlowFPBrcc", "true",
|
|
|
|
"FP compare + branch is slow">;
|
2010-08-11 23:44:15 +08:00
|
|
|
def FeatureVFPOnlySP : SubtargetFeature<"fp-only-sp", "FPOnlySP", "true",
|
|
|
|
"Floating point unit supports single precision only">;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-12-06 06:04:16 +08:00
|
|
|
// Some processors have FP multiply-accumulate instructions that don't
|
|
|
|
// play nicely with other VFP / NEON instructions, and it's generally better
|
2010-03-26 07:11:16 +08:00
|
|
|
// to just not use them.
|
2010-12-06 06:04:16 +08:00
|
|
|
def FeatureHasSlowFPVMLx : SubtargetFeature<"slowfpvmlx", "SlowFPVMLx", "true",
|
|
|
|
"Disable VFP / NEON MAC instructions">;
|
2011-04-01 03:38:48 +08:00
|
|
|
|
|
|
|
// Cortex-A8 / A9 Advanced SIMD has multiplier accumulator forwarding.
|
|
|
|
def FeatureVMLxForwarding : SubtargetFeature<"vmlx-forwarding",
|
|
|
|
"HasVMLxForwarding", "true",
|
|
|
|
"Has multiplier accumulator forwarding">;
|
|
|
|
|
2010-03-26 07:47:34 +08:00
|
|
|
// Some processors benefit from using NEON instructions for scalar
|
|
|
|
// single-precision FP operations.
|
2010-08-18 02:39:16 +08:00
|
|
|
def FeatureNEONForFP : SubtargetFeature<"neonfp", "UseNEONForSinglePrecisionFP",
|
|
|
|
"true",
|
|
|
|
"Use NEON for single precision FP">;
|
2010-03-26 07:47:34 +08:00
|
|
|
|
2010-08-10 02:35:19 +08:00
|
|
|
// Disable 32-bit to 16-bit narrowing for experimentation.
|
|
|
|
def FeaturePref32BitThumb : SubtargetFeature<"32bit", "Pref32BitThumb", "true",
|
|
|
|
"Prefer 32-bit Thumb instrs">;
|
2010-03-26 07:11:16 +08:00
|
|
|
|
2011-04-20 02:11:49 +08:00
|
|
|
/// Some instructions update CPSR partially, which can add false dependency for
|
|
|
|
/// out-of-order implementation, e.g. Cortex-A9, unless each individual bit is
|
|
|
|
/// mapped to a separate physical register. Avoid partial CPSR update for these
|
|
|
|
/// processors.
|
|
|
|
def FeatureAvoidPartialCPSR : SubtargetFeature<"avoid-partial-cpsr",
|
|
|
|
"AvoidCPSRPartialUpdate", "true",
|
|
|
|
"Avoid CPSR partial update for OOO execution">;
|
|
|
|
|
2011-07-02 05:12:19 +08:00
|
|
|
/// Some M architectures don't have the DSP extension (v7E-M vs. v7M)
|
|
|
|
def FeatureDSPThumb2 : SubtargetFeature<"t2dsp", "Thumb2DSP", "true",
|
|
|
|
"Supports v7 DSP instructions in Thumb2.">;
|
|
|
|
|
2010-11-03 14:34:55 +08:00
|
|
|
// Multiprocessing extension.
|
|
|
|
def FeatureMP : SubtargetFeature<"mp", "HasMPExtension", "true",
|
|
|
|
"Supports Multiprocessing extension">;
|
2010-08-11 14:51:54 +08:00
|
|
|
|
|
|
|
// 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",
|
2010-08-11 15:17:46 +08:00
|
|
|
[FeatureNoARM, FeatureDB]>;
|
2010-08-11 14:51:54 +08:00
|
|
|
def ArchV6T2 : SubtargetFeature<"v6t2", "ARMArchVersion", "V6T2",
|
2010-08-11 14:57:53 +08:00
|
|
|
"ARM v6t2",
|
2011-07-02 05:12:19 +08:00
|
|
|
[FeatureThumb2, FeatureDSPThumb2]>;
|
2010-08-11 14:51:54 +08:00
|
|
|
def ArchV7A : SubtargetFeature<"v7a", "ARMArchVersion", "V7A",
|
|
|
|
"ARM v7A",
|
2011-07-02 05:12:19 +08:00
|
|
|
[FeatureThumb2, FeatureNEON, FeatureDB,
|
|
|
|
FeatureDSPThumb2]>;
|
2010-08-11 14:51:54 +08:00
|
|
|
def ArchV7M : SubtargetFeature<"v7m", "ARMArchVersion", "V7M",
|
|
|
|
"ARM v7M",
|
2010-08-11 15:17:46 +08:00
|
|
|
[FeatureThumb2, FeatureNoARM, FeatureDB,
|
|
|
|
FeatureHWDiv]>;
|
2011-07-02 05:12:19 +08:00
|
|
|
def ArchV7EM : SubtargetFeature<"v7em", "ARMArchVersion", "V7EM",
|
|
|
|
"ARM v7E-M",
|
|
|
|
[FeatureThumb2, FeatureNoARM, FeatureDB,
|
|
|
|
FeatureHWDiv, FeatureDSPThumb2,
|
|
|
|
FeatureT2XtPk]>;
|
2010-08-11 14:51:54 +08:00
|
|
|
|
2007-01-19 15:51:42 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// ARM Processors supported.
|
|
|
|
//
|
|
|
|
|
2009-06-19 09:51:50 +08:00
|
|
|
include "ARMSchedule.td"
|
|
|
|
|
2010-09-10 09:29:16 +08:00
|
|
|
// ARM processor families.
|
|
|
|
def ProcOthers : SubtargetFeature<"others", "ARMProcFamily", "Others",
|
|
|
|
"One of the other ARM processor families">;
|
|
|
|
def ProcA8 : SubtargetFeature<"a8", "ARMProcFamily", "CortexA8",
|
|
|
|
"Cortex-A8 ARM processors",
|
2010-12-06 07:03:45 +08:00
|
|
|
[FeatureSlowFPBrcc, FeatureNEONForFP,
|
2011-04-01 03:38:48 +08:00
|
|
|
FeatureHasSlowFPVMLx, FeatureVMLxForwarding,
|
|
|
|
FeatureT2XtPk]>;
|
2010-09-10 09:29:16 +08:00
|
|
|
def ProcA9 : SubtargetFeature<"a9", "ARMProcFamily", "CortexA9",
|
2010-12-06 07:03:45 +08:00
|
|
|
"Cortex-A9 ARM processors",
|
2011-04-20 02:11:57 +08:00
|
|
|
[FeatureVMLxForwarding,
|
2011-04-20 02:11:49 +08:00
|
|
|
FeatureT2XtPk, FeatureFP16,
|
|
|
|
FeatureAvoidPartialCPSR]>;
|
2010-09-10 09:29:16 +08:00
|
|
|
|
2009-06-19 09:51:50 +08:00
|
|
|
class ProcNoItin<string Name, list<SubtargetFeature> Features>
|
|
|
|
: Processor<Name, GenericItineraries, Features>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
|
|
|
// V4 Processors.
|
2009-06-19 09:51:50 +08:00
|
|
|
def : ProcNoItin<"generic", []>;
|
|
|
|
def : ProcNoItin<"arm8", []>;
|
|
|
|
def : ProcNoItin<"arm810", []>;
|
|
|
|
def : ProcNoItin<"strongarm", []>;
|
|
|
|
def : ProcNoItin<"strongarm110", []>;
|
|
|
|
def : ProcNoItin<"strongarm1100", []>;
|
|
|
|
def : ProcNoItin<"strongarm1110", []>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
|
|
|
// V4T Processors.
|
2009-06-19 09:51:50 +08:00
|
|
|
def : ProcNoItin<"arm7tdmi", [ArchV4T]>;
|
|
|
|
def : ProcNoItin<"arm7tdmi-s", [ArchV4T]>;
|
|
|
|
def : ProcNoItin<"arm710t", [ArchV4T]>;
|
|
|
|
def : ProcNoItin<"arm720t", [ArchV4T]>;
|
|
|
|
def : ProcNoItin<"arm9", [ArchV4T]>;
|
|
|
|
def : ProcNoItin<"arm9tdmi", [ArchV4T]>;
|
|
|
|
def : ProcNoItin<"arm920", [ArchV4T]>;
|
|
|
|
def : ProcNoItin<"arm920t", [ArchV4T]>;
|
|
|
|
def : ProcNoItin<"arm922t", [ArchV4T]>;
|
|
|
|
def : ProcNoItin<"arm940t", [ArchV4T]>;
|
|
|
|
def : ProcNoItin<"ep9312", [ArchV4T]>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
|
|
|
// V5T Processors.
|
2009-06-19 09:51:50 +08:00
|
|
|
def : ProcNoItin<"arm10tdmi", [ArchV5T]>;
|
|
|
|
def : ProcNoItin<"arm1020t", [ArchV5T]>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
|
|
|
// V5TE Processors.
|
2009-06-19 09:51:50 +08:00
|
|
|
def : ProcNoItin<"arm9e", [ArchV5TE]>;
|
|
|
|
def : ProcNoItin<"arm926ej-s", [ArchV5TE]>;
|
|
|
|
def : ProcNoItin<"arm946e-s", [ArchV5TE]>;
|
|
|
|
def : ProcNoItin<"arm966e-s", [ArchV5TE]>;
|
|
|
|
def : ProcNoItin<"arm968e-s", [ArchV5TE]>;
|
|
|
|
def : ProcNoItin<"arm10e", [ArchV5TE]>;
|
|
|
|
def : ProcNoItin<"arm1020e", [ArchV5TE]>;
|
|
|
|
def : ProcNoItin<"arm1022e", [ArchV5TE]>;
|
|
|
|
def : ProcNoItin<"xscale", [ArchV5TE]>;
|
|
|
|
def : ProcNoItin<"iwmmxt", [ArchV5TE]>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
|
|
|
// V6 Processors.
|
2009-11-19 02:39:57 +08:00
|
|
|
def : Processor<"arm1136j-s", ARMV6Itineraries, [ArchV6]>;
|
2010-04-01 08:13:43 +08:00
|
|
|
def : Processor<"arm1136jf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2,
|
2010-12-06 06:04:16 +08:00
|
|
|
FeatureHasSlowFPVMLx]>;
|
2009-11-19 02:39:57 +08:00
|
|
|
def : Processor<"arm1176jz-s", ARMV6Itineraries, [ArchV6]>;
|
2010-12-06 06:04:16 +08:00
|
|
|
def : Processor<"arm1176jzf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2,
|
|
|
|
FeatureHasSlowFPVMLx]>;
|
2009-11-19 02:39:57 +08:00
|
|
|
def : Processor<"mpcorenovfp", ARMV6Itineraries, [ArchV6]>;
|
2010-12-06 06:04:16 +08:00
|
|
|
def : Processor<"mpcore", ARMV6Itineraries, [ArchV6, FeatureVFP2,
|
|
|
|
FeatureHasSlowFPVMLx]>;
|
2007-01-19 15:51:42 +08:00
|
|
|
|
2010-08-11 14:30:38 +08:00
|
|
|
// V6M Processors.
|
2010-08-11 14:51:54 +08:00
|
|
|
def : Processor<"cortex-m0", ARMV6Itineraries, [ArchV6M]>;
|
2010-08-11 14:30:38 +08:00
|
|
|
|
2009-06-09 05:20:36 +08:00
|
|
|
// V6T2 Processors.
|
2010-08-11 14:57:53 +08:00
|
|
|
def : Processor<"arm1156t2-s", ARMV6Itineraries, [ArchV6T2]>;
|
2010-12-06 06:04:16 +08:00
|
|
|
def : Processor<"arm1156t2f-s", ARMV6Itineraries, [ArchV6T2, FeatureVFP2,
|
|
|
|
FeatureHasSlowFPVMLx]>;
|
2009-05-30 07:41:08 +08:00
|
|
|
|
2009-06-09 05:20:36 +08:00
|
|
|
// V7 Processors.
|
2009-07-22 02:54:14 +08:00
|
|
|
def : Processor<"cortex-a8", CortexA8Itineraries,
|
2010-12-06 07:03:45 +08:00
|
|
|
[ArchV7A, ProcA8]>;
|
2010-04-08 02:19:18 +08:00
|
|
|
def : Processor<"cortex-a9", CortexA9Itineraries,
|
2010-12-06 07:03:45 +08:00
|
|
|
[ArchV7A, ProcA9]>;
|
2011-04-20 02:11:52 +08:00
|
|
|
def : Processor<"cortex-a9-mp", CortexA9Itineraries,
|
|
|
|
[ArchV7A, ProcA9, FeatureMP]>;
|
2010-08-11 14:30:38 +08:00
|
|
|
|
|
|
|
// V7M Processors.
|
2010-08-11 15:00:16 +08:00
|
|
|
def : ProcNoItin<"cortex-m3", [ArchV7M]>;
|
2011-07-02 05:12:19 +08:00
|
|
|
def : ProcNoItin<"cortex-m4", [ArchV7EM, FeatureVFP2, FeatureVFPOnlySP]>;
|
2009-05-24 03:51:43 +08:00
|
|
|
|
2006-05-15 06:18:28 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Register File Description
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
include "ARMRegisterInfo.td"
|
|
|
|
|
2009-04-18 03:07:39 +08:00
|
|
|
include "ARMCallingConv.td"
|
|
|
|
|
2006-05-15 06:18:28 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Instruction Descriptions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
include "ARMInstrInfo.td"
|
|
|
|
|
2010-04-05 11:10:20 +08:00
|
|
|
def ARMInstrInfo : InstrInfo;
|
2006-05-15 06:18:28 +08:00
|
|
|
|
2010-09-30 09:57:53 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Assembly printer
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// ARM Uses the MC printer for asm output, so make sure the TableGen
|
|
|
|
// AsmWriter bits get associated with the correct class.
|
|
|
|
def ARMAsmWriter : AsmWriter {
|
|
|
|
string AsmWriterClassName = "InstPrinter";
|
|
|
|
bit isMCAsmWriter = 1;
|
|
|
|
}
|
|
|
|
|
2006-05-15 06:18:28 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Declare the target which we are implementing
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def ARM : Target {
|
|
|
|
// Pull in Instruction Info:
|
|
|
|
let InstructionSet = ARMInstrInfo;
|
2010-09-30 09:57:53 +08:00
|
|
|
|
|
|
|
let AssemblyWriters = [ARMAsmWriter];
|
2006-05-15 06:18:28 +08:00
|
|
|
}
|