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

Side by Side Diff: src/IceTargetLoweringARM32.h

Issue 1191573003: Add a basic enum for ARM InstructionSet / cpu features. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: comment Created 5 years, 6 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 // This file declares the TargetLoweringARM32 class, which implements the 10 // This file declares the TargetLoweringARM32 class, which implements the
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 // Ensure that a 64-bit Variable has been split into 2 32-bit 69 // Ensure that a 64-bit Variable has been split into 2 32-bit
70 // Variables, creating them if necessary. This is needed for all 70 // Variables, creating them if necessary. This is needed for all
71 // I64 operations. 71 // I64 operations.
72 void split64(Variable *Var); 72 void split64(Variable *Var);
73 Operand *loOperand(Operand *Operand); 73 Operand *loOperand(Operand *Operand);
74 Operand *hiOperand(Operand *Operand); 74 Operand *hiOperand(Operand *Operand);
75 void finishArgumentLowering(Variable *Arg, Variable *FramePtr, 75 void finishArgumentLowering(Variable *Arg, Variable *FramePtr,
76 size_t BasicFrameOffset, size_t &InArgsSizeBytes); 76 size_t BasicFrameOffset, size_t &InArgsSizeBytes);
77 77
78 enum ARM32InstructionSet {
79 Begin,
80 // Neon is the PNaCl baseline instruction set.
81 Neon = Begin,
82 HWDivArm, // HW divide in ARM mode (not just Thumb mode).
83 End
84 };
85
86 ARM32InstructionSet getInstructionSet() const { return InstructionSet; }
87
78 protected: 88 protected:
79 explicit TargetARM32(Cfg *Func); 89 explicit TargetARM32(Cfg *Func);
80 90
81 void postLower() override; 91 void postLower() override;
82 92
83 void lowerAlloca(const InstAlloca *Inst) override; 93 void lowerAlloca(const InstAlloca *Inst) override;
84 void lowerArithmetic(const InstArithmetic *Inst) override; 94 void lowerArithmetic(const InstArithmetic *Inst) override;
85 void lowerAssign(const InstAssign *Inst) override; 95 void lowerAssign(const InstAssign *Inst) override;
86 void lowerBr(const InstBr *Inst) override; 96 void lowerBr(const InstBr *Inst) override;
87 void lowerCall(const InstCall *Inst) override; 97 void lowerCall(const InstCall *Inst) override;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 InstARM32Umull::create(Func, DestLo, DestHi, Src0, Src1, Pred)); 291 InstARM32Umull::create(Func, DestLo, DestHi, Src0, Src1, Pred));
282 // Model the modification to the second dest as a fake def. 292 // Model the modification to the second dest as a fake def.
283 // Note that the def is not predicated. 293 // Note that the def is not predicated.
284 Context.insert(InstFakeDef::create(Func, DestHi, DestLo)); 294 Context.insert(InstFakeDef::create(Func, DestHi, DestLo));
285 } 295 }
286 void _uxt(Variable *Dest, Variable *Src0, 296 void _uxt(Variable *Dest, Variable *Src0,
287 CondARM32::Cond Pred = CondARM32::AL) { 297 CondARM32::Cond Pred = CondARM32::AL) {
288 Context.insert(InstARM32Uxt::create(Func, Dest, Src0, Pred)); 298 Context.insert(InstARM32Uxt::create(Func, Dest, Src0, Pred));
289 } 299 }
290 300
301 ARM32InstructionSet InstructionSet;
291 bool UsesFramePointer; 302 bool UsesFramePointer;
292 bool NeedsStackAlignment; 303 bool NeedsStackAlignment;
293 bool MaybeLeafFunc; 304 bool MaybeLeafFunc;
294 size_t SpillAreaSizeBytes; 305 size_t SpillAreaSizeBytes;
295 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; 306 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM];
296 llvm::SmallBitVector ScratchRegs; 307 llvm::SmallBitVector ScratchRegs;
297 llvm::SmallBitVector RegsUsed; 308 llvm::SmallBitVector RegsUsed;
298 VarList PhysicalRegisters[IceType_NUM]; 309 VarList PhysicalRegisters[IceType_NUM];
299 static IceString RegNames[]; 310 static IceString RegNames[];
300 311
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 protected: 350 protected:
340 explicit TargetHeaderARM32(GlobalContext *Ctx); 351 explicit TargetHeaderARM32(GlobalContext *Ctx);
341 352
342 private: 353 private:
343 ~TargetHeaderARM32() = default; 354 ~TargetHeaderARM32() = default;
344 }; 355 };
345 356
346 } // end of namespace Ice 357 } // end of namespace Ice
347 358
348 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H 359 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698