| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 /// Naive lowering of cmpxchg. | 153 /// Naive lowering of cmpxchg. |
| 154 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected, | 154 void lowerAtomicCmpxchg(Variable *DestPrev, Operand *Ptr, Operand *Expected, |
| 155 Operand *Desired); | 155 Operand *Desired); |
| 156 /// Attempt a more optimized lowering of cmpxchg. Returns true if optimized. | 156 /// Attempt a more optimized lowering of cmpxchg. Returns true if optimized. |
| 157 bool tryOptimizedCmpxchgCmpBr(Variable *DestPrev, Operand *Ptr, | 157 bool tryOptimizedCmpxchgCmpBr(Variable *DestPrev, Operand *Ptr, |
| 158 Operand *Expected, Operand *Desired); | 158 Operand *Expected, Operand *Desired); |
| 159 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, | 159 void lowerAtomicRMW(Variable *Dest, uint32_t Operation, Operand *Ptr, |
| 160 Operand *Val); | 160 Operand *Val); |
| 161 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, | 161 void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal, |
| 162 Operand *SecondVal); | 162 Operand *SecondVal); |
| 163 /// Replace a function call with inline instructions. |
| 164 void lowerMemset(Operand *Dest, Operand *Val, Operand *Count); |
| 163 | 165 |
| 164 /// Check the comparison is in [Min,Max]. The flags register will be modified | 166 /// Check the comparison is in [Min,Max]. The flags register will be modified |
| 165 /// with: | 167 /// with: |
| 166 /// - below equal, if in range | 168 /// - below equal, if in range |
| 167 /// - above, set if not in range | 169 /// - above, set if not in range |
| 168 /// The index into the range is returned. | 170 /// The index into the range is returned. |
| 169 Operand *lowerCmpRange(Operand *Comparison, uint64_t Min, uint64_t Max); | 171 Operand *lowerCmpRange(Operand *Comparison, uint64_t Min, uint64_t Max); |
| 170 /// Lowering of a cluster of switch cases. If the case is not matched control | 172 /// Lowering of a cluster of switch cases. If the case is not matched control |
| 171 /// will pass to the default label provided. If the default label is nullptr | 173 /// will pass to the default label provided. If the default label is nullptr |
| 172 /// then control will fall through to the next instruction. DoneCmp should be | 174 /// then control will fall through to the next instruction. DoneCmp should be |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 /// used by a real load/store operation. Legalizes the operand as well. | 209 /// used by a real load/store operation. Legalizes the operand as well. |
| 208 /// This is a nop if the operand is already a legal memory operand. | 210 /// This is a nop if the operand is already a legal memory operand. |
| 209 typename Traits::X86OperandMem *formMemoryOperand(Operand *Ptr, Type Ty, | 211 typename Traits::X86OperandMem *formMemoryOperand(Operand *Ptr, Type Ty, |
| 210 bool DoLegalize = true); | 212 bool DoLegalize = true); |
| 211 | 213 |
| 212 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); | 214 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); |
| 213 static Type stackSlotType(); | 215 static Type stackSlotType(); |
| 214 | 216 |
| 215 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); | 217 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); |
| 216 | 218 |
| 217 /// Returns a vector in a register with the given constant entries. | 219 /// \name Returns a vector in a register with the given constant entries. |
| 220 /// @{ |
| 218 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister); | 221 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister); |
| 219 Variable *makeVectorOfOnes(Type Ty, int32_t RegNum = Variable::NoRegister); | 222 Variable *makeVectorOfOnes(Type Ty, int32_t RegNum = Variable::NoRegister); |
| 220 Variable *makeVectorOfMinusOnes(Type Ty, | 223 Variable *makeVectorOfMinusOnes(Type Ty, |
| 221 int32_t RegNum = Variable::NoRegister); | 224 int32_t RegNum = Variable::NoRegister); |
| 222 Variable *makeVectorOfHighOrderBits(Type Ty, | 225 Variable *makeVectorOfHighOrderBits(Type Ty, |
| 223 int32_t RegNum = Variable::NoRegister); | 226 int32_t RegNum = Variable::NoRegister); |
| 224 Variable *makeVectorOfFabsMask(Type Ty, | 227 Variable *makeVectorOfFabsMask(Type Ty, |
| 225 int32_t RegNum = Variable::NoRegister); | 228 int32_t RegNum = Variable::NoRegister); |
| 229 /// @} |
| 226 | 230 |
| 227 /// Return a memory operand corresponding to a stack allocated Variable. | 231 /// Return a memory operand corresponding to a stack allocated Variable. |
| 228 typename Traits::X86OperandMem * | 232 typename Traits::X86OperandMem * |
| 229 getMemoryOperandForStackSlot(Type Ty, Variable *Slot, uint32_t Offset = 0); | 233 getMemoryOperandForStackSlot(Type Ty, Variable *Slot, uint32_t Offset = 0); |
| 230 | 234 |
| 231 void makeRandomRegisterPermutation( | 235 void makeRandomRegisterPermutation( |
| 232 llvm::SmallVectorImpl<int32_t> &Permutation, | 236 llvm::SmallVectorImpl<int32_t> &Permutation, |
| 233 const llvm::SmallBitVector &ExcludeRegisters) const override; | 237 const llvm::SmallBitVector &ExcludeRegisters) const override; |
| 234 | 238 |
| 235 /// The following are helpers that insert lowered x86 instructions | 239 /// The following are helpers that insert lowered x86 instructions |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 } | 609 } |
| 606 | 610 |
| 607 BoolFolding FoldingInfo; | 611 BoolFolding FoldingInfo; |
| 608 }; | 612 }; |
| 609 } // end of namespace X86Internal | 613 } // end of namespace X86Internal |
| 610 } // end of namespace Ice | 614 } // end of namespace Ice |
| 611 | 615 |
| 612 #include "IceTargetLoweringX86BaseImpl.h" | 616 #include "IceTargetLoweringX86BaseImpl.h" |
| 613 | 617 |
| 614 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H | 618 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H |
| OLD | NEW |