OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLoweringX86Base.h - x86 lowering ----*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 /// - above, set if not in range | 222 /// - above, set if not in range |
223 /// The index into the range is returned. | 223 /// The index into the range is returned. |
224 Operand *lowerCmpRange(Operand *Comparison, uint64_t Min, uint64_t Max); | 224 Operand *lowerCmpRange(Operand *Comparison, uint64_t Min, uint64_t Max); |
225 /// Lowering of a cluster of switch cases. If the case is not matched control | 225 /// Lowering of a cluster of switch cases. If the case is not matched control |
226 /// will pass to the default label provided. If the default label is nullptr | 226 /// will pass to the default label provided. If the default label is nullptr |
227 /// then control will fall through to the next instruction. DoneCmp should be | 227 /// then control will fall through to the next instruction. DoneCmp should be |
228 /// true if the flags contain the result of a comparison with the Comparison. | 228 /// true if the flags contain the result of a comparison with the Comparison. |
229 void lowerCaseCluster(const CaseCluster &Case, Operand *Src0, bool DoneCmp, | 229 void lowerCaseCluster(const CaseCluster &Case, Operand *Src0, bool DoneCmp, |
230 CfgNode *DefaultLabel = nullptr); | 230 CfgNode *DefaultLabel = nullptr); |
231 | 231 |
232 typedef void (TargetX86Base::*LowerBinOp)(Variable *, Operand *); | 232 using LowerBinOp = void (TargetX86Base::*)(Variable *, Operand *); |
233 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, | 233 void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi, |
234 Variable *Dest, Operand *Ptr, Operand *Val); | 234 Variable *Dest, Operand *Ptr, Operand *Val); |
235 | 235 |
236 void eliminateNextVectorSextInstruction(Variable *SignExtendedResult); | 236 void eliminateNextVectorSextInstruction(Variable *SignExtendedResult); |
237 | 237 |
238 void scalarizeArithmetic(InstArithmetic::OpKind K, Variable *Dest, | 238 void scalarizeArithmetic(InstArithmetic::OpKind K, Variable *Dest, |
239 Operand *Src0, Operand *Src1); | 239 Operand *Src0, Operand *Src1); |
240 | 240 |
241 /// Operand legalization helpers. To deal with address mode | 241 /// Operand legalization helpers. To deal with address mode |
242 /// constraints, the helpers will create a new Operand and emit | 242 /// constraints, the helpers will create a new Operand and emit |
243 /// instructions that guarantee that the Operand kind is one of those | 243 /// instructions that guarantee that the Operand kind is one of those |
244 /// indicated by the LegalMask (a bitmask of allowed kinds). If the | 244 /// indicated by the LegalMask (a bitmask of allowed kinds). If the |
245 /// input Operand is known to already meet the constraints, it may be | 245 /// input Operand is known to already meet the constraints, it may be |
246 /// simply returned as the result, without creating any new | 246 /// simply returned as the result, without creating any new |
247 /// instructions or operands. | 247 /// instructions or operands. |
248 enum OperandLegalization { | 248 enum OperandLegalization { |
249 Legal_None = 0, | 249 Legal_None = 0, |
250 Legal_Reg = 1 << 0, // physical register, not stack location | 250 Legal_Reg = 1 << 0, // physical register, not stack location |
251 Legal_Imm = 1 << 1, | 251 Legal_Imm = 1 << 1, |
252 Legal_Mem = 1 << 2, // includes [eax+4*ecx] as well as [esp+12] | 252 Legal_Mem = 1 << 2, // includes [eax+4*ecx] as well as [esp+12] |
253 Legal_All = ~Legal_None | 253 Legal_All = ~Legal_None |
254 }; | 254 }; |
255 typedef uint32_t LegalMask; | 255 using LegalMask = uint32_t; |
256 Operand *legalize(Operand *From, LegalMask Allowed = Legal_All, | 256 Operand *legalize(Operand *From, LegalMask Allowed = Legal_All, |
257 int32_t RegNum = Variable::NoRegister); | 257 int32_t RegNum = Variable::NoRegister); |
258 Variable *legalizeToReg(Operand *From, int32_t RegNum = Variable::NoRegister); | 258 Variable *legalizeToReg(Operand *From, int32_t RegNum = Variable::NoRegister); |
259 /// Legalize the first source operand for use in the cmp instruction. | 259 /// Legalize the first source operand for use in the cmp instruction. |
260 Operand *legalizeSrc0ForCmp(Operand *Src0, Operand *Src1); | 260 Operand *legalizeSrc0ForCmp(Operand *Src0, Operand *Src1); |
261 /// Turn a pointer operand into a memory operand that can be | 261 /// Turn a pointer operand into a memory operand that can be |
262 /// used by a real load/store operation. Legalizes the operand as well. | 262 /// used by a real load/store operation. Legalizes the operand as well. |
263 /// This is a nop if the operand is already a legal memory operand. | 263 /// This is a nop if the operand is already a legal memory operand. |
264 typename Traits::X86OperandMem *formMemoryOperand(Operand *Ptr, Type Ty, | 264 typename Traits::X86OperandMem *formMemoryOperand(Operand *Ptr, Type Ty, |
265 bool DoLegalize = true); | 265 bool DoLegalize = true); |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 } | 726 } |
727 | 727 |
728 BoolFolding FoldingInfo; | 728 BoolFolding FoldingInfo; |
729 }; | 729 }; |
730 } // end of namespace X86Internal | 730 } // end of namespace X86Internal |
731 } // end of namespace Ice | 731 } // end of namespace Ice |
732 | 732 |
733 #include "IceTargetLoweringX86BaseImpl.h" | 733 #include "IceTargetLoweringX86BaseImpl.h" |
734 | 734 |
735 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H | 735 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H |
OLD | NEW |