2014-05-24 20:50:23 +08:00
|
|
|
//=- AArch64.td - Describe the AArch64 Target Machine --------*- tablegen -*-=//
|
2014-03-29 18:18:08 +08: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 20:50:23 +08:00
|
|
|
// AArch64 Subtarget features.
|
2014-03-29 18:18:08 +08:00
|
|
|
//
|
|
|
|
|
2014-04-15 01:38:00 +08:00
|
|
|
def FeatureFPARMv8 : SubtargetFeature<"fp-armv8", "HasFPARMv8", "true",
|
2014-04-19 05:22:04 +08:00
|
|
|
"Enable ARMv8 FP">;
|
2014-04-15 01:38:00 +08:00
|
|
|
|
|
|
|
def FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true",
|
|
|
|
"Enable Advanced SIMD instructions", [FeatureFPARMv8]>;
|
|
|
|
|
|
|
|
def FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true",
|
|
|
|
"Enable cryptographic instructions">;
|
|
|
|
|
2014-04-25 17:25:42 +08:00
|
|
|
def FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true",
|
|
|
|
"Enable ARMv8 CRC-32 checksum instructions">;
|
|
|
|
|
2014-03-29 18:18:08 +08:00
|
|
|
/// Cyclone has register move instructions which are "free".
|
|
|
|
def FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
|
2014-05-06 05:50:57 +08:00
|
|
|
"Has zero-cycle register moves">;
|
2014-03-29 18:18:08 +08: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 20:50:23 +08:00
|
|
|
include "AArch64RegisterInfo.td"
|
|
|
|
include "AArch64CallingConvention.td"
|
2014-03-29 18:18:08 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Instruction Descriptions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-05-24 20:50:23 +08:00
|
|
|
include "AArch64Schedule.td"
|
|
|
|
include "AArch64InstrInfo.td"
|
2014-03-29 18:18:08 +08:00
|
|
|
|
2014-05-24 20:50:23 +08:00
|
|
|
def AArch64InstrInfo : InstrInfo;
|
2014-03-29 18:18:08 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2014-05-24 20:50:23 +08:00
|
|
|
// AArch64 Processors supported.
|
2014-03-29 18:18:08 +08:00
|
|
|
//
|
2014-05-24 20:50:23 +08:00
|
|
|
include "AArch64SchedA53.td"
|
2014-06-12 05:06:56 +08:00
|
|
|
include "AArch64SchedA57.td"
|
2014-05-24 20:50:23 +08:00
|
|
|
include "AArch64SchedCyclone.td"
|
2014-03-29 18:18:08 +08:00
|
|
|
|
2014-04-15 01:38:00 +08:00
|
|
|
def ProcA53 : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53",
|
|
|
|
"Cortex-A53 ARM processors",
|
|
|
|
[FeatureFPARMv8,
|
|
|
|
FeatureNEON,
|
2014-04-25 17:25:42 +08:00
|
|
|
FeatureCrypto,
|
|
|
|
FeatureCRC]>;
|
2014-04-15 01:38:00 +08:00
|
|
|
|
|
|
|
def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57",
|
|
|
|
"Cortex-A57 ARM processors",
|
|
|
|
[FeatureFPARMv8,
|
|
|
|
FeatureNEON,
|
2014-04-25 17:25:42 +08:00
|
|
|
FeatureCrypto,
|
|
|
|
FeatureCRC]>;
|
2014-04-15 01:38:00 +08:00
|
|
|
|
|
|
|
def ProcCyclone : SubtargetFeature<"cyclone", "ARMProcFamily", "Cyclone",
|
|
|
|
"Cyclone",
|
|
|
|
[FeatureFPARMv8,
|
|
|
|
FeatureNEON,
|
|
|
|
FeatureCrypto,
|
2014-04-25 17:25:42 +08:00
|
|
|
FeatureCRC,
|
2014-04-15 01:38:00 +08:00
|
|
|
FeatureZCRegMove, FeatureZCZeroing]>;
|
|
|
|
|
2014-04-25 17:25:42 +08:00
|
|
|
def : ProcessorModel<"generic", NoSchedModel, [FeatureFPARMv8,
|
|
|
|
FeatureNEON,
|
|
|
|
FeatureCRC]>;
|
2014-04-15 01:38:00 +08:00
|
|
|
|
2014-04-19 05:22:04 +08:00
|
|
|
def : ProcessorModel<"cortex-a53", CortexA53Model, [ProcA53]>;
|
2014-06-12 05:06:56 +08:00
|
|
|
def : ProcessorModel<"cortex-a57", CortexA57Model, [ProcA57]>;
|
2014-04-15 01:38:00 +08:00
|
|
|
def : ProcessorModel<"cyclone", CycloneModel, [ProcCyclone]>;
|
2014-03-29 18:18:08 +08: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 20:50:23 +08:00
|
|
|
// AArch64 Uses the MC printer for asm output, so make sure the TableGen
|
2014-03-29 18:18:08 +08:00
|
|
|
// AsmWriter bits get associated with the correct class.
|
|
|
|
def GenericAsmWriter : AsmWriter {
|
|
|
|
string AsmWriterClassName = "InstPrinter";
|
|
|
|
int Variant = 0;
|
|
|
|
bit isMCAsmWriter = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
def AppleAsmWriter : AsmWriter {
|
|
|
|
let AsmWriterClassName = "AppleInstPrinter";
|
|
|
|
int Variant = 1;
|
|
|
|
int isMCAsmWriter = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Target Declaration
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-05-24 20:50:23 +08:00
|
|
|
def AArch64 : Target {
|
|
|
|
let InstructionSet = AArch64InstrInfo;
|
2014-03-29 18:18:08 +08:00
|
|
|
let AssemblyParserVariants = [GenericAsmParserVariant, AppleAsmParserVariant];
|
|
|
|
let AssemblyWriters = [GenericAsmWriter, AppleAsmWriter];
|
|
|
|
}
|