Jia Liu | 31d157a | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- Hexagon.td - Describe the Hexagon Target Machine --*- tablegen -*--===// |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Jia Liu | 31d157a | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 10 | // This is the top level entry point for the Hexagon target. |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | // Target-independent interfaces which we are implementing |
| 16 | //===----------------------------------------------------------------------===// |
| 17 | |
| 18 | include "llvm/Target/Target.td" |
| 19 | |
| 20 | //===----------------------------------------------------------------------===// |
| 21 | // Hexagon Subtarget features. |
Jia Liu | 31d157a | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 22 | //===----------------------------------------------------------------------===// |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 23 | |
| 24 | // Hexagon Archtectures |
| 25 | def ArchV2 : SubtargetFeature<"v2", "HexagonArchVersion", "V2", |
| 26 | "Hexagon v2">; |
| 27 | def ArchV3 : SubtargetFeature<"v3", "HexagonArchVersion", "V3", |
| 28 | "Hexagon v3">; |
| 29 | def ArchV4 : SubtargetFeature<"v4", "HexagonArchVersion", "V4", |
| 30 | "Hexagon v4">; |
Sirish Pande | 7517bbc | 2012-05-10 20:20:25 +0000 | [diff] [blame] | 31 | def ArchV5 : SubtargetFeature<"v5", "HexagonArchVersion", "V5", |
| 32 | "Hexagon v5">; |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 33 | |
| 34 | //===----------------------------------------------------------------------===// |
| 35 | // Register File, Calling Conv, Instruction Descriptions |
| 36 | //===----------------------------------------------------------------------===// |
| 37 | include "HexagonSchedule.td" |
| 38 | include "HexagonRegisterInfo.td" |
| 39 | include "HexagonCallingConv.td" |
| 40 | include "HexagonInstrInfo.td" |
| 41 | include "HexagonIntrinsics.td" |
| 42 | include "HexagonIntrinsicsDerived.td" |
| 43 | |
Evandro Menezes | e5041e6 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 44 | def HexagonInstrInfo : InstrInfo; |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 45 | |
| 46 | //===----------------------------------------------------------------------===// |
| 47 | // Hexagon processors supported. |
| 48 | //===----------------------------------------------------------------------===// |
| 49 | |
Andrew Trick | 2661b41 | 2012-07-07 04:00:00 +0000 | [diff] [blame^] | 50 | class Proc<string Name, SchedMachineModel Model, |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 51 | list<SubtargetFeature> Features> |
Andrew Trick | 2661b41 | 2012-07-07 04:00:00 +0000 | [diff] [blame^] | 52 | : ProcessorModel<Name, Model, Features>; |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 53 | |
Andrew Trick | 2661b41 | 2012-07-07 04:00:00 +0000 | [diff] [blame^] | 54 | def : Proc<"hexagonv2", HexagonModel, [ArchV2]>; |
| 55 | def : Proc<"hexagonv3", HexagonModel, [ArchV2, ArchV3]>; |
| 56 | def : Proc<"hexagonv4", HexagonModelV4, [ArchV2, ArchV3, ArchV4]>; |
| 57 | def : Proc<"hexagonv5", HexagonModelV4, [ArchV2, ArchV3, ArchV4, ArchV5]>; |
Sirish Pande | 7517bbc | 2012-05-10 20:20:25 +0000 | [diff] [blame] | 58 | |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 59 | |
Evandro Menezes | e5041e6 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 60 | // Hexagon Uses the MC printer for assembler output, so make sure the TableGen |
| 61 | // AsmWriter bits get associated with the correct class. |
| 62 | def HexagonAsmWriter : AsmWriter { |
| 63 | string AsmWriterClassName = "InstPrinter"; |
| 64 | bit isMCAsmWriter = 1; |
| 65 | } |
| 66 | |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 67 | //===----------------------------------------------------------------------===// |
| 68 | // Declare the target which we are implementing |
| 69 | //===----------------------------------------------------------------------===// |
| 70 | |
| 71 | def Hexagon : Target { |
| 72 | // Pull in Instruction Info: |
| 73 | let InstructionSet = HexagonInstrInfo; |
Evandro Menezes | e5041e6 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 74 | |
| 75 | let AssemblyWriters = [HexagonAsmWriter]; |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 76 | } |