| Rafael Espindola | ffdc24b | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 1 | //===- ARM.td - Describe the ARM Target Machine -----------------*- C++ -*-===// | 
|  | 2 | // | 
|  | 3 | //                     The LLVM Compiler Infrastructure | 
|  | 4 | // | 
| Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source | 
| Rafael Espindola | ffdc24b | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 6 | // License. See LICENSE.TXT for details. | 
|  | 7 | // | 
|  | 8 | //===----------------------------------------------------------------------===// | 
|  | 9 | // | 
|  | 10 | // | 
|  | 11 | //===----------------------------------------------------------------------===// | 
|  | 12 |  | 
|  | 13 | //===----------------------------------------------------------------------===// | 
|  | 14 | // Target-independent interfaces which we are implementing | 
|  | 15 | //===----------------------------------------------------------------------===// | 
|  | 16 |  | 
| Evan Cheng | 977e7be | 2008-11-24 07:34:46 +0000 | [diff] [blame] | 17 | include "llvm/Target/Target.td" | 
| Rafael Espindola | ffdc24b | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 18 |  | 
|  | 19 | //===----------------------------------------------------------------------===// | 
| Evan Cheng | 10043e2 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 20 | // ARM Subtarget features. | 
|  | 21 | // | 
|  | 22 |  | 
|  | 23 | def ArchV4T     : SubtargetFeature<"v4t", "ARMArchVersion", "V4T", | 
|  | 24 | "ARM v4T">; | 
|  | 25 | def ArchV5T     : SubtargetFeature<"v5t", "ARMArchVersion", "V5T", | 
|  | 26 | "ARM v5T">; | 
|  | 27 | def ArchV5TE    : SubtargetFeature<"v5te", "ARMArchVersion", "V5TE", | 
|  | 28 | "ARM v5TE, v5TEj, v5TExp">; | 
|  | 29 | def ArchV6      : SubtargetFeature<"v6", "ARMArchVersion", "V6", | 
|  | 30 | "ARM v6">; | 
| Anton Korobeynikov | c82b282 | 2009-06-08 21:20:36 +0000 | [diff] [blame] | 31 | def ArchV6T2    : SubtargetFeature<"v6t2", "ARMArchVersion", "V6T2", | 
|  | 32 | "ARM v6t2">; | 
| Anton Korobeynikov | 0b91cc4 | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 33 | def ArchV7A     : SubtargetFeature<"v7a", "ARMArchVersion", "V7A", | 
|  | 34 | "ARM v7A">; | 
|  | 35 | def FeatureVFP2 : SubtargetFeature<"vfp2", "ARMFPUType", "VFPv2", | 
| Anton Korobeynikov | b6f4538 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 36 | "Enable VFP2 instructions">; | 
| Anton Korobeynikov | 0b91cc4 | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 37 | def FeatureVFP3 : SubtargetFeature<"vfp3", "ARMFPUType", "VFPv3", | 
| Anton Korobeynikov | b6f4538 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 38 | "Enable VFP3 instructions">; | 
| Anton Korobeynikov | 0b91cc4 | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 39 | def FeatureNEON : SubtargetFeature<"neon", "ARMFPUType", "NEON", | 
| Anton Korobeynikov | b6f4538 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 40 | "Enable NEON instructions">; | 
|  | 41 | def FeatureThumb2 : SubtargetFeature<"thumb2", "ThumbMode", "Thumb2", | 
|  | 42 | "Enable Thumb2 instructions">; | 
| Evan Cheng | 10043e2 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 43 |  | 
|  | 44 | //===----------------------------------------------------------------------===// | 
|  | 45 | // ARM Processors supported. | 
|  | 46 | // | 
|  | 47 |  | 
| Evan Cheng | 4e712de | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 48 | include "ARMSchedule.td" | 
|  | 49 |  | 
|  | 50 | class ProcNoItin<string Name, list<SubtargetFeature> Features> | 
|  | 51 | : Processor<Name, GenericItineraries, Features>; | 
| Evan Cheng | 10043e2 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 52 |  | 
|  | 53 | // V4 Processors. | 
| Evan Cheng | 4e712de | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 54 | def : ProcNoItin<"generic",         []>; | 
|  | 55 | def : ProcNoItin<"arm8",            []>; | 
|  | 56 | def : ProcNoItin<"arm810",          []>; | 
|  | 57 | def : ProcNoItin<"strongarm",       []>; | 
|  | 58 | def : ProcNoItin<"strongarm110",    []>; | 
|  | 59 | def : ProcNoItin<"strongarm1100",   []>; | 
|  | 60 | def : ProcNoItin<"strongarm1110",   []>; | 
| Evan Cheng | 10043e2 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 61 |  | 
|  | 62 | // V4T Processors. | 
| Evan Cheng | 4e712de | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 63 | def : ProcNoItin<"arm7tdmi",        [ArchV4T]>; | 
|  | 64 | def : ProcNoItin<"arm7tdmi-s",      [ArchV4T]>; | 
|  | 65 | def : ProcNoItin<"arm710t",         [ArchV4T]>; | 
|  | 66 | def : ProcNoItin<"arm720t",         [ArchV4T]>; | 
|  | 67 | def : ProcNoItin<"arm9",            [ArchV4T]>; | 
|  | 68 | def : ProcNoItin<"arm9tdmi",        [ArchV4T]>; | 
|  | 69 | def : ProcNoItin<"arm920",          [ArchV4T]>; | 
|  | 70 | def : ProcNoItin<"arm920t",         [ArchV4T]>; | 
|  | 71 | def : ProcNoItin<"arm922t",         [ArchV4T]>; | 
|  | 72 | def : ProcNoItin<"arm940t",         [ArchV4T]>; | 
|  | 73 | def : ProcNoItin<"ep9312",          [ArchV4T]>; | 
| Evan Cheng | 10043e2 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 74 |  | 
|  | 75 | // V5T Processors. | 
| Evan Cheng | 4e712de | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 76 | def : ProcNoItin<"arm10tdmi",       [ArchV5T]>; | 
|  | 77 | def : ProcNoItin<"arm1020t",        [ArchV5T]>; | 
| Evan Cheng | 10043e2 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 78 |  | 
|  | 79 | // V5TE Processors. | 
| Evan Cheng | 4e712de | 2009-06-19 01:51:50 +0000 | [diff] [blame] | 80 | def : ProcNoItin<"arm9e",           [ArchV5TE]>; | 
|  | 81 | def : ProcNoItin<"arm926ej-s",      [ArchV5TE]>; | 
|  | 82 | def : ProcNoItin<"arm946e-s",       [ArchV5TE]>; | 
|  | 83 | def : ProcNoItin<"arm966e-s",       [ArchV5TE]>; | 
|  | 84 | def : ProcNoItin<"arm968e-s",       [ArchV5TE]>; | 
|  | 85 | def : ProcNoItin<"arm10e",          [ArchV5TE]>; | 
|  | 86 | def : ProcNoItin<"arm1020e",        [ArchV5TE]>; | 
|  | 87 | def : ProcNoItin<"arm1022e",        [ArchV5TE]>; | 
|  | 88 | def : ProcNoItin<"xscale",          [ArchV5TE]>; | 
|  | 89 | def : ProcNoItin<"iwmmxt",          [ArchV5TE]>; | 
| Evan Cheng | 10043e2 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 90 |  | 
|  | 91 | // V6 Processors. | 
| David Goodwin | afcaf79 | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 92 | def : ProcNoItin<"arm1136j-s",      [ArchV6]>; | 
|  | 93 | def : ProcNoItin<"arm1136jf-s",     [ArchV6, FeatureVFP2]>; | 
|  | 94 | def : ProcNoItin<"arm1176jz-s",     [ArchV6]>; | 
|  | 95 | def : ProcNoItin<"arm1176jzf-s",    [ArchV6, FeatureVFP2]>; | 
|  | 96 | def : ProcNoItin<"mpcorenovfp",     [ArchV6]>; | 
|  | 97 | def : ProcNoItin<"mpcore",          [ArchV6, FeatureVFP2]>; | 
| Evan Cheng | 10043e2 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 98 |  | 
| Anton Korobeynikov | c82b282 | 2009-06-08 21:20:36 +0000 | [diff] [blame] | 99 | // V6T2 Processors. | 
| David Goodwin | afcaf79 | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 100 | def : ProcNoItin<"arm1156t2-s",     [ArchV6T2, FeatureThumb2]>; | 
|  | 101 | def : ProcNoItin<"arm1156t2f-s",    [ArchV6T2, FeatureThumb2, FeatureVFP2]>; | 
| Anton Korobeynikov | b6f4538 | 2009-05-29 23:41:08 +0000 | [diff] [blame] | 102 |  | 
| Anton Korobeynikov | c82b282 | 2009-06-08 21:20:36 +0000 | [diff] [blame] | 103 | // V7 Processors. | 
| Evan Cheng | 18e3294 | 2009-07-21 18:54:14 +0000 | [diff] [blame] | 104 | def : Processor<"cortex-a8",        CortexA8Itineraries, | 
| David Goodwin | 1cc6dd9 | 2009-10-01 22:19:57 +0000 | [diff] [blame] | 105 | [ArchV7A, FeatureThumb2, FeatureNEON]>; | 
| David Goodwin | afcaf79 | 2009-09-23 21:38:08 +0000 | [diff] [blame] | 106 | def : ProcNoItin<"cortex-a9",       [ArchV7A, FeatureThumb2, FeatureNEON]>; | 
| Anton Korobeynikov | 0b91cc4 | 2009-05-23 19:51:43 +0000 | [diff] [blame] | 107 |  | 
| Evan Cheng | 10043e2 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 108 | //===----------------------------------------------------------------------===// | 
| Rafael Espindola | ffdc24b | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 109 | // Register File Description | 
|  | 110 | //===----------------------------------------------------------------------===// | 
|  | 111 |  | 
|  | 112 | include "ARMRegisterInfo.td" | 
|  | 113 |  | 
| Bob Wilson | a4c2290 | 2009-04-17 19:07:39 +0000 | [diff] [blame] | 114 | include "ARMCallingConv.td" | 
|  | 115 |  | 
| Rafael Espindola | ffdc24b | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 116 | //===----------------------------------------------------------------------===// | 
|  | 117 | // Instruction Descriptions | 
|  | 118 | //===----------------------------------------------------------------------===// | 
|  | 119 |  | 
|  | 120 | include "ARMInstrInfo.td" | 
|  | 121 |  | 
|  | 122 | def ARMInstrInfo : InstrInfo { | 
|  | 123 | // Define how we want to layout our target-specific information field. | 
| Evan Cheng | 10043e2 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 124 | let TSFlagsFields = ["AddrModeBits", | 
|  | 125 | "SizeFlag", | 
|  | 126 | "IndexModeBits", | 
| Evan Cheng | 1496576 | 2009-07-08 01:46:35 +0000 | [diff] [blame] | 127 | "Form", | 
| Anton Korobeynikov | 14635da | 2009-11-02 00:10:38 +0000 | [diff] [blame] | 128 | "isUnaryDataProc", | 
|  | 129 | "canXformTo16Bit", | 
|  | 130 | "Dom"]; | 
| Evan Cheng | 10043e2 | 2007-01-19 07:51:42 +0000 | [diff] [blame] | 131 | let TSFlagsShifts = [0, | 
|  | 132 | 4, | 
|  | 133 | 7, | 
| Evan Cheng | f7c6eff | 2007-08-07 01:37:15 +0000 | [diff] [blame] | 134 | 9, | 
| Anton Korobeynikov | 14635da | 2009-11-02 00:10:38 +0000 | [diff] [blame] | 135 | 15, | 
|  | 136 | 16, | 
|  | 137 | 17]; | 
| Rafael Espindola | ffdc24b | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 138 | } | 
|  | 139 |  | 
|  | 140 | //===----------------------------------------------------------------------===// | 
|  | 141 | // Declare the target which we are implementing | 
|  | 142 | //===----------------------------------------------------------------------===// | 
|  | 143 |  | 
|  | 144 | def ARM : Target { | 
| Rafael Espindola | ffdc24b | 2006-05-14 22:18:28 +0000 | [diff] [blame] | 145 | // Pull in Instruction Info: | 
|  | 146 | let InstructionSet = ARMInstrInfo; | 
|  | 147 | } |