Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- PPC.td - Describe the PowerPC Target Machine -------*- tablegen -*-===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 6 | // |
Chris Lattner | 0921e3b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This is the top level entry point for the PowerPC target. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | // Get the target-independent interfaces which we are implementing. |
| 14 | // |
Evan Cheng | 977e7be | 2008-11-24 07:34:46 +0000 | [diff] [blame] | 15 | include "llvm/Target/Target.td" |
Chris Lattner | 0921e3b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 16 | |
| 17 | //===----------------------------------------------------------------------===// |
Jim Laskey | 13a1945 | 2005-10-22 08:04:24 +0000 | [diff] [blame] | 18 | // PowerPC Subtarget features. |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 19 | // |
Nemanja Ivanovic | d384cd9 | 2015-03-04 17:09:12 +0000 | [diff] [blame] | 20 | |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 21 | //===----------------------------------------------------------------------===// |
| 22 | // CPU Directives // |
| 23 | //===----------------------------------------------------------------------===// |
| 24 | |
Hal Finkel | 6fa5697 | 2011-10-17 04:03:49 +0000 | [diff] [blame] | 25 | def Directive440 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_440", "">; |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 26 | def Directive601 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_601", "">; |
| 27 | def Directive602 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_602", "">; |
| 28 | def Directive603 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">; |
| 29 | def Directive604 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">; |
| 30 | def Directive620 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_603", "">; |
| 31 | def Directive7400: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_7400", "">; |
| 32 | def Directive750 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_750", "">; |
| 33 | def Directive970 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_970", "">; |
| 34 | def Directive32 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_32", "">; |
| 35 | def Directive64 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_64", "">; |
Hal Finkel | 9f9f892 | 2012-04-01 19:22:40 +0000 | [diff] [blame] | 36 | def DirectiveA2 : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_A2", "">; |
Justin Hibbits | ceb3cd9 | 2018-07-18 04:24:49 +0000 | [diff] [blame] | 37 | def DirectiveE500 : SubtargetFeature<"", "DarwinDirective", |
| 38 | "PPC::DIR_E500", "">; |
Hal Finkel | 742b535 | 2012-08-28 16:12:39 +0000 | [diff] [blame] | 39 | def DirectiveE500mc : SubtargetFeature<"", "DarwinDirective", |
| 40 | "PPC::DIR_E500mc", "">; |
Eric Christopher | 47d372f | 2016-06-23 01:33:38 +0000 | [diff] [blame] | 41 | def DirectiveE5500 : SubtargetFeature<"", "DarwinDirective", |
Hal Finkel | 742b535 | 2012-08-28 16:12:39 +0000 | [diff] [blame] | 42 | "PPC::DIR_E5500", "">; |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 43 | def DirectivePwr3: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR3", "">; |
| 44 | def DirectivePwr4: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR4", "">; |
| 45 | def DirectivePwr5: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR5", "">; |
Eric Christopher | 47d372f | 2016-06-23 01:33:38 +0000 | [diff] [blame] | 46 | def DirectivePwr5x |
| 47 | : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR5X", "">; |
Hal Finkel | f2b9c38 | 2012-06-11 15:43:08 +0000 | [diff] [blame] | 48 | def DirectivePwr6: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR6", "">; |
Eric Christopher | 47d372f | 2016-06-23 01:33:38 +0000 | [diff] [blame] | 49 | def DirectivePwr6x |
| 50 | : SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR6X", "">; |
Hal Finkel | f2b9c38 | 2012-06-11 15:43:08 +0000 | [diff] [blame] | 51 | def DirectivePwr7: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR7", "">; |
Will Schmidt | 970ff64 | 2014-06-26 13:36:19 +0000 | [diff] [blame] | 52 | def DirectivePwr8: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR8", "">; |
Nemanja Ivanovic | 6e29baf | 2016-05-09 18:54:58 +0000 | [diff] [blame] | 53 | def DirectivePwr9: SubtargetFeature<"", "DarwinDirective", "PPC::DIR_PWR9", "">; |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 54 | |
Chris Lattner | a35f306 | 2006-06-16 17:34:12 +0000 | [diff] [blame] | 55 | def Feature64Bit : SubtargetFeature<"64bit","Has64BitSupport", "true", |
Chris Lattner | 0d4923b | 2005-10-23 05:28:51 +0000 | [diff] [blame] | 56 | "Enable 64-bit instructions">; |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 57 | def FeatureHardFloat : SubtargetFeature<"hard-float", "HasHardFloat", "true", |
| 58 | "Enable floating-point instructions">; |
Chris Lattner | a35f306 | 2006-06-16 17:34:12 +0000 | [diff] [blame] | 59 | def Feature64BitRegs : SubtargetFeature<"64bitregs","Use64BitRegs", "true", |
| 60 | "Enable 64-bit registers usage for ppc32 [beta]">; |
Hal Finkel | 940ab93 | 2014-02-28 00:27:01 +0000 | [diff] [blame] | 61 | def FeatureCRBits : SubtargetFeature<"crbits", "UseCRBits", "true", |
| 62 | "Use condition-register bits individually">; |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 63 | def FeatureFPU : SubtargetFeature<"fpu","HasFPU","true", |
| 64 | "Enable classic FPU instructions", |
| 65 | [FeatureHardFloat]>; |
Evan Cheng | d98701c | 2006-01-27 08:09:42 +0000 | [diff] [blame] | 66 | def FeatureAltivec : SubtargetFeature<"altivec","HasAltivec", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 67 | "Enable Altivec instructions", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 68 | [FeatureFPU]>; |
Joerg Sonnenberger | 39f095a | 2014-08-07 12:18:21 +0000 | [diff] [blame] | 69 | def FeatureSPE : SubtargetFeature<"spe","HasSPE", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 70 | "Enable SPE instructions", |
| 71 | [FeatureHardFloat]>; |
Hal Finkel | bfd3d08 | 2012-06-11 19:57:01 +0000 | [diff] [blame] | 72 | def FeatureMFOCRF : SubtargetFeature<"mfocrf","HasMFOCRF", "true", |
| 73 | "Enable the MFOCRF instruction">; |
Evan Cheng | d98701c | 2006-01-27 08:09:42 +0000 | [diff] [blame] | 74 | def FeatureFSqrt : SubtargetFeature<"fsqrt","HasFSQRT", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 75 | "Enable the fsqrt instruction", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 76 | [FeatureFPU]>; |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 77 | def FeatureFCPSGN : SubtargetFeature<"fcpsgn", "HasFCPSGN", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 78 | "Enable the fcpsgn instruction", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 79 | [FeatureFPU]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 80 | def FeatureFRE : SubtargetFeature<"fre", "HasFRE", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 81 | "Enable the fre instruction", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 82 | [FeatureFPU]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 83 | def FeatureFRES : SubtargetFeature<"fres", "HasFRES", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 84 | "Enable the fres instruction", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 85 | [FeatureFPU]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 86 | def FeatureFRSQRTE : SubtargetFeature<"frsqrte", "HasFRSQRTE", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 87 | "Enable the frsqrte instruction", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 88 | [FeatureFPU]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 89 | def FeatureFRSQRTES : SubtargetFeature<"frsqrtes", "HasFRSQRTES", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 90 | "Enable the frsqrtes instruction", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 91 | [FeatureFPU]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 92 | def FeatureRecipPrec : SubtargetFeature<"recipprec", "HasRecipPrec", "true", |
| 93 | "Assume higher precision reciprocal estimates">; |
Chris Lattner | b9f35f0 | 2006-02-28 07:08:22 +0000 | [diff] [blame] | 94 | def FeatureSTFIWX : SubtargetFeature<"stfiwx","HasSTFIWX", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 95 | "Enable the stfiwx instruction", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 96 | [FeatureFPU]>; |
Hal Finkel | beb296b | 2013-03-31 10:12:51 +0000 | [diff] [blame] | 97 | def FeatureLFIWAX : SubtargetFeature<"lfiwax","HasLFIWAX", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 98 | "Enable the lfiwax instruction", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 99 | [FeatureFPU]>; |
Hal Finkel | c20a08d | 2013-03-29 08:57:48 +0000 | [diff] [blame] | 100 | def FeatureFPRND : SubtargetFeature<"fprnd", "HasFPRND", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 101 | "Enable the fri[mnpz] instructions", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 102 | [FeatureFPU]>; |
Hal Finkel | f6d45f2 | 2013-04-01 17:52:07 +0000 | [diff] [blame] | 103 | def FeatureFPCVT : SubtargetFeature<"fpcvt", "HasFPCVT", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 104 | "Enable fc[ft]* (unsigned and single-precision) and lfiwzx instructions", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 105 | [FeatureFPU]>; |
Hal Finkel | 460e94d | 2012-06-22 23:10:08 +0000 | [diff] [blame] | 106 | def FeatureISEL : SubtargetFeature<"isel","HasISEL", "true", |
| 107 | "Enable the isel instruction">; |
Nemanja Ivanovic | c090479 | 2015-04-09 23:54:37 +0000 | [diff] [blame] | 108 | def FeatureBPERMD : SubtargetFeature<"bpermd", "HasBPERMD", "true", |
| 109 | "Enable the bpermd instruction">; |
| 110 | def FeatureExtDiv : SubtargetFeature<"extdiv", "HasExtDiv", "true", |
| 111 | "Enable extended divide instructions">; |
Hal Finkel | 31d2956 | 2013-03-28 19:25:55 +0000 | [diff] [blame] | 112 | def FeatureLDBRX : SubtargetFeature<"ldbrx","HasLDBRX", "true", |
| 113 | "Enable the ldbrx instruction">; |
Hal Finkel | 4edc66b | 2015-01-03 01:16:37 +0000 | [diff] [blame] | 114 | def FeatureCMPB : SubtargetFeature<"cmpb", "HasCMPB", "true", |
| 115 | "Enable the cmpb instruction">; |
Bill Schmidt | 082cfc0 | 2015-01-14 20:17:10 +0000 | [diff] [blame] | 116 | def FeatureICBT : SubtargetFeature<"icbt","HasICBT", "true", |
| 117 | "Enable icbt instruction">; |
Hal Finkel | 6fa5697 | 2011-10-17 04:03:49 +0000 | [diff] [blame] | 118 | def FeatureBookE : SubtargetFeature<"booke", "IsBookE", "true", |
Bill Schmidt | 082cfc0 | 2015-01-14 20:17:10 +0000 | [diff] [blame] | 119 | "Enable Book E instructions", |
| 120 | [FeatureICBT]>; |
Hal Finkel | fe3368c | 2014-10-02 22:34:22 +0000 | [diff] [blame] | 121 | def FeatureMSYNC : SubtargetFeature<"msync", "HasOnlyMSYNC", "true", |
| 122 | "Has only the msync instruction instead of sync", |
| 123 | [FeatureBookE]>; |
Joerg Sonnenberger | 6ae087a | 2014-08-07 12:31:28 +0000 | [diff] [blame] | 124 | def FeatureE500 : SubtargetFeature<"e500", "IsE500", "true", |
Joerg Sonnenberger | 0b2ebcb | 2014-08-04 15:47:38 +0000 | [diff] [blame] | 125 | "Enable E500/E500mc instructions">; |
Strahinja Petrovic | 06cf6a6 | 2018-03-27 11:23:53 +0000 | [diff] [blame] | 126 | def FeatureSecurePlt : SubtargetFeature<"secure-plt","SecurePlt", "true", |
| 127 | "Enable secure plt mode">; |
Joerg Sonnenberger | 0b2ebcb | 2014-08-04 15:47:38 +0000 | [diff] [blame] | 128 | def FeaturePPC4xx : SubtargetFeature<"ppc4xx", "IsPPC4xx", "true", |
| 129 | "Enable PPC 4xx instructions">; |
Joerg Sonnenberger | 7405210 | 2014-08-04 17:07:41 +0000 | [diff] [blame] | 130 | def FeaturePPC6xx : SubtargetFeature<"ppc6xx", "IsPPC6xx", "true", |
| 131 | "Enable PPC 6xx instructions">; |
Hal Finkel | efb305e | 2013-01-30 21:17:42 +0000 | [diff] [blame] | 132 | def FeatureQPX : SubtargetFeature<"qpx","HasQPX", "true", |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 133 | "Enable QPX instructions", |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 134 | [FeatureFPU]>; |
Eric Christopher | 081efcc | 2013-10-16 20:38:58 +0000 | [diff] [blame] | 135 | def FeatureVSX : SubtargetFeature<"vsx","HasVSX", "true", |
Hal Finkel | 27774d9 | 2014-03-13 07:58:58 +0000 | [diff] [blame] | 136 | "Enable VSX instructions", |
| 137 | [FeatureAltivec]>; |
Nemanja Ivanovic | b4f028f | 2019-05-07 13:48:03 +0000 | [diff] [blame] | 138 | def FeatureTwoConstNR : |
| 139 | SubtargetFeature<"two-const-nr", "NeedsTwoConstNR", "true", |
| 140 | "Requires two constant Newton-Raphson computation">; |
Bill Schmidt | fe88b18 | 2015-02-03 21:58:23 +0000 | [diff] [blame] | 141 | def FeatureP8Altivec : SubtargetFeature<"power8-altivec", "HasP8Altivec", "true", |
| 142 | "Enable POWER8 Altivec instructions", |
| 143 | [FeatureAltivec]>; |
Nemanja Ivanovic | e8effe1 | 2015-03-04 20:44:33 +0000 | [diff] [blame] | 144 | def FeatureP8Crypto : SubtargetFeature<"crypto", "HasP8Crypto", "true", |
Nemanja Ivanovic | 0adf26b | 2015-03-10 20:51:07 +0000 | [diff] [blame] | 145 | "Enable POWER8 Crypto instructions", |
| 146 | [FeatureP8Altivec]>; |
NAKAMURA Takumi | cc4487e | 2014-12-09 01:03:27 +0000 | [diff] [blame] | 147 | def FeatureP8Vector : SubtargetFeature<"power8-vector", "HasP8Vector", "true", |
| 148 | "Enable POWER8 vector instructions", |
Bill Schmidt | fe88b18 | 2015-02-03 21:58:23 +0000 | [diff] [blame] | 149 | [FeatureVSX, FeatureP8Altivec]>; |
Nemanja Ivanovic | c38b531 | 2015-04-11 10:40:42 +0000 | [diff] [blame] | 150 | def FeatureDirectMove : |
| 151 | SubtargetFeature<"direct-move", "HasDirectMove", "true", |
| 152 | "Enable Power8 direct move instructions", |
| 153 | [FeatureVSX]>; |
Nemanja Ivanovic | 0adf26b | 2015-03-10 20:51:07 +0000 | [diff] [blame] | 154 | def FeaturePartwordAtomic : SubtargetFeature<"partword-atomics", |
| 155 | "HasPartwordAtomics", "true", |
| 156 | "Enable l[bh]arx and st[bh]cx.">; |
Hal Finkel | e2ab0f1 | 2015-01-15 21:17:34 +0000 | [diff] [blame] | 157 | def FeatureInvariantFunctionDescriptors : |
| 158 | SubtargetFeature<"invariant-function-descriptors", |
| 159 | "HasInvariantFunctionDescriptors", "true", |
| 160 | "Assume function descriptors are invariant">; |
Hal Finkel | b074a60 | 2016-08-30 00:59:23 +0000 | [diff] [blame] | 161 | def FeatureLongCall : SubtargetFeature<"longcall", "UseLongCalls", "true", |
| 162 | "Always use indirect calls">; |
Kit Barton | 535e69d | 2015-03-25 19:36:23 +0000 | [diff] [blame] | 163 | def FeatureHTM : SubtargetFeature<"htm", "HasHTM", "true", |
| 164 | "Enable Hardware Transactional Memory instructions">; |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 165 | def FeatureMFTB : SubtargetFeature<"", "FeatureMFTB", "true", |
| 166 | "Implement mftb using the mfspr instruction">; |
QingShan Zhang | 5321dcd | 2019-03-27 03:50:16 +0000 | [diff] [blame] | 167 | def FeaturePPCPreRASched: |
| 168 | SubtargetFeature<"ppc-prera-sched", "UsePPCPreRASchedStrategy", "true", |
| 169 | "Use PowerPC pre-RA scheduling strategy">; |
| 170 | def FeaturePPCPostRASched: |
| 171 | SubtargetFeature<"ppc-postra-sched", "UsePPCPostRASchedStrategy", "true", |
| 172 | "Use PowerPC post-RA scheduling strategy">; |
Nemanja Ivanovic | b033f67 | 2015-12-15 12:19:34 +0000 | [diff] [blame] | 173 | def FeatureFloat128 : |
| 174 | SubtargetFeature<"float128", "HasFloat128", "true", |
| 175 | "Enable the __float128 data type for IEEE-754R Binary128.", |
| 176 | [FeatureVSX]>; |
Hal Finkel | fa7057a | 2016-03-29 01:36:01 +0000 | [diff] [blame] | 177 | def FeaturePOPCNTD : SubtargetFeature<"popcntd","HasPOPCNTD", |
| 178 | "POPCNTD_Fast", |
| 179 | "Enable the popcnt[dw] instructions">; |
Hal Finkel | 7059d41 | 2016-03-28 17:52:08 +0000 | [diff] [blame] | 180 | // Note that for the a2/a2q processor models we should not use popcnt[dw] by |
| 181 | // default. These processors do support the instructions, but they're |
| 182 | // microcoded, and the software emulation is about twice as fast. |
Hal Finkel | fa7057a | 2016-03-29 01:36:01 +0000 | [diff] [blame] | 183 | def FeatureSlowPOPCNTD : SubtargetFeature<"slow-popcntd","HasPOPCNTD", |
| 184 | "POPCNTD_Slow", |
| 185 | "Has slow popcnt[dw] instructions">; |
| 186 | |
| 187 | def DeprecatedDST : SubtargetFeature<"", "DeprecatedDST", "true", |
| 188 | "Treat vector data stream cache control instructions as deprecated">; |
Hal Finkel | 7059d41 | 2016-03-28 17:52:08 +0000 | [diff] [blame] | 189 | |
Nemanja Ivanovic | a621a7f | 2016-03-31 15:26:37 +0000 | [diff] [blame] | 190 | def FeatureISA3_0 : SubtargetFeature<"isa-v30-instructions", "IsISA3_0", |
| 191 | "true", |
| 192 | "Enable instructions added in ISA 3.0.">; |
Nemanja Ivanovic | 87bcae3 | 2016-04-13 18:51:18 +0000 | [diff] [blame] | 193 | def FeatureP9Altivec : SubtargetFeature<"power9-altivec", "HasP9Altivec", "true", |
| 194 | "Enable POWER9 Altivec instructions", |
| 195 | [FeatureISA3_0, FeatureP8Altivec]>; |
| 196 | def FeatureP9Vector : SubtargetFeature<"power9-vector", "HasP9Vector", "true", |
| 197 | "Enable POWER9 vector instructions", |
| 198 | [FeatureISA3_0, FeatureP8Vector, |
| 199 | FeatureP9Altivec]>; |
Nemanja Ivanovic | 7d007dd | 2019-01-26 01:18:48 +0000 | [diff] [blame] | 200 | // A separate feature for this even though it is equivalent to P9Vector |
| 201 | // because this is a feature of the implementation rather than the architecture |
| 202 | // and may go away with future CPU's. |
| 203 | def FeatureVectorsUseTwoUnits : SubtargetFeature<"vectors-use-two-units", |
| 204 | "VectorsUseTwoUnits", |
| 205 | "true", |
| 206 | "Vectors use two units">; |
Nemanja Ivanovic | a621a7f | 2016-03-31 15:26:37 +0000 | [diff] [blame] | 207 | |
Eric Christopher | 47d372f | 2016-06-23 01:33:38 +0000 | [diff] [blame] | 208 | // Since new processors generally contain a superset of features of those that |
| 209 | // came before them, the idea is to make implementations of new processors |
| 210 | // less error prone and easier to read. |
| 211 | // Namely: |
| 212 | // list<SubtargetFeature> Power8FeatureList = ... |
| 213 | // list<SubtargetFeature> FutureProcessorSpecificFeatureList = |
| 214 | // [ features that Power8 does not support ] |
| 215 | // list<SubtargetFeature> FutureProcessorFeatureList = |
| 216 | // !listconcat(Power8FeatureList, FutureProcessorSpecificFeatureList) |
Nemanja Ivanovic | c090479 | 2015-04-09 23:54:37 +0000 | [diff] [blame] | 217 | |
Eric Christopher | 47d372f | 2016-06-23 01:33:38 +0000 | [diff] [blame] | 218 | // Makes it explicit and obvious what is new in FutureProcesor vs. Power8 as |
| 219 | // well as providing a single point of definition if the feature set will be |
| 220 | // used elsewhere. |
Nemanja Ivanovic | c090479 | 2015-04-09 23:54:37 +0000 | [diff] [blame] | 221 | def ProcessorFeatures { |
| 222 | list<SubtargetFeature> Power7FeatureList = |
| 223 | [DirectivePwr7, FeatureAltivec, FeatureVSX, |
| 224 | FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE, |
| 225 | FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES, |
| 226 | FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX, |
| 227 | FeatureFPRND, FeatureFPCVT, FeatureISEL, |
| 228 | FeaturePOPCNTD, FeatureCMPB, FeatureLDBRX, |
Hal Finkel | 58f5f9c | 2015-04-11 13:40:36 +0000 | [diff] [blame] | 229 | Feature64Bit /*, Feature64BitRegs */, |
Nemanja Ivanovic | c090479 | 2015-04-09 23:54:37 +0000 | [diff] [blame] | 230 | FeatureBPERMD, FeatureExtDiv, |
Nemanja Ivanovic | b4f028f | 2019-05-07 13:48:03 +0000 | [diff] [blame] | 231 | FeatureMFTB, DeprecatedDST, FeatureTwoConstNR]; |
Nemanja Ivanovic | c090479 | 2015-04-09 23:54:37 +0000 | [diff] [blame] | 232 | list<SubtargetFeature> Power8SpecificFeatures = |
| 233 | [DirectivePwr8, FeatureP8Altivec, FeatureP8Vector, FeatureP8Crypto, |
Jinsong Ji | c627aa2 | 2019-06-27 19:35:11 +0000 | [diff] [blame] | 234 | FeatureHTM, FeatureDirectMove, FeatureICBT, FeaturePartwordAtomic]; |
Nemanja Ivanovic | c090479 | 2015-04-09 23:54:37 +0000 | [diff] [blame] | 235 | list<SubtargetFeature> Power8FeatureList = |
| 236 | !listconcat(Power7FeatureList, Power8SpecificFeatures); |
Nemanja Ivanovic | 87bcae3 | 2016-04-13 18:51:18 +0000 | [diff] [blame] | 237 | list<SubtargetFeature> Power9SpecificFeatures = |
Nemanja Ivanovic | 7d007dd | 2019-01-26 01:18:48 +0000 | [diff] [blame] | 238 | [DirectivePwr9, FeatureP9Altivec, FeatureP9Vector, FeatureISA3_0, |
QingShan Zhang | 5321dcd | 2019-03-27 03:50:16 +0000 | [diff] [blame] | 239 | FeatureVectorsUseTwoUnits, FeaturePPCPreRASched, FeaturePPCPostRASched]; |
Nemanja Ivanovic | 6e29baf | 2016-05-09 18:54:58 +0000 | [diff] [blame] | 240 | list<SubtargetFeature> Power9FeatureList = |
| 241 | !listconcat(Power8FeatureList, Power9SpecificFeatures); |
Nemanja Ivanovic | c090479 | 2015-04-09 23:54:37 +0000 | [diff] [blame] | 242 | } |
| 243 | |
Bill Schmidt | cc99a2f | 2013-02-01 23:10:09 +0000 | [diff] [blame] | 244 | // Note: Future features to add when support is extended to more |
| 245 | // recent ISA levels: |
| 246 | // |
Bill Schmidt | cc99a2f | 2013-02-01 23:10:09 +0000 | [diff] [blame] | 247 | // DFP p6, p6x, p7 decimal floating-point instructions |
Bill Schmidt | cc99a2f | 2013-02-01 23:10:09 +0000 | [diff] [blame] | 248 | // POPCNTB p5 through p7 popcntb and related instructions |
Bill Schmidt | cc99a2f | 2013-02-01 23:10:09 +0000 | [diff] [blame] | 249 | |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 250 | //===----------------------------------------------------------------------===// |
Hal Finkel | 654d43b | 2013-04-12 02:18:09 +0000 | [diff] [blame] | 251 | // Classes used for relation maps. |
| 252 | //===----------------------------------------------------------------------===// |
| 253 | // RecFormRel - Filter class used to relate non-record-form instructions with |
| 254 | // their record-form variants. |
| 255 | class RecFormRel; |
| 256 | |
Hal Finkel | 25e0454 | 2014-03-25 18:55:11 +0000 | [diff] [blame] | 257 | // AltVSXFMARel - Filter class used to relate the primary addend-killing VSX |
| 258 | // FMA instruction forms with their corresponding factor-killing forms. |
| 259 | class AltVSXFMARel { |
| 260 | bit IsVSXFMAAlt = 0; |
| 261 | } |
| 262 | |
Hal Finkel | 654d43b | 2013-04-12 02:18:09 +0000 | [diff] [blame] | 263 | //===----------------------------------------------------------------------===// |
| 264 | // Relation Map Definitions. |
| 265 | //===----------------------------------------------------------------------===// |
| 266 | |
| 267 | def getRecordFormOpcode : InstrMapping { |
| 268 | let FilterClass = "RecFormRel"; |
| 269 | // Instructions with the same BaseName and Interpretation64Bit values |
| 270 | // form a row. |
| 271 | let RowFields = ["BaseName", "Interpretation64Bit"]; |
| 272 | // Instructions with the same RC value form a column. |
| 273 | let ColFields = ["RC"]; |
| 274 | // The key column are the non-record-form instructions. |
| 275 | let KeyCol = ["0"]; |
| 276 | // Value columns RC=1 |
| 277 | let ValueCols = [["1"]]; |
| 278 | } |
| 279 | |
| 280 | def getNonRecordFormOpcode : InstrMapping { |
| 281 | let FilterClass = "RecFormRel"; |
| 282 | // Instructions with the same BaseName and Interpretation64Bit values |
| 283 | // form a row. |
| 284 | let RowFields = ["BaseName", "Interpretation64Bit"]; |
| 285 | // Instructions with the same RC value form a column. |
| 286 | let ColFields = ["RC"]; |
| 287 | // The key column are the record-form instructions. |
| 288 | let KeyCol = ["1"]; |
| 289 | // Value columns are RC=0 |
| 290 | let ValueCols = [["0"]]; |
| 291 | } |
| 292 | |
Hal Finkel | 25e0454 | 2014-03-25 18:55:11 +0000 | [diff] [blame] | 293 | def getAltVSXFMAOpcode : InstrMapping { |
| 294 | let FilterClass = "AltVSXFMARel"; |
Jinsong Ji | 8b1abe5 | 2019-06-20 21:36:06 +0000 | [diff] [blame] | 295 | // Instructions with the same BaseName value form a row. |
Hal Finkel | 25e0454 | 2014-03-25 18:55:11 +0000 | [diff] [blame] | 296 | let RowFields = ["BaseName"]; |
Jinsong Ji | 8b1abe5 | 2019-06-20 21:36:06 +0000 | [diff] [blame] | 297 | // Instructions with the same IsVSXFMAAlt value form a column. |
Hal Finkel | 25e0454 | 2014-03-25 18:55:11 +0000 | [diff] [blame] | 298 | let ColFields = ["IsVSXFMAAlt"]; |
| 299 | // The key column are the (default) addend-killing instructions. |
| 300 | let KeyCol = ["0"]; |
| 301 | // Value columns IsVSXFMAAlt=1 |
| 302 | let ValueCols = [["1"]]; |
| 303 | } |
| 304 | |
Hal Finkel | 654d43b | 2013-04-12 02:18:09 +0000 | [diff] [blame] | 305 | //===----------------------------------------------------------------------===// |
Chris Lattner | a389f0d | 2005-10-23 22:08:13 +0000 | [diff] [blame] | 306 | // Register File Description |
| 307 | //===----------------------------------------------------------------------===// |
| 308 | |
| 309 | include "PPCRegisterInfo.td" |
| 310 | include "PPCSchedule.td" |
Chris Lattner | a389f0d | 2005-10-23 22:08:13 +0000 | [diff] [blame] | 311 | |
| 312 | //===----------------------------------------------------------------------===// |
| 313 | // PowerPC processors supported. |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 314 | // |
| 315 | |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 316 | def : Processor<"generic", G3Itineraries, [Directive32, FeatureHardFloat, |
| 317 | FeatureMFTB]>; |
Hal Finkel | 5a7162f | 2013-11-29 06:32:17 +0000 | [diff] [blame] | 318 | def : ProcessorModel<"440", PPC440Model, [Directive440, FeatureISEL, |
| 319 | FeatureFRES, FeatureFRSQRTE, |
Clement Courbet | eee2e06 | 2018-11-09 13:15:32 +0000 | [diff] [blame] | 320 | FeatureICBT, FeatureBookE, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 321 | FeatureMSYNC, FeatureMFTB]>; |
Hal Finkel | 5a7162f | 2013-11-29 06:32:17 +0000 | [diff] [blame] | 322 | def : ProcessorModel<"450", PPC440Model, [Directive440, FeatureISEL, |
| 323 | FeatureFRES, FeatureFRSQRTE, |
Clement Courbet | eee2e06 | 2018-11-09 13:15:32 +0000 | [diff] [blame] | 324 | FeatureICBT, FeatureBookE, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 325 | FeatureMSYNC, FeatureMFTB]>; |
Justin Hibbits | d52990c | 2018-07-18 04:25:10 +0000 | [diff] [blame] | 326 | def : Processor<"601", G3Itineraries, [Directive601, FeatureFPU]>; |
| 327 | def : Processor<"602", G3Itineraries, [Directive602, FeatureFPU, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 328 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 329 | def : Processor<"603", G3Itineraries, [Directive603, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 330 | FeatureFRES, FeatureFRSQRTE, |
| 331 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 332 | def : Processor<"603e", G3Itineraries, [Directive603, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 333 | FeatureFRES, FeatureFRSQRTE, |
| 334 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 335 | def : Processor<"603ev", G3Itineraries, [Directive603, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 336 | FeatureFRES, FeatureFRSQRTE, |
| 337 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 338 | def : Processor<"604", G3Itineraries, [Directive604, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 339 | FeatureFRES, FeatureFRSQRTE, |
| 340 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 341 | def : Processor<"604e", G3Itineraries, [Directive604, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 342 | FeatureFRES, FeatureFRSQRTE, |
| 343 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 344 | def : Processor<"620", G3Itineraries, [Directive620, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 345 | FeatureFRES, FeatureFRSQRTE, |
| 346 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 347 | def : Processor<"750", G4Itineraries, [Directive750, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 348 | FeatureFRES, FeatureFRSQRTE, |
| 349 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 350 | def : Processor<"g3", G3Itineraries, [Directive750, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 351 | FeatureFRES, FeatureFRSQRTE, |
| 352 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 353 | def : Processor<"7400", G4Itineraries, [Directive7400, FeatureAltivec, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 354 | FeatureFRES, FeatureFRSQRTE, |
| 355 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 356 | def : Processor<"g4", G4Itineraries, [Directive7400, FeatureAltivec, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 357 | FeatureFRES, FeatureFRSQRTE, |
| 358 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 359 | def : Processor<"7450", G4PlusItineraries, [Directive7400, FeatureAltivec, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 360 | FeatureFRES, FeatureFRSQRTE, |
| 361 | FeatureMFTB]>; |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 362 | def : Processor<"g4+", G4PlusItineraries, [Directive7400, FeatureAltivec, |
Clement Courbet | eee2e06 | 2018-11-09 13:15:32 +0000 | [diff] [blame] | 363 | FeatureFRES, FeatureFRSQRTE, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 364 | FeatureMFTB]>; |
Bill Schmidt | 279cabb | 2015-01-25 18:05:42 +0000 | [diff] [blame] | 365 | |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 366 | def : ProcessorModel<"970", G5Model, |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 367 | [Directive970, FeatureAltivec, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 368 | FeatureMFOCRF, FeatureFSqrt, |
| 369 | FeatureFRES, FeatureFRSQRTE, FeatureSTFIWX, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 370 | Feature64Bit /*, Feature64BitRegs */, |
| 371 | FeatureMFTB]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 372 | def : ProcessorModel<"g5", G5Model, |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 373 | [Directive970, FeatureAltivec, |
Hal Finkel | bfd3d08 | 2012-06-11 19:57:01 +0000 | [diff] [blame] | 374 | FeatureMFOCRF, FeatureFSqrt, FeatureSTFIWX, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 375 | FeatureFRES, FeatureFRSQRTE, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 376 | Feature64Bit /*, Feature64BitRegs */, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 377 | FeatureMFTB, DeprecatedDST]>; |
Justin Hibbits | ceb3cd9 | 2018-07-18 04:24:49 +0000 | [diff] [blame] | 378 | def : ProcessorModel<"e500", PPCE500Model, |
| 379 | [DirectiveE500, |
| 380 | FeatureICBT, FeatureBookE, |
| 381 | FeatureISEL, FeatureMFTB]>; |
Hal Finkel | 742b535 | 2012-08-28 16:12:39 +0000 | [diff] [blame] | 382 | def : ProcessorModel<"e500mc", PPCE500mcModel, |
Hal Finkel | 005f840 | 2015-11-25 10:14:31 +0000 | [diff] [blame] | 383 | [DirectiveE500mc, |
Clement Courbet | eee2e06 | 2018-11-09 13:15:32 +0000 | [diff] [blame] | 384 | FeatureSTFIWX, FeatureICBT, FeatureBookE, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 385 | FeatureISEL, FeatureMFTB]>; |
Hal Finkel | 742b535 | 2012-08-28 16:12:39 +0000 | [diff] [blame] | 386 | def : ProcessorModel<"e5500", PPCE5500Model, |
| 387 | [DirectiveE5500, FeatureMFOCRF, Feature64Bit, |
Clement Courbet | eee2e06 | 2018-11-09 13:15:32 +0000 | [diff] [blame] | 388 | FeatureSTFIWX, FeatureICBT, FeatureBookE, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 389 | FeatureISEL, FeatureMFTB]>; |
Hal Finkel | 5fde1b0 | 2013-04-05 05:34:08 +0000 | [diff] [blame] | 390 | def : ProcessorModel<"a2", PPCA2Model, |
Bill Schmidt | 082cfc0 | 2015-01-14 20:17:10 +0000 | [diff] [blame] | 391 | [DirectiveA2, FeatureICBT, FeatureBookE, FeatureMFOCRF, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 392 | FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 393 | FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec, |
| 394 | FeatureSTFIWX, FeatureLFIWAX, |
Hal Finkel | f6d45f2 | 2013-04-01 17:52:07 +0000 | [diff] [blame] | 395 | FeatureFPRND, FeatureFPCVT, FeatureISEL, |
Hal Finkel | fa7057a | 2016-03-29 01:36:01 +0000 | [diff] [blame] | 396 | FeatureSlowPOPCNTD, FeatureCMPB, FeatureLDBRX, |
Hal Finkel | 7059d41 | 2016-03-28 17:52:08 +0000 | [diff] [blame] | 397 | Feature64Bit /*, Feature64BitRegs */, FeatureMFTB]>; |
Hal Finkel | 5fde1b0 | 2013-04-05 05:34:08 +0000 | [diff] [blame] | 398 | def : ProcessorModel<"a2q", PPCA2Model, |
Bill Schmidt | 082cfc0 | 2015-01-14 20:17:10 +0000 | [diff] [blame] | 399 | [DirectiveA2, FeatureICBT, FeatureBookE, FeatureMFOCRF, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 400 | FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 401 | FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec, |
| 402 | FeatureSTFIWX, FeatureLFIWAX, |
Hal Finkel | f6d45f2 | 2013-04-01 17:52:07 +0000 | [diff] [blame] | 403 | FeatureFPRND, FeatureFPCVT, FeatureISEL, |
Hal Finkel | fa7057a | 2016-03-29 01:36:01 +0000 | [diff] [blame] | 404 | FeatureSlowPOPCNTD, FeatureCMPB, FeatureLDBRX, |
Hal Finkel | 7059d41 | 2016-03-28 17:52:08 +0000 | [diff] [blame] | 405 | Feature64Bit /*, Feature64BitRegs */, FeatureQPX, |
| 406 | FeatureMFTB]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 407 | def : ProcessorModel<"pwr3", G5Model, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 408 | [DirectivePwr3, FeatureAltivec, |
| 409 | FeatureFRES, FeatureFRSQRTE, FeatureMFOCRF, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 410 | FeatureSTFIWX, Feature64Bit]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 411 | def : ProcessorModel<"pwr4", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 412 | [DirectivePwr4, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 413 | FeatureFSqrt, FeatureFRES, FeatureFRSQRTE, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 414 | FeatureSTFIWX, Feature64Bit, FeatureMFTB]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 415 | def : ProcessorModel<"pwr5", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 416 | [DirectivePwr5, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 417 | FeatureFSqrt, FeatureFRE, FeatureFRES, |
| 418 | FeatureFRSQRTE, FeatureFRSQRTES, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 419 | FeatureSTFIWX, Feature64Bit, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 420 | FeatureMFTB, DeprecatedDST]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 421 | def : ProcessorModel<"pwr5x", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 422 | [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 423 | FeatureFSqrt, FeatureFRE, FeatureFRES, |
| 424 | FeatureFRSQRTE, FeatureFRSQRTES, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 425 | FeatureSTFIWX, FeatureFPRND, Feature64Bit, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 426 | FeatureMFTB, DeprecatedDST]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 427 | def : ProcessorModel<"pwr6", G5Model, |
Hal Finkel | f2b9c38 | 2012-06-11 15:43:08 +0000 | [diff] [blame] | 428 | [DirectivePwr6, FeatureAltivec, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 429 | FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 430 | FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES, |
Hal Finkel | 4edc66b | 2015-01-03 01:16:37 +0000 | [diff] [blame] | 431 | FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX, FeatureCMPB, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 432 | FeatureFPRND, Feature64Bit /*, Feature64BitRegs */, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 433 | FeatureMFTB, DeprecatedDST]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 434 | def : ProcessorModel<"pwr6x", G5Model, |
Bill Schmidt | 52742c2 | 2013-02-01 22:59:51 +0000 | [diff] [blame] | 435 | [DirectivePwr5x, FeatureAltivec, FeatureMFOCRF, |
Hal Finkel | dbc78e1 | 2013-08-19 05:01:02 +0000 | [diff] [blame] | 436 | FeatureFCPSGN, FeatureFSqrt, FeatureFRE, FeatureFRES, |
Hal Finkel | 2e10331 | 2013-04-03 04:01:11 +0000 | [diff] [blame] | 437 | FeatureFRSQRTE, FeatureFRSQRTES, FeatureRecipPrec, |
Hal Finkel | 4edc66b | 2015-01-03 01:16:37 +0000 | [diff] [blame] | 438 | FeatureSTFIWX, FeatureLFIWAX, FeatureCMPB, |
Hal Finkel | 0096dbd | 2013-09-12 14:40:06 +0000 | [diff] [blame] | 439 | FeatureFPRND, Feature64Bit, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 440 | FeatureMFTB, DeprecatedDST]>; |
Nemanja Ivanovic | c090479 | 2015-04-09 23:54:37 +0000 | [diff] [blame] | 441 | def : ProcessorModel<"pwr7", P7Model, ProcessorFeatures.Power7FeatureList>; |
Bill Schmidt | 279cabb | 2015-01-25 18:05:42 +0000 | [diff] [blame] | 442 | def : ProcessorModel<"pwr8", P8Model, ProcessorFeatures.Power8FeatureList>; |
Clement Courbet | eee2e06 | 2018-11-09 13:15:32 +0000 | [diff] [blame] | 443 | def : ProcessorModel<"pwr9", P9Model, ProcessorFeatures.Power9FeatureList>; |
Hal Finkel | a932105 | 2016-10-02 02:10:20 +0000 | [diff] [blame] | 444 | def : Processor<"ppc", G3Itineraries, [Directive32, FeatureHardFloat, |
| 445 | FeatureMFTB]>; |
| 446 | def : Processor<"ppc32", G3Itineraries, [Directive32, FeatureHardFloat, |
| 447 | FeatureMFTB]>; |
Hal Finkel | 1a958cf | 2013-04-05 05:49:18 +0000 | [diff] [blame] | 448 | def : ProcessorModel<"ppc64", G5Model, |
Jim Laskey | 59e7a77 | 2006-12-12 20:57:08 +0000 | [diff] [blame] | 449 | [Directive64, FeatureAltivec, |
Hal Finkel | 7ac4592 | 2013-04-03 14:40:18 +0000 | [diff] [blame] | 450 | FeatureMFOCRF, FeatureFSqrt, FeatureFRES, |
| 451 | FeatureFRSQRTE, FeatureSTFIWX, |
Kit Barton | 4f79f96 | 2015-06-16 16:01:15 +0000 | [diff] [blame] | 452 | Feature64Bit /*, Feature64BitRegs */, |
| 453 | FeatureMFTB]>; |
Bill Schmidt | 279cabb | 2015-01-25 18:05:42 +0000 | [diff] [blame] | 454 | def : ProcessorModel<"ppc64le", P8Model, ProcessorFeatures.Power8FeatureList>; |
Jim Laskey | 74ab996 | 2005-10-19 19:51:16 +0000 | [diff] [blame] | 455 | |
Chris Lattner | 4f2e4e0 | 2007-03-06 00:59:59 +0000 | [diff] [blame] | 456 | //===----------------------------------------------------------------------===// |
| 457 | // Calling Conventions |
| 458 | //===----------------------------------------------------------------------===// |
| 459 | |
| 460 | include "PPCCallingConv.td" |
| 461 | |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 462 | def PPCInstrInfo : InstrInfo { |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 463 | let isLittleEndianEncoding = 1; |
Hal Finkel | 2345347 | 2013-12-19 16:13:01 +0000 | [diff] [blame] | 464 | |
| 465 | // FIXME: Unset this when no longer needed! |
| 466 | let decodePositionallyEncodedOperands = 1; |
Hal Finkel | 5457bd0 | 2014-03-13 07:57:54 +0000 | [diff] [blame] | 467 | |
| 468 | let noNamedPositionallyEncodedOperands = 1; |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 469 | } |
| 470 | |
Ulrich Weigand | 640192d | 2013-05-03 19:49:39 +0000 | [diff] [blame] | 471 | def PPCAsmParser : AsmParser { |
| 472 | let ShouldEmitMatchRegisterName = 0; |
| 473 | } |
| 474 | |
Ulrich Weigand | c0944b5 | 2013-07-08 14:49:37 +0000 | [diff] [blame] | 475 | def PPCAsmParserVariant : AsmParserVariant { |
| 476 | int Variant = 0; |
| 477 | |
| 478 | // We do not use hard coded registers in asm strings. However, some |
| 479 | // InstAlias definitions use immediate literals. Set RegisterPrefix |
| 480 | // so that those are not misinterpreted as registers. |
| 481 | string RegisterPrefix = "%"; |
Colin LeMahieu | 8a0453e | 2015-11-09 00:31:07 +0000 | [diff] [blame] | 482 | string BreakCharacters = "."; |
Ulrich Weigand | c0944b5 | 2013-07-08 14:49:37 +0000 | [diff] [blame] | 483 | } |
| 484 | |
Chris Lattner | 0921e3b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 485 | def PPC : Target { |
Chris Lattner | 51348c5 | 2006-03-12 09:13:49 +0000 | [diff] [blame] | 486 | // Information about the instructions. |
| 487 | let InstructionSet = PPCInstrInfo; |
Rafael Espindola | 50712a4 | 2013-12-02 04:55:42 +0000 | [diff] [blame] | 488 | |
Ulrich Weigand | 640192d | 2013-05-03 19:49:39 +0000 | [diff] [blame] | 489 | let AssemblyParsers = [PPCAsmParser]; |
Ulrich Weigand | c0944b5 | 2013-07-08 14:49:37 +0000 | [diff] [blame] | 490 | let AssemblyParserVariants = [PPCAsmParserVariant]; |
Geoff Berry | f8bf2ec | 2018-02-23 18:25:08 +0000 | [diff] [blame] | 491 | let AllowRegisterRenaming = 1; |
Chris Lattner | 0921e3b | 2005-10-14 23:37:35 +0000 | [diff] [blame] | 492 | } |
Clement Courbet | eee2e06 | 2018-11-09 13:15:32 +0000 | [diff] [blame] | 493 | |
| 494 | //===----------------------------------------------------------------------===// |
| 495 | // Pfm Counters |
| 496 | //===----------------------------------------------------------------------===// |
| 497 | |
| 498 | include "PPCPfmCounters.td" |