1 //===- AArch64SchedPredExynos.td - AArch64 Sched Preds -----*- tablegen -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines scheduling predicate definitions that are used by the
10 // AArch64 Exynos processors.
12 //===----------------------------------------------------------------------===//
14 // Auxiliary predicates.
16 // Check the shift in arithmetic and logic instructions.
17 def ExynosCheckShift : CheckAny<[CheckShiftBy0,
27 // Identify BLR specifying the LR register as the indirect target register.
28 def ExynosBranchLinkLRPred : MCSchedPredicate<
29 CheckAll<[CheckOpcode<[BLR]>,
30 CheckRegOperand<0, LR>]>>;
32 // Identify arithmetic instructions without or with limited extension or shift.
33 def ExynosArithFn : TIIPredicate<
35 MCOpcodeSwitchStatement<
37 IsArithExtOp.ValidOpcodes,
39 CheckAny<[CheckExtBy0,
49 IsArithShiftOp.ValidOpcodes,
50 MCReturnStatement<ExynosCheckShift>>,
52 IsArithUnshiftOp.ValidOpcodes,
53 MCReturnStatement<TruePred>>,
55 IsArithImmOp.ValidOpcodes,
56 MCReturnStatement<TruePred>>],
57 MCReturnStatement<FalsePred>>>;
58 def ExynosArithPred : MCSchedPredicate<ExynosArithFn>;
60 // Identify logic instructions with limited shift.
61 def ExynosLogicFn : TIIPredicate<
63 MCOpcodeSwitchStatement<
65 IsLogicShiftOp.ValidOpcodes,
66 MCReturnStatement<ExynosCheckShift>>,
68 IsLogicUnshiftOp.ValidOpcodes,
69 MCReturnStatement<TruePred>>,
71 IsLogicImmOp.ValidOpcodes,
72 MCReturnStatement<TruePred>>],
73 MCReturnStatement<FalsePred>>>;
74 def ExynosLogicPred : MCSchedPredicate<ExynosLogicFn>;
76 // Identify more logic instructions with limited shift.
77 def ExynosLogicExFn : TIIPredicate<
78 "isExynosLogicExFast",
79 MCOpcodeSwitchStatement<
81 IsLogicShiftOp.ValidOpcodes,
89 IsLogicUnshiftOp.ValidOpcodes,
90 MCReturnStatement<TruePred>>,
92 IsLogicImmOp.ValidOpcodes,
93 MCReturnStatement<TruePred>>],
94 MCReturnStatement<FalsePred>>>;
95 def ExynosLogicExPred : MCSchedPredicate<ExynosLogicExFn>;
97 // Identify a load or store using the register offset addressing mode
98 // with a scaled non-extended register.
99 def ExynosScaledIdxFn : TIIPredicate<"isExynosScaledAddr",
100 MCOpcodeSwitchStatement<
102 IsLoadStoreRegOffsetOp.ValidOpcodes,
108 MCReturnStatement<FalsePred>>>;
109 def ExynosScaledIdxPred : MCSchedPredicate<ExynosScaledIdxFn>;
111 // Identify FP instructions.
112 def ExynosFPPred : MCSchedPredicate<CheckFpOrNEON>;
114 // Identify 128-bit NEON instructions.
115 def ExynosQFormPred : MCSchedPredicate<CheckQForm>;
117 // Identify instructions that reset a register efficiently.
118 def ExynosResetFn : TIIPredicate<
120 MCOpcodeSwitchStatement<
125 MCReturnStatement<TruePred>>,
128 MCReturnStatement<CheckIsReg1Zero>>],
132 IsZeroFPIdiomFn]>>>>;
133 def ExynosResetPred : MCSchedPredicate<ExynosResetFn>;
135 // Identify cheap arithmetic and logic immediate instructions.
136 def ExynosCheapFn : TIIPredicate<
137 "isExynosCheapAsMove",
138 MCOpcodeSwitchStatement<
140 IsArithLogicImmOp.ValidOpcodes,
141 MCReturnStatement<TruePred>>],
144 [ExynosArithFn, ExynosResetFn, ExynosLogicFn]>>>>;