xref: /freebsd-src/contrib/llvm-project/llvm/lib/Target/X86/X86PfmCounters.td (revision c80e69b00d976a5a3b3e84527f270fa7e72a8205)
10b57cec5SDimitry Andric//===-- X86PfmCounters.td - X86 Hardware Counters ----------*- tablegen -*-===//
20b57cec5SDimitry Andric//
30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric//
70b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric//
90b57cec5SDimitry Andric// This describes the available hardware counters for various subtargets.
100b57cec5SDimitry Andric//
110b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric
130b57cec5SDimitry Andricdef UnhaltedCoreCyclesPfmCounter : PfmCounter<"unhalted_core_cycles">;
140b57cec5SDimitry Andricdef UopsIssuedPfmCounter : PfmCounter<"uops_issued:any">;
150b57cec5SDimitry Andric
160b57cec5SDimitry Andric// No default counters on X86.
170b57cec5SDimitry Andricdef DefaultPfmCounters : ProcPfmCounters {}
180b57cec5SDimitry Andricdef : PfmCountersDefaultBinding<DefaultPfmCounters>;
190b57cec5SDimitry Andric
200b57cec5SDimitry Andric// Intel X86 Counters.
21297eecfbSDimitry Andricdefvar DefaultIntelPfmValidationCounters = [
227a6dacacSDimitry Andric  PfmValidationCounter<InstructionRetired, "INSTRUCTIONS_RETIRED">,
237a6dacacSDimitry Andric  PfmValidationCounter<L1DCacheLoadMiss, "MEM_LOAD_UOPS_RETIRED:L1_MISS">,
247a6dacacSDimitry Andric  PfmValidationCounter<L1ICacheLoadMiss, "L1-ICACHE-LOAD-MISSES">,
257a6dacacSDimitry Andric  PfmValidationCounter<DataTLBLoadMiss, "DTLB_LOAD_MISSES:MISS_CAUSES_A_WALK">,
267a6dacacSDimitry Andric  PfmValidationCounter<DataTLBStoreMiss, "DTLB_STORE_MISSES:MISS_CAUSES_A_WALK">,
270fca6ea1SDimitry Andric  PfmValidationCounter<InstructionTLBLoadMiss, "ITLB_MISSES:MISS_CAUSES_A_WALK">,
280fca6ea1SDimitry Andric  PfmValidationCounter<BranchPredictionMiss, "BRANCH-MISSES">
29297eecfbSDimitry Andric];
30297eecfbSDimitry Andric
310b57cec5SDimitry Andricdef PentiumPfmCounters : ProcPfmCounters {
320b57cec5SDimitry Andric  let CycleCounter = PfmCounter<"cpu_clk_unhalted">;
330b57cec5SDimitry Andric  let UopsCounter = PfmCounter<"uops_retired">;
340b57cec5SDimitry Andric}
350b57cec5SDimitry Andricdef : PfmCountersBinding<"pentiumpro", PentiumPfmCounters>;
360b57cec5SDimitry Andricdef : PfmCountersBinding<"pentium2", PentiumPfmCounters>;
370b57cec5SDimitry Andricdef : PfmCountersBinding<"pentium3", PentiumPfmCounters>;
380b57cec5SDimitry Andricdef : PfmCountersBinding<"pentium3m", PentiumPfmCounters>;
390b57cec5SDimitry Andricdef : PfmCountersBinding<"pentium-m", PentiumPfmCounters>;
400b57cec5SDimitry Andric
410b57cec5SDimitry Andricdef CorePfmCounters : ProcPfmCounters {
420b57cec5SDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
430b57cec5SDimitry Andric  let UopsCounter = PfmCounter<"uops_retired:any">;
440b57cec5SDimitry Andric}
450b57cec5SDimitry Andricdef : PfmCountersBinding<"yonah", CorePfmCounters>;
460b57cec5SDimitry Andricdef : PfmCountersBinding<"prescott", CorePfmCounters>;
470b57cec5SDimitry Andric
480b57cec5SDimitry Andricdef AtomPfmCounters : ProcPfmCounters {
490b57cec5SDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
500b57cec5SDimitry Andric  let UopsCounter = PfmCounter<"uops_retired:any">;
510b57cec5SDimitry Andric}
520b57cec5SDimitry Andricdef : PfmCountersBinding<"bonnell", AtomPfmCounters>;
530b57cec5SDimitry Andricdef : PfmCountersBinding<"atom", AtomPfmCounters>;
540b57cec5SDimitry Andric
550b57cec5SDimitry Andricdef SLMPfmCounters : ProcPfmCounters {
560b57cec5SDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
570b57cec5SDimitry Andric  let UopsCounter = PfmCounter<"uops_retired:any">;
58bdd1243dSDimitry Andric  let IssueCounters = [
59bdd1243dSDimitry Andric    PfmIssueCounter<"SLM_MEC_RSV", "mem_uop_retired:any_ld + mem_uop_retired:any_st">
60bdd1243dSDimitry Andric  ];
610b57cec5SDimitry Andric}
620b57cec5SDimitry Andricdef : PfmCountersBinding<"silvermont", SLMPfmCounters>;
630b57cec5SDimitry Andricdef : PfmCountersBinding<"goldmont", SLMPfmCounters>;
640b57cec5SDimitry Andricdef : PfmCountersBinding<"goldmont-plus", SLMPfmCounters>;
650b57cec5SDimitry Andricdef : PfmCountersBinding<"tremont", SLMPfmCounters>;
660b57cec5SDimitry Andric
670b57cec5SDimitry Andricdef KnightPfmCounters : ProcPfmCounters {
680b57cec5SDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
690b57cec5SDimitry Andric  let UopsCounter = PfmCounter<"uops_retired:all">;
700b57cec5SDimitry Andric}
710b57cec5SDimitry Andricdef : PfmCountersBinding<"knl", KnightPfmCounters>;
720b57cec5SDimitry Andricdef : PfmCountersBinding<"knm", KnightPfmCounters>;
730b57cec5SDimitry Andric
74bdd1243dSDimitry Andricdef Core2PfmCounters : ProcPfmCounters {
75bdd1243dSDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
76bdd1243dSDimitry Andric  let UopsCounter = PfmCounter<"uops_retired:any">;
77bdd1243dSDimitry Andric  let IssueCounters = [
78bdd1243dSDimitry Andric    PfmIssueCounter<"SBPort0",  "rs_uops_dispatched_cycles:port_0">,
79bdd1243dSDimitry Andric    PfmIssueCounter<"SBPort1",  "rs_uops_dispatched_cycles:port_1">,
80bdd1243dSDimitry Andric    PfmIssueCounter<"SBPort23", "rs_uops_dispatched_cycles:port_2 + rs_uops_dispatched_cycles:port_3">,
81bdd1243dSDimitry Andric    PfmIssueCounter<"SBPort4",  "rs_uops_dispatched_cycles:port_4">,
82bdd1243dSDimitry Andric    PfmIssueCounter<"SBPort5",  "rs_uops_dispatched_cycles:port_5">
83bdd1243dSDimitry Andric  ];
84bdd1243dSDimitry Andric}
85bdd1243dSDimitry Andricdef : PfmCountersBinding<"core2", Core2PfmCounters>;
86bdd1243dSDimitry Andricdef : PfmCountersBinding<"penryn", Core2PfmCounters>;
87bdd1243dSDimitry Andric
88bdd1243dSDimitry Andricdef NehalemPfmCounters : ProcPfmCounters {
89bdd1243dSDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
90bdd1243dSDimitry Andric  let UopsCounter = PfmCounter<"uops_retired:any">;
91bdd1243dSDimitry Andric  let IssueCounters = [
92bdd1243dSDimitry Andric    PfmIssueCounter<"SBPort0",  "uops_executed:port0">,
93bdd1243dSDimitry Andric    PfmIssueCounter<"SBPort1",  "uops_executed:port1">,
94bdd1243dSDimitry Andric    PfmIssueCounter<"SBPort23", "uops_executed:port2_core + uops_executed:port3_core">,
95bdd1243dSDimitry Andric    PfmIssueCounter<"SBPort4",  "uops_executed:port4_core">,
96bdd1243dSDimitry Andric    PfmIssueCounter<"SBPort5",  "uops_executed:port5">
97bdd1243dSDimitry Andric  ];
98bdd1243dSDimitry Andric}
99bdd1243dSDimitry Andricdef : PfmCountersBinding<"nehalem", NehalemPfmCounters>;
100bdd1243dSDimitry Andricdef : PfmCountersBinding<"corei7", NehalemPfmCounters>;
101bdd1243dSDimitry Andricdef : PfmCountersBinding<"westmere", NehalemPfmCounters>;
102bdd1243dSDimitry Andric
1030b57cec5SDimitry Andricdef SandyBridgePfmCounters : ProcPfmCounters {
1040b57cec5SDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
1050b57cec5SDimitry Andric  let UopsCounter = UopsIssuedPfmCounter;
1060b57cec5SDimitry Andric  let IssueCounters = [
1070b57cec5SDimitry Andric    PfmIssueCounter<"SBPort0",  "uops_dispatched_port:port_0">,
1080b57cec5SDimitry Andric    PfmIssueCounter<"SBPort1",  "uops_dispatched_port:port_1">,
1090b57cec5SDimitry Andric    PfmIssueCounter<"SBPort23", "uops_dispatched_port:port_2 + uops_dispatched_port:port_3">,
1100b57cec5SDimitry Andric    PfmIssueCounter<"SBPort4",  "uops_dispatched_port:port_4">,
1110b57cec5SDimitry Andric    PfmIssueCounter<"SBPort5",  "uops_dispatched_port:port_5">
1120b57cec5SDimitry Andric  ];
113297eecfbSDimitry Andric  let ValidationCounters = DefaultIntelPfmValidationCounters;
1140b57cec5SDimitry Andric}
1150b57cec5SDimitry Andricdef : PfmCountersBinding<"sandybridge", SandyBridgePfmCounters>;
1160b57cec5SDimitry Andricdef : PfmCountersBinding<"ivybridge", SandyBridgePfmCounters>;
1170b57cec5SDimitry Andric
1180b57cec5SDimitry Andricdef HaswellPfmCounters : ProcPfmCounters {
1190b57cec5SDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
1200b57cec5SDimitry Andric  let UopsCounter = UopsIssuedPfmCounter;
1210b57cec5SDimitry Andric  let IssueCounters = [
122480093f4SDimitry Andric    PfmIssueCounter<"HWPort0", "uops_executed_port:port_0">,
123480093f4SDimitry Andric    PfmIssueCounter<"HWPort1", "uops_executed_port:port_1">,
124480093f4SDimitry Andric    PfmIssueCounter<"HWPort2", "uops_executed_port:port_2">,
125480093f4SDimitry Andric    PfmIssueCounter<"HWPort3", "uops_executed_port:port_3">,
126480093f4SDimitry Andric    PfmIssueCounter<"HWPort4", "uops_executed_port:port_4">,
127480093f4SDimitry Andric    PfmIssueCounter<"HWPort5", "uops_executed_port:port_5">,
128480093f4SDimitry Andric    PfmIssueCounter<"HWPort6", "uops_executed_port:port_6">,
129480093f4SDimitry Andric    PfmIssueCounter<"HWPort7", "uops_executed_port:port_7">
1300b57cec5SDimitry Andric  ];
131297eecfbSDimitry Andric  let ValidationCounters = DefaultIntelPfmValidationCounters;
1320b57cec5SDimitry Andric}
1330b57cec5SDimitry Andricdef : PfmCountersBinding<"haswell", HaswellPfmCounters>;
1340b57cec5SDimitry Andric
1350b57cec5SDimitry Andricdef BroadwellPfmCounters : ProcPfmCounters {
1360b57cec5SDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
1370b57cec5SDimitry Andric  let UopsCounter = UopsIssuedPfmCounter;
1380b57cec5SDimitry Andric  let IssueCounters = [
1390b57cec5SDimitry Andric    PfmIssueCounter<"BWPort0", "uops_executed_port:port_0">,
1400b57cec5SDimitry Andric    PfmIssueCounter<"BWPort1", "uops_executed_port:port_1">,
1410b57cec5SDimitry Andric    PfmIssueCounter<"BWPort2", "uops_executed_port:port_2">,
1420b57cec5SDimitry Andric    PfmIssueCounter<"BWPort3", "uops_executed_port:port_3">,
1430b57cec5SDimitry Andric    PfmIssueCounter<"BWPort4", "uops_executed_port:port_4">,
1440b57cec5SDimitry Andric    PfmIssueCounter<"BWPort5", "uops_executed_port:port_5">,
1450b57cec5SDimitry Andric    PfmIssueCounter<"BWPort6", "uops_executed_port:port_6">,
1460b57cec5SDimitry Andric    PfmIssueCounter<"BWPort7", "uops_executed_port:port_7">
1470b57cec5SDimitry Andric  ];
148297eecfbSDimitry Andric  let ValidationCounters = DefaultIntelPfmValidationCounters;
1490b57cec5SDimitry Andric}
1500b57cec5SDimitry Andricdef : PfmCountersBinding<"broadwell", BroadwellPfmCounters>;
1510b57cec5SDimitry Andric
1520b57cec5SDimitry Andricdef SkylakeClientPfmCounters : ProcPfmCounters {
1530b57cec5SDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
1540b57cec5SDimitry Andric  let UopsCounter = UopsIssuedPfmCounter;
1550b57cec5SDimitry Andric  let IssueCounters = [
1560b57cec5SDimitry Andric    PfmIssueCounter<"SKLPort0", "uops_dispatched_port:port_0">,
1570b57cec5SDimitry Andric    PfmIssueCounter<"SKLPort1", "uops_dispatched_port:port_1">,
1580b57cec5SDimitry Andric    PfmIssueCounter<"SKLPort2", "uops_dispatched_port:port_2">,
1590b57cec5SDimitry Andric    PfmIssueCounter<"SKLPort3", "uops_dispatched_port:port_3">,
1600b57cec5SDimitry Andric    PfmIssueCounter<"SKLPort4", "uops_dispatched_port:port_4">,
1610b57cec5SDimitry Andric    PfmIssueCounter<"SKLPort5", "uops_dispatched_port:port_5">,
1620b57cec5SDimitry Andric    PfmIssueCounter<"SKLPort6", "uops_dispatched_port:port_6">,
1630b57cec5SDimitry Andric    PfmIssueCounter<"SKLPort7", "uops_dispatched_port:port_7">
1640b57cec5SDimitry Andric  ];
165297eecfbSDimitry Andric  let ValidationCounters = DefaultIntelPfmValidationCounters;
1660b57cec5SDimitry Andric}
1670b57cec5SDimitry Andricdef : PfmCountersBinding<"skylake", SkylakeClientPfmCounters>;
1680b57cec5SDimitry Andric
1690b57cec5SDimitry Andricdef SkylakeServerPfmCounters : ProcPfmCounters {
1700b57cec5SDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
1710b57cec5SDimitry Andric  let UopsCounter = UopsIssuedPfmCounter;
1720b57cec5SDimitry Andric  let IssueCounters = [
1730b57cec5SDimitry Andric    PfmIssueCounter<"SKXPort0", "uops_dispatched_port:port_0">,
1740b57cec5SDimitry Andric    PfmIssueCounter<"SKXPort1", "uops_dispatched_port:port_1">,
1750b57cec5SDimitry Andric    PfmIssueCounter<"SKXPort2", "uops_dispatched_port:port_2">,
1760b57cec5SDimitry Andric    PfmIssueCounter<"SKXPort3", "uops_dispatched_port:port_3">,
1770b57cec5SDimitry Andric    PfmIssueCounter<"SKXPort4", "uops_dispatched_port:port_4">,
1780b57cec5SDimitry Andric    PfmIssueCounter<"SKXPort5", "uops_dispatched_port:port_5">,
1790b57cec5SDimitry Andric    PfmIssueCounter<"SKXPort6", "uops_dispatched_port:port_6">,
1800b57cec5SDimitry Andric    PfmIssueCounter<"SKXPort7", "uops_dispatched_port:port_7">
1810b57cec5SDimitry Andric  ];
182297eecfbSDimitry Andric  let ValidationCounters = DefaultIntelPfmValidationCounters;
1830b57cec5SDimitry Andric}
1840b57cec5SDimitry Andricdef : PfmCountersBinding<"skylake-avx512", SkylakeServerPfmCounters>;
1850b57cec5SDimitry Andricdef : PfmCountersBinding<"cascadelake", SkylakeServerPfmCounters>;
1860b57cec5SDimitry Andricdef : PfmCountersBinding<"cannonlake", SkylakeServerPfmCounters>;
187349cc55cSDimitry Andric
188349cc55cSDimitry Andricdef IceLakePfmCounters : ProcPfmCounters {
189349cc55cSDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
190349cc55cSDimitry Andric  let UopsCounter = UopsIssuedPfmCounter;
191349cc55cSDimitry Andric  let IssueCounters = [
192349cc55cSDimitry Andric    PfmIssueCounter<"ICXPort0",  "uops_dispatched_port:port_0">,
193349cc55cSDimitry Andric    PfmIssueCounter<"ICXPort1",  "uops_dispatched_port:port_1">,
194349cc55cSDimitry Andric    PfmIssueCounter<"ICXPort23", "uops_dispatched_port:port_2_3">,
195349cc55cSDimitry Andric    PfmIssueCounter<"ICXPort49", "uops_dispatched_port:port_4_9">,
196349cc55cSDimitry Andric    PfmIssueCounter<"ICXPort5",  "uops_dispatched_port:port_5">,
197349cc55cSDimitry Andric    PfmIssueCounter<"ICXPort6",  "uops_dispatched_port:port_6">,
198349cc55cSDimitry Andric    PfmIssueCounter<"ICXPort78", "uops_dispatched_port:port_7_8">
199349cc55cSDimitry Andric  ];
200297eecfbSDimitry Andric  let ValidationCounters = DefaultIntelPfmValidationCounters;
201349cc55cSDimitry Andric}
202349cc55cSDimitry Andricdef : PfmCountersBinding<"icelake-client", IceLakePfmCounters>;
203349cc55cSDimitry Andricdef : PfmCountersBinding<"icelake-server", IceLakePfmCounters>;
204349cc55cSDimitry Andricdef : PfmCountersBinding<"rocketlake", IceLakePfmCounters>;
205349cc55cSDimitry Andricdef : PfmCountersBinding<"tigerlake", IceLakePfmCounters>;
2060b57cec5SDimitry Andric
2070fca6ea1SDimitry Andricdef AlderLakePfmCounters : ProcPfmCounters {
2080fca6ea1SDimitry Andric  let CycleCounter = UnhaltedCoreCyclesPfmCounter;
2090fca6ea1SDimitry Andric  let UopsCounter = UopsIssuedPfmCounter;
2100fca6ea1SDimitry Andric  let IssueCounters = [
2110fca6ea1SDimitry Andric    PfmIssueCounter<"ADLPPort00", "uops_dispatched_port:port_0">,
2120fca6ea1SDimitry Andric    PfmIssueCounter<"ADLPPort01", "uops_dispatched_port:port_1">,
2130fca6ea1SDimitry Andric    PfmIssueCounter<"ADLPPort02_03_10", "uops_dispatched_port:port_2_3_10">,
2140fca6ea1SDimitry Andric    PfmIssueCounter<"ADLPPort04_09", "uops_dispatched_port:port_4_9">,
2150fca6ea1SDimitry Andric    PfmIssueCounter<"ADLPPort05_11", "uops_dispatched_port:port_5_11">,
2160fca6ea1SDimitry Andric    PfmIssueCounter<"ADLPPort06", "uops_dispatched_port:port_6">,
2170fca6ea1SDimitry Andric    PfmIssueCounter<"ADLPPort07_08", "uops_dispatched_port:port_7_8">
2180fca6ea1SDimitry Andric  ];
2190fca6ea1SDimitry Andric  let ValidationCounters = DefaultIntelPfmValidationCounters;
2200fca6ea1SDimitry Andric}
2210fca6ea1SDimitry Andricdef : PfmCountersBinding<"alderlake", AlderLakePfmCounters>;
2220fca6ea1SDimitry Andric
2230b57cec5SDimitry Andric// AMD X86 Counters.
224297eecfbSDimitry Andricdefvar DefaultAMDPfmValidationCounters = [
2257a6dacacSDimitry Andric  PfmValidationCounter<InstructionRetired, "RETIRED_INSTRUCTIONS">,
2267a6dacacSDimitry Andric  PfmValidationCounter<L1DCacheLoadMiss, "L1-DCACHE-LOAD-MISSES">,
2277a6dacacSDimitry Andric  PfmValidationCounter<L1DCacheStoreMiss, "L1-DCACHE-STORE-MISSES">,
2287a6dacacSDimitry Andric  PfmValidationCounter<L1ICacheLoadMiss, "L1-ICACHE-LOAD-MISSES">,
2297a6dacacSDimitry Andric  PfmValidationCounter<DataTLBLoadMiss, "DTLB-LOAD-MISSES">,
2300fca6ea1SDimitry Andric  PfmValidationCounter<InstructionTLBLoadMiss, "ITLB-LOAD-MISSES">,
2310fca6ea1SDimitry Andric  PfmValidationCounter<BranchPredictionMiss, "BRANCH-MISSES">
232297eecfbSDimitry Andric];
233297eecfbSDimitry Andric
2340b57cec5SDimitry Andric// Set basic counters for AMD cpus that we know libpfm4 supports.
2350b57cec5SDimitry Andricdef DefaultAMDPfmCounters : ProcPfmCounters {
2360b57cec5SDimitry Andric  let CycleCounter = PfmCounter<"cpu_clk_unhalted">;
2370b57cec5SDimitry Andric  let UopsCounter = PfmCounter<"retired_uops">;
2380b57cec5SDimitry Andric}
2390b57cec5SDimitry Andricdef : PfmCountersBinding<"athlon", DefaultAMDPfmCounters>;
2400b57cec5SDimitry Andricdef : PfmCountersBinding<"athlon-tbird", DefaultAMDPfmCounters>;
2410b57cec5SDimitry Andricdef : PfmCountersBinding<"athlon-4", DefaultAMDPfmCounters>;
2420b57cec5SDimitry Andricdef : PfmCountersBinding<"athlon-xp", DefaultAMDPfmCounters>;
2430b57cec5SDimitry Andricdef : PfmCountersBinding<"athlon-mp", DefaultAMDPfmCounters>;
2440b57cec5SDimitry Andricdef : PfmCountersBinding<"k8", DefaultAMDPfmCounters>;
2450b57cec5SDimitry Andricdef : PfmCountersBinding<"opteron", DefaultAMDPfmCounters>;
2460b57cec5SDimitry Andricdef : PfmCountersBinding<"athlon64", DefaultAMDPfmCounters>;
2470b57cec5SDimitry Andricdef : PfmCountersBinding<"athlon-fx", DefaultAMDPfmCounters>;
2480b57cec5SDimitry Andricdef : PfmCountersBinding<"k8-sse3", DefaultAMDPfmCounters>;
2490b57cec5SDimitry Andricdef : PfmCountersBinding<"opteron-sse3", DefaultAMDPfmCounters>;
2500b57cec5SDimitry Andricdef : PfmCountersBinding<"athlon64-sse3", DefaultAMDPfmCounters>;
2510b57cec5SDimitry Andricdef : PfmCountersBinding<"amdfam10", DefaultAMDPfmCounters>;
2520b57cec5SDimitry Andricdef : PfmCountersBinding<"barcelona", DefaultAMDPfmCounters>;
2530b57cec5SDimitry Andric
2540b57cec5SDimitry Andricdef BdVer2PfmCounters : ProcPfmCounters {
2550b57cec5SDimitry Andric  let CycleCounter = PfmCounter<"cpu_clk_unhalted">;
2560b57cec5SDimitry Andric  let UopsCounter = PfmCounter<"retired_uops">;
2570b57cec5SDimitry Andric  let IssueCounters = [
2580b57cec5SDimitry Andric    PfmIssueCounter<"PdFPU0", "dispatched_fpu_ops:ops_pipe0 + dispatched_fpu_ops:ops_dual_pipe0">,
2590b57cec5SDimitry Andric    PfmIssueCounter<"PdFPU1", "dispatched_fpu_ops:ops_pipe1 + dispatched_fpu_ops:ops_dual_pipe1">,
2600b57cec5SDimitry Andric    PfmIssueCounter<"PdFPU2", "dispatched_fpu_ops:ops_pipe2 + dispatched_fpu_ops:ops_dual_pipe2">,
2610b57cec5SDimitry Andric    PfmIssueCounter<"PdFPU3", "dispatched_fpu_ops:ops_pipe3 + dispatched_fpu_ops:ops_dual_pipe3">
2620b57cec5SDimitry Andric  ];
2630b57cec5SDimitry Andric}
2640b57cec5SDimitry Andricdef : PfmCountersBinding<"bdver1", BdVer2PfmCounters>;
2650b57cec5SDimitry Andricdef : PfmCountersBinding<"bdver2", BdVer2PfmCounters>;
2660b57cec5SDimitry Andric
2670b57cec5SDimitry Andricdef BdVer3PfmCounters : ProcPfmCounters {
2680b57cec5SDimitry Andric  let CycleCounter = PfmCounter<"cpu_clk_unhalted">;
2690b57cec5SDimitry Andric  let UopsCounter = PfmCounter<"retired_uops">;
2700b57cec5SDimitry Andric  let IssueCounters = [
2710b57cec5SDimitry Andric    PfmIssueCounter<"SrFPU0", "dispatched_fpu_ops:ops_pipe0 + dispatched_fpu_ops:ops_dual_pipe0">,
2720b57cec5SDimitry Andric    PfmIssueCounter<"SrFPU1", "dispatched_fpu_ops:ops_pipe1 + dispatched_fpu_ops:ops_dual_pipe1">,
2730b57cec5SDimitry Andric    PfmIssueCounter<"SrFPU2", "dispatched_fpu_ops:ops_pipe2 + dispatched_fpu_ops:ops_dual_pipe2">
2740b57cec5SDimitry Andric  ];
2750b57cec5SDimitry Andric}
2760b57cec5SDimitry Andricdef : PfmCountersBinding<"bdver3", BdVer3PfmCounters>;
2770b57cec5SDimitry Andricdef : PfmCountersBinding<"bdver4", BdVer3PfmCounters>;
2780b57cec5SDimitry Andric
2790b57cec5SDimitry Andricdef BtVer1PfmCounters : ProcPfmCounters {
2800b57cec5SDimitry Andric  let CycleCounter = PfmCounter<"cpu_clk_unhalted">;
2810b57cec5SDimitry Andric  let UopsCounter = PfmCounter<"retired_uops">;
2820b57cec5SDimitry Andric  let IssueCounters = [
2830b57cec5SDimitry Andric    PfmIssueCounter<"BtFPU0", "dispatched_fpu:pipe0">,
2840b57cec5SDimitry Andric    PfmIssueCounter<"BtFPU1", "dispatched_fpu:pipe1">
2850b57cec5SDimitry Andric  ];
2860b57cec5SDimitry Andric}
2870b57cec5SDimitry Andricdef : PfmCountersBinding<"btver1", BtVer1PfmCounters>;
2880b57cec5SDimitry Andric
2890b57cec5SDimitry Andricdef BtVer2PfmCounters : ProcPfmCounters {
2900b57cec5SDimitry Andric  let CycleCounter = PfmCounter<"cpu_clk_unhalted">;
2910b57cec5SDimitry Andric  let UopsCounter = PfmCounter<"retired_uops">;
2920b57cec5SDimitry Andric  let IssueCounters = [
2930b57cec5SDimitry Andric    PfmIssueCounter<"JFPU0", "dispatched_fpu:pipe0">,
2940b57cec5SDimitry Andric    PfmIssueCounter<"JFPU1", "dispatched_fpu:pipe1">
2950b57cec5SDimitry Andric  ];
2960b57cec5SDimitry Andric}
2970b57cec5SDimitry Andricdef : PfmCountersBinding<"btver2", BtVer2PfmCounters>;
2980b57cec5SDimitry Andric
2990b57cec5SDimitry Andricdef ZnVer1PfmCounters : ProcPfmCounters {
3000b57cec5SDimitry Andric  let CycleCounter = PfmCounter<"cycles_not_in_halt">;
3010b57cec5SDimitry Andric  let UopsCounter = PfmCounter<"retired_uops">;
3020b57cec5SDimitry Andric  let IssueCounters = [
3030b57cec5SDimitry Andric    PfmIssueCounter<"ZnFPU0", "fpu_pipe_assignment:total0">,
3040b57cec5SDimitry Andric    PfmIssueCounter<"ZnFPU1", "fpu_pipe_assignment:total1">,
3050b57cec5SDimitry Andric    PfmIssueCounter<"ZnFPU2", "fpu_pipe_assignment:total2">,
3060b57cec5SDimitry Andric    PfmIssueCounter<"ZnFPU3", "fpu_pipe_assignment:total3">,
307bdd1243dSDimitry Andric    PfmIssueCounter<"ZnAGU", "ls_dispatch:ld_st_dispatch + ls_dispatch:ld_dispatch + ls_dispatch:store_dispatch">,
3080b57cec5SDimitry Andric    PfmIssueCounter<"ZnDivider", "div_op_count">
3090b57cec5SDimitry Andric  ];
310297eecfbSDimitry Andric  let ValidationCounters = DefaultAMDPfmValidationCounters;
3110b57cec5SDimitry Andric}
3120b57cec5SDimitry Andricdef : PfmCountersBinding<"znver1", ZnVer1PfmCounters>;
3135ffd83dbSDimitry Andric
3145ffd83dbSDimitry Andricdef ZnVer2PfmCounters : ProcPfmCounters {
3155ffd83dbSDimitry Andric  let CycleCounter = PfmCounter<"cycles_not_in_halt">;
3165ffd83dbSDimitry Andric  let UopsCounter = PfmCounter<"retired_uops">;
3175ffd83dbSDimitry Andric  let IssueCounters = [
318bdd1243dSDimitry Andric    PfmIssueCounter<"Zn2AGU", "ls_dispatch:ld_st_dispatch + ls_dispatch:ld_dispatch + ls_dispatch:store_dispatch">,
3195ffd83dbSDimitry Andric    PfmIssueCounter<"Zn2Divider", "div_op_count">
3205ffd83dbSDimitry Andric  ];
321297eecfbSDimitry Andric  let ValidationCounters = DefaultAMDPfmValidationCounters;
3225ffd83dbSDimitry Andric}
3235ffd83dbSDimitry Andricdef : PfmCountersBinding<"znver2", ZnVer2PfmCounters>;
324fe6060f1SDimitry Andric
325fe6060f1SDimitry Andricdef ZnVer3PfmCounters : ProcPfmCounters {
326fe6060f1SDimitry Andric  let CycleCounter = PfmCounter<"cycles_not_in_halt">;
327fe6060f1SDimitry Andric  let UopsCounter = PfmCounter<"retired_ops">;
328fe6060f1SDimitry Andric  let IssueCounters = [
329fe6060f1SDimitry Andric    PfmIssueCounter<"Zn3Int", "ops_type_dispatched_from_decoder:int_disp_retire_mode">,
330fe6060f1SDimitry Andric    PfmIssueCounter<"Zn3FPU", "ops_type_dispatched_from_decoder:fp_disp_retire_mode">,
331fe6060f1SDimitry Andric    PfmIssueCounter<"Zn3Load", "ls_dispatch:ld_dispatch">,
332fe6060f1SDimitry Andric    PfmIssueCounter<"Zn3Store", "ls_dispatch:store_dispatch">,
333fe6060f1SDimitry Andric    PfmIssueCounter<"Zn3Divider", "div_op_count">
334fe6060f1SDimitry Andric  ];
335297eecfbSDimitry Andric  let ValidationCounters = DefaultAMDPfmValidationCounters;
336fe6060f1SDimitry Andric}
337fe6060f1SDimitry Andricdef : PfmCountersBinding<"znver3", ZnVer3PfmCounters>;
3381ac55f4cSDimitry Andric
3391ac55f4cSDimitry Andricdef ZnVer4PfmCounters : ProcPfmCounters {
3401ac55f4cSDimitry Andric  let CycleCounter = PfmCounter<"cycles_not_in_halt">;
3411ac55f4cSDimitry Andric  let UopsCounter = PfmCounter<"retired_ops">;
3421ac55f4cSDimitry Andric  let IssueCounters = [
3431ac55f4cSDimitry Andric    PfmIssueCounter<"Zn4Int", "ops_type_dispatched_from_decoder:int_disp_retire_mode">,
3441ac55f4cSDimitry Andric    PfmIssueCounter<"Zn4FPU", "ops_type_dispatched_from_decoder:fp_disp_retire_mode">,
3451ac55f4cSDimitry Andric    PfmIssueCounter<"Zn4Load", "ls_dispatch:ld_dispatch">,
3461ac55f4cSDimitry Andric    PfmIssueCounter<"Zn4Store", "ls_dispatch:store_dispatch">,
3471ac55f4cSDimitry Andric    PfmIssueCounter<"Zn4Divider", "div_op_count">,
3481ac55f4cSDimitry Andric    PfmIssueCounter<"Zn4AGU", "ls_dispatch:ld_st_dispatch + ls_dispatch:ld_dispatch + ls_dispatch:store_dispatch">
3491ac55f4cSDimitry Andric  ];
350297eecfbSDimitry Andric  let ValidationCounters = DefaultAMDPfmValidationCounters;
3511ac55f4cSDimitry Andric}
3521ac55f4cSDimitry Andricdef : PfmCountersBinding<"znver4", ZnVer4PfmCounters>;
353*c80e69b0SDimitry Andricdef : PfmCountersBinding<"znver5", ZnVer4PfmCounters>;
354