Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: src/IceTargetLoweringARM32.h

Issue 1300993002: Use separate random number generator for each randomization pass (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 lowering ----*- C++ -*-===// 1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 void lowerLoad(const InstLoad *Inst) override; 131 void lowerLoad(const InstLoad *Inst) override;
132 void lowerPhi(const InstPhi *Inst) override; 132 void lowerPhi(const InstPhi *Inst) override;
133 void lowerRet(const InstRet *Inst) override; 133 void lowerRet(const InstRet *Inst) override;
134 void lowerSelect(const InstSelect *Inst) override; 134 void lowerSelect(const InstSelect *Inst) override;
135 void lowerStore(const InstStore *Inst) override; 135 void lowerStore(const InstStore *Inst) override;
136 void lowerSwitch(const InstSwitch *Inst) override; 136 void lowerSwitch(const InstSwitch *Inst) override;
137 void lowerUnreachable(const InstUnreachable *Inst) override; 137 void lowerUnreachable(const InstUnreachable *Inst) override;
138 void prelowerPhis() override; 138 void prelowerPhis() override;
139 void doAddressOptLoad() override; 139 void doAddressOptLoad() override;
140 void doAddressOptStore() override; 140 void doAddressOptStore() override;
141 void randomlyInsertNop(float Probability) override; 141 void randomlyInsertNop(float Probability,
142 RandomNumberGenerator &RNG) override;
142 143
143 enum OperandLegalization { 144 enum OperandLegalization {
144 Legal_None = 0, 145 Legal_None = 0,
145 Legal_Reg = 1 << 0, /// physical register, not stack location 146 Legal_Reg = 1 << 0, /// physical register, not stack location
146 Legal_Flex = 1 << 1, /// A flexible operand2, which can hold rotated 147 Legal_Flex = 1 << 1, /// A flexible operand2, which can hold rotated
147 /// small immediates, or shifted registers. 148 /// small immediates, or shifted registers.
148 Legal_Mem = 1 << 2, /// includes [r0, r1 lsl #2] as well as [sp, #12] 149 Legal_Mem = 1 << 2, /// includes [r0, r1 lsl #2] as well as [sp, #12]
149 Legal_All = ~Legal_None 150 Legal_All = ~Legal_None
150 }; 151 };
151 typedef uint32_t LegalMask; 152 typedef uint32_t LegalMask;
152 Operand *legalize(Operand *From, LegalMask Allowed = Legal_All, 153 Operand *legalize(Operand *From, LegalMask Allowed = Legal_All,
153 int32_t RegNum = Variable::NoRegister); 154 int32_t RegNum = Variable::NoRegister);
154 Variable *legalizeToReg(Operand *From, int32_t RegNum = Variable::NoRegister); 155 Variable *legalizeToReg(Operand *From, int32_t RegNum = Variable::NoRegister);
155 OperandARM32Mem *formMemoryOperand(Operand *Ptr, Type Ty); 156 OperandARM32Mem *formMemoryOperand(Operand *Ptr, Type Ty);
156 157
157 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister); 158 Variable *makeReg(Type Ty, int32_t RegNum = Variable::NoRegister);
158 static Type stackSlotType(); 159 static Type stackSlotType();
159 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister); 160 Variable *copyToReg(Operand *Src, int32_t RegNum = Variable::NoRegister);
160 void alignRegisterPow2(Variable *Reg, uint32_t Align); 161 void alignRegisterPow2(Variable *Reg, uint32_t Align);
161 162
162 /// Returns a vector in a register with the given constant entries. 163 /// Returns a vector in a register with the given constant entries.
163 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister); 164 Variable *makeVectorOfZeros(Type Ty, int32_t RegNum = Variable::NoRegister);
164 165
165 void makeRandomRegisterPermutation( 166 void
166 llvm::SmallVectorImpl<int32_t> &Permutation, 167 makeRandomRegisterPermutation(llvm::SmallVectorImpl<int32_t> &Permutation,
167 const llvm::SmallBitVector &ExcludeRegisters) const override; 168 const llvm::SmallBitVector &ExcludeRegisters,
169 uint64_t Salt) const override;
168 170
169 // If a divide-by-zero check is needed, inserts a: 171 // If a divide-by-zero check is needed, inserts a:
170 // test; branch .LSKIP; trap; .LSKIP: <continuation>. 172 // test; branch .LSKIP; trap; .LSKIP: <continuation>.
171 // If no check is needed nothing is inserted. 173 // If no check is needed nothing is inserted.
172 void div0Check(Type Ty, Operand *SrcLo, Operand *SrcHi); 174 void div0Check(Type Ty, Operand *SrcLo, Operand *SrcHi);
173 typedef void (TargetARM32::*ExtInstr)(Variable *, Variable *, 175 typedef void (TargetARM32::*ExtInstr)(Variable *, Variable *,
174 CondARM32::Cond); 176 CondARM32::Cond);
175 typedef void (TargetARM32::*DivInstr)(Variable *, Variable *, Variable *, 177 typedef void (TargetARM32::*DivInstr)(Variable *, Variable *, Variable *,
176 CondARM32::Cond); 178 CondARM32::Cond);
177 void lowerIDivRem(Variable *Dest, Variable *T, Variable *Src0R, Operand *Src1, 179 void lowerIDivRem(Variable *Dest, Variable *T, Variable *Src0R, Operand *Src1,
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 514
513 private: 515 private:
514 ~TargetHeaderARM32() = default; 516 ~TargetHeaderARM32() = default;
515 517
516 TargetARM32Features CPUFeatures; 518 TargetARM32Features CPUFeatures;
517 }; 519 };
518 520
519 } // end of namespace Ice 521 } // end of namespace Ice
520 522
521 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H 523 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698