2014-05-24 12:50:23 +00:00
|
|
|
//=- AArch64.td - Describe the AArch64 Target Machine --------*- tablegen -*-=//
|
2014-03-29 10:18:08 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Target-independent interfaces which we are implementing
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
include "llvm/Target/Target.td"
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2014-05-24 12:50:23 +00:00
|
|
|
// AArch64 Subtarget features.
|
2014-03-29 10:18:08 +00:00
|
|
|
//
|
|
|
|
|
2014-04-14 17:38:00 +00:00
|
|
|
def FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8", "true",
|
2014-04-18 21:22:04 +00:00
|
|
|
"Enable ARMv8 FP">;
|
2014-04-14 17:38:00 +00:00
|
|
|
|
|
|
|
def FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
|
|
|
|
"Enable Advanced SIMD instructions", [FeatureFPARMv8]>;
|
|
|
|
|
|
|
|
def FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
|
|
|
|
"Enable cryptographic instructions">;
|
|
|
|
|
2014-04-25 09:25:42 +00:00
|
|
|
def FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
|
|
|
|
"Enable ARMv8 CRC-32 checksum instructions">;
|
|
|
|
|
2015-03-26 17:05:54 +00:00
|
|
|
def FeatureV8_1a : SubtargetFeature<"v8.1a", "HasV8_1a", "true",
|
|
|
|
"Enable ARMv8.1a extensions", [FeatureCRC]>;
|
|
|
|
|
2014-03-29 10:18:08 +00:00
|
|
|
/// Cyclone has register move instructions which are "free".
|
|
|
|
def FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
|
2014-05-05 21:50:57 +00:00
|
|
|
"Has zero-cycle register moves">;
|
2014-03-29 10:18:08 +00:00
|
|
|
|
|
|
|
/// Cyclone has instructions which zero registers for "free".
|
|
|
|
def FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true",
|
|
|
|
"Has zero-cycle zeroing instructions">;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Register File Description
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-05-24 12:50:23 +00:00
|
|
|
include "AArch64RegisterInfo.td"
|
|
|
|
include "AArch64CallingConvention.td"
|
2014-03-29 10:18:08 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Instruction Descriptions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-05-24 12:50:23 +00:00
|
|
|
include "AArch64Schedule.td"
|
|
|
|
include "AArch64InstrInfo.td"
|
2014-03-29 10:18:08 +00:00
|
|
|
|
2014-05-24 12:50:23 +00:00
|
|
|
def AArch64InstrInfo : InstrInfo;
|
2014-03-29 10:18:08 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2014-05-24 12:50:23 +00:00
|
|
|
// AArch64 Processors supported.
|
2014-03-29 10:18:08 +00:00
|
|
|
//
|
2014-05-24 12:50:23 +00:00
|
|
|
include "AArch64SchedA53.td"
|
2014-06-11 21:06:56 +00:00
|
|
|
include "AArch64SchedA57.td"
|
2014-05-24 12:50:23 +00:00
|
|
|
include "AArch64SchedCyclone.td"
|
2014-03-29 10:18:08 +00:00
|
|
|
|
2014-04-14 17:38:00 +00:00
|
|
|
def ProcA53 : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
|
|
|
|
"Cortex-A53 ARM processors",
|
|
|
|
[FeatureFPARMv8,
|
|
|
|
FeatureNEON,
|
2014-04-25 09:25:42 +00:00
|
|
|
FeatureCrypto,
|
|
|
|
FeatureCRC]>;
|
2014-04-14 17:38:00 +00:00
|
|
|
|
|
|
|
def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
|
|
|
|
"Cortex-A57 ARM processors",
|
|
|
|
[FeatureFPARMv8,
|
|
|
|
FeatureNEON,
|
2014-04-25 09:25:42 +00:00
|
|
|
FeatureCrypto,
|
|
|
|
FeatureCRC]>;
|
2014-04-14 17:38:00 +00:00
|
|
|
|
|
|
|
def ProcCyclone : SubtargetFeature<"cyclone", "ARMProcFamily", "Cyclone",
|
|
|
|
"Cyclone",
|
|
|
|
[FeatureFPARMv8,
|
|
|
|
FeatureNEON,
|
|
|
|
FeatureCrypto,
|
2014-04-25 09:25:42 +00:00
|
|
|
FeatureCRC,
|
2014-04-14 17:38:00 +00:00
|
|
|
FeatureZCRegMove, FeatureZCZeroing]>;
|
|
|
|
|
2014-04-25 09:25:42 +00:00
|
|
|
def : ProcessorModel<"generic", NoSchedModel, [FeatureFPARMv8,
|
|
|
|
FeatureNEON,
|
|
|
|
FeatureCRC]>;
|
2014-04-14 17:38:00 +00:00
|
|
|
|
2015-03-26 17:05:54 +00:00
|
|
|
def : ProcessorModel<"generic-armv8.1-a", NoSchedModel, [FeatureV8_1a,
|
|
|
|
FeatureNEON,
|
|
|
|
FeatureCrypto]>;
|
|
|
|
|
2014-04-18 21:22:04 +00:00
|
|
|
def : ProcessorModel<"cortex-a53", CortexA53Model, [ProcA53]>;
|
2014-06-11 21:06:56 +00:00
|
|
|
def : ProcessorModel<"cortex-a57", CortexA57Model, [ProcA57]>;
|
2015-02-04 13:31:29 +00:00
|
|
|
// FIXME: Cortex-A72 is currently modelled as an Cortex-A57.
|
|
|
|
def : ProcessorModel<"cortex-a72", CortexA57Model, [ProcA57]>;
|
2014-04-14 17:38:00 +00:00
|
|
|
def : ProcessorModel<"cyclone", CycloneModel, [ProcCyclone]>;
|
2014-03-29 10:18:08 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Assembly parser
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def GenericAsmParserVariant : AsmParserVariant {
|
|
|
|
int Variant = 0;
|
|
|
|
string Name = "generic";
|
|
|
|
}
|
|
|
|
|
|
|
|
def AppleAsmParserVariant : AsmParserVariant {
|
|
|
|
int Variant = 1;
|
|
|
|
string Name = "apple-neon";
|
|
|
|
}
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Assembly printer
|
|
|
|
//===----------------------------------------------------------------------===//
|
2014-05-24 12:50:23 +00:00
|
|
|
// AArch64 Uses the MC printer for asm output, so make sure the TableGen
|
2014-03-29 10:18:08 +00:00
|
|
|
// AsmWriter bits get associated with the correct class.
|
|
|
|
def GenericAsmWriter : AsmWriter {
|
|
|
|
string AsmWriterClassName = "InstPrinter";
|
2015-03-27 20:36:02 +00:00
|
|
|
int PassSubtarget = 1;
|
2014-03-29 10:18:08 +00:00
|
|
|
int Variant = 0;
|
|
|
|
bit isMCAsmWriter = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
def AppleAsmWriter : AsmWriter {
|
|
|
|
let AsmWriterClassName = "AppleInstPrinter";
|
2015-03-27 20:36:02 +00:00
|
|
|
int PassSubtarget = 1;
|
2014-03-29 10:18:08 +00:00
|
|
|
int Variant = 1;
|
|
|
|
int isMCAsmWriter = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Target Declaration
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-05-24 12:50:23 +00:00
|
|
|
def AArch64 : Target {
|
|
|
|
let InstructionSet = AArch64InstrInfo;
|
2014-03-29 10:18:08 +00:00
|
|
|
let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
|
|
|
|
let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
|
|
|
|
}
|