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<CheckAny<[CheckHForm,
117 // Identify 128-bit NEON instructions.
118 def ExynosQFormPred : MCSchedPredicate<CheckQForm>;
120 // Identify instructions that reset a register efficiently.
121 def ExynosResetFn : TIIPredicate<
123 MCOpcodeSwitchStatement<
128 MCReturnStatement<TruePred>>,
133 [CheckIsRegOperand<1>,
135 [CheckRegOperand<1, WZR>,
136 CheckRegOperand<1, XZR>]>]>>>],
140 IsZeroFPIdiomFn]>>>>;
141 def ExynosResetPred : MCSchedPredicate<ExynosResetFn>;
143 // Identify EXTR as the alias for ROR (immediate).
144 def ExynosRotateRightImmPred : MCSchedPredicate<
145 CheckAll<[CheckOpcode<[EXTRWrri, EXTRXrri]>,
146 CheckSameRegOperand<1, 2>]>>;
148 // Identify cheap arithmetic and logic immediate instructions.
149 def ExynosCheapFn : TIIPredicate<
150 "isExynosCheapAsMove",
151 MCOpcodeSwitchStatement<
153 IsArithLogicImmOp.ValidOpcodes,
154 MCReturnStatement<TruePred>>],
157 [ExynosArithFn, ExynosResetFn, ExynosLogicFn]>>>>;