aboutsummaryrefslogtreecommitdiffstats
path: root/capstone/suite/synctools/tablegen/X86/X86SchedPredicates.td
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /capstone/suite/synctools/tablegen/X86/X86SchedPredicates.td
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'capstone/suite/synctools/tablegen/X86/X86SchedPredicates.td')
-rw-r--r--capstone/suite/synctools/tablegen/X86/X86SchedPredicates.td49
1 files changed, 49 insertions, 0 deletions
diff --git a/capstone/suite/synctools/tablegen/X86/X86SchedPredicates.td b/capstone/suite/synctools/tablegen/X86/X86SchedPredicates.td
new file mode 100644
index 000000000..27aaeb193
--- /dev/null
+++ b/capstone/suite/synctools/tablegen/X86/X86SchedPredicates.td
@@ -0,0 +1,49 @@
+//===-- X86SchedPredicates.td - X86 Scheduling Predicates --*- tablegen -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines scheduling predicate definitions that are common to
+// all X86 subtargets.
+//
+//===----------------------------------------------------------------------===//
+
+// A predicate used to identify dependency-breaking instructions that clear the
+// content of the destination register. Note that this predicate only checks if
+// input registers are the same. This predicate doesn't make any assumptions on
+// the expected instruction opcodes, because different processors may implement
+// different zero-idioms.
+def ZeroIdiomPredicate : CheckSameRegOperand<1, 2>;
+
+// A predicate used to check if an instruction is a LEA, and if it uses all
+// three source operands: base, index, and offset.
+def IsThreeOperandsLEAPredicate: CheckAll<[
+ CheckOpcode<[LEA32r, LEA64r, LEA64_32r, LEA16r]>,
+
+ // isRegOperand(Base)
+ CheckIsRegOperand<1>,
+ CheckNot<CheckInvalidRegOperand<1>>,
+
+ // isRegOperand(Index)
+ CheckIsRegOperand<3>,
+ CheckNot<CheckInvalidRegOperand<3>>,
+
+ // hasLEAOffset(Offset)
+ CheckAny<[
+ CheckAll<[
+ CheckIsImmOperand<4>,
+ CheckNot<CheckZeroOperand<4>>
+ ]>,
+ CheckNonPortable<"MI.getOperand(4).isGlobal()">
+ ]>
+]>;
+
+// This predicate evaluates to true only if the input machine instruction is a
+// 3-operands LEA. Tablegen automatically generates a new method for it in
+// X86GenInstrInfo.
+def IsThreeOperandsLEAFn :
+ TIIPredicate<"X86", "isThreeOperandsLEA", IsThreeOperandsLEAPredicate>;