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>>],
54 MCReturnStatement<FalsePred>>>;
55 def ExynosArithPred : MCSchedPredicate<ExynosArithFn>;
57 // Identify logic instructions with limited shift.
58 def ExynosLogicFn : TIIPredicate<
60 MCOpcodeSwitchStatement<
62 IsLogicShiftOp.ValidOpcodes,
63 MCReturnStatement<ExynosCheckShift>>,
65 IsLogicUnshiftOp.ValidOpcodes,
66 MCReturnStatement<TruePred>>],
67 MCReturnStatement<FalsePred>>>;
68 def ExynosLogicPred : MCSchedPredicate<ExynosLogicFn>;
70 // Identify more logic instructions with limited shift.
71 def ExynosLogicExFn : TIIPredicate<
72 "isExynosLogicExFast",
73 MCOpcodeSwitchStatement<
75 IsLogicShiftOp.ValidOpcodes,
83 IsLogicUnshiftOp.ValidOpcodes,
84 MCReturnStatement<TruePred>>],
85 MCReturnStatement<FalsePred>>>;
86 def ExynosLogicExPred : MCSchedPredicate<ExynosLogicExFn>;
88 // Identify a load or store using the register offset addressing mode
89 // with a scaled non-extended register.
90 def ExynosScaledIdxFn : TIIPredicate<"isExynosScaledAddr",
91 MCOpcodeSwitchStatement<
93 IsLoadStoreRegOffsetOp.ValidOpcodes,
99 MCReturnStatement<FalsePred>>>;
100 def ExynosScaledIdxPred : MCSchedPredicate<ExynosScaledIdxFn>;
102 // Identify FP instructions.
103 def ExynosFPPred : MCSchedPredicate<CheckAny<[CheckDForm, CheckQForm]>>;
105 // Identify 128-bit NEON instructions.
106 def ExynosQFormPred : MCSchedPredicate<CheckQForm>;
108 // Identify instructions that reset a register efficiently.
109 def ExynosResetFn : TIIPredicate<
111 MCOpcodeSwitchStatement<
116 MCReturnStatement<TruePred>>,
121 [CheckIsRegOperand<1>,
123 [CheckRegOperand<1, WZR>,
124 CheckRegOperand<1, XZR>]>]>>>],
128 IsZeroFPIdiomFn]>>>>;
129 def ExynosResetPred : MCSchedPredicate<ExynosResetFn>;
131 // Identify EXTR as the alias for ROR (immediate).
132 def ExynosRotateRightImmPred : MCSchedPredicate<
133 CheckAll<[CheckOpcode<[EXTRWrri, EXTRXrri]>,
134 CheckSameRegOperand<1, 2>]>>;
136 // Identify cheap arithmetic and logic immediate instructions.
137 def ExynosCheapFn : TIIPredicate<
138 "isExynosCheapAsMove",
139 MCOpcodeSwitchStatement<
141 IsArithLogicImmOp.ValidOpcodes,
142 MCReturnStatement<TruePred>>],
145 [ExynosArithFn, ExynosResetFn, ExynosLogicFn]>>>>;