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

Side by Side Diff: src/IceTargetLoweringARM32.h

Issue 1319203005: Subzero. Changes the Register Allocator so that it is aware of register (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 5 years, 3 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
« no previous file with comments | « src/IceTargetLowering.h ('k') | src/IceTargetLoweringARM32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override; 61 bool doBranchOpt(Inst *I, const CfgNode *NextNode) override;
62 62
63 SizeT getNumRegisters() const override { return RegARM32::Reg_NUM; } 63 SizeT getNumRegisters() const override { return RegARM32::Reg_NUM; }
64 Variable *getPhysicalRegister(SizeT RegNum, Type Ty = IceType_void) override; 64 Variable *getPhysicalRegister(SizeT RegNum, Type Ty = IceType_void) override;
65 IceString getRegName(SizeT RegNum, Type Ty) const override; 65 IceString getRegName(SizeT RegNum, Type Ty) const override;
66 llvm::SmallBitVector getRegisterSet(RegSetMask Include, 66 llvm::SmallBitVector getRegisterSet(RegSetMask Include,
67 RegSetMask Exclude) const override; 67 RegSetMask Exclude) const override;
68 const llvm::SmallBitVector &getRegisterSetForType(Type Ty) const override { 68 const llvm::SmallBitVector &getRegisterSetForType(Type Ty) const override {
69 return TypeToRegisterSet[Ty]; 69 return TypeToRegisterSet[Ty];
70 } 70 }
71 const llvm::SmallBitVector &getAliasesForRegister(SizeT Reg) const override {
72 return RegisterAliases[Reg];
73 }
71 bool hasFramePointer() const override { return UsesFramePointer; } 74 bool hasFramePointer() const override { return UsesFramePointer; }
72 SizeT getFrameOrStackReg() const override { 75 SizeT getFrameOrStackReg() const override {
73 return UsesFramePointer ? RegARM32::Reg_fp : RegARM32::Reg_sp; 76 return UsesFramePointer ? RegARM32::Reg_fp : RegARM32::Reg_sp;
74 } 77 }
75 SizeT getReservedTmpReg() const { return RegARM32::Reg_ip; } 78 SizeT getReservedTmpReg() const { return RegARM32::Reg_ip; }
76 79
77 size_t typeWidthInBytesOnStack(Type Ty) const override { 80 size_t typeWidthInBytesOnStack(Type Ty) const override {
78 // Round up to the next multiple of 4 bytes. In particular, i1, 81 // Round up to the next multiple of 4 bytes. In particular, i1,
79 // i8, and i16 are rounded up to 4 bytes. 82 // i8, and i16 are rounded up to 4 bytes.
80 return (typeWidthInBytes(Ty) + 3) & ~3; 83 return (typeWidthInBytes(Ty) + 3) & ~3;
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 bool isLegalVariableStackOffset(int32_t Offset) const; 430 bool isLegalVariableStackOffset(int32_t Offset) const;
428 /// Assuming Var needs its offset legalized, define a new base register 431 /// Assuming Var needs its offset legalized, define a new base register
429 /// centered on the given Var's offset and use it. 432 /// centered on the given Var's offset and use it.
430 StackVariable *legalizeVariableSlot(Variable *Var, Variable *OrigBaseReg); 433 StackVariable *legalizeVariableSlot(Variable *Var, Variable *OrigBaseReg);
431 434
432 TargetARM32Features CPUFeatures; 435 TargetARM32Features CPUFeatures;
433 bool UsesFramePointer = false; 436 bool UsesFramePointer = false;
434 bool NeedsStackAlignment = false; 437 bool NeedsStackAlignment = false;
435 bool MaybeLeafFunc = true; 438 bool MaybeLeafFunc = true;
436 size_t SpillAreaSizeBytes = 0; 439 size_t SpillAreaSizeBytes = 0;
440 // TODO(jpp): std::array instead of array.
437 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; 441 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM];
442 llvm::SmallBitVector RegisterAliases[RegARM32::Reg_NUM];
438 llvm::SmallBitVector ScratchRegs; 443 llvm::SmallBitVector ScratchRegs;
439 llvm::SmallBitVector RegsUsed; 444 llvm::SmallBitVector RegsUsed;
440 VarList PhysicalRegisters[IceType_NUM]; 445 VarList PhysicalRegisters[IceType_NUM];
441 446
442 /// Helper class that understands the Calling Convention and register 447 /// Helper class that understands the Calling Convention and register
443 /// assignments. The first few integer type parameters can use r0-r3, 448 /// assignments. The first few integer type parameters can use r0-r3,
444 /// regardless of their position relative to the floating-point/vector 449 /// regardless of their position relative to the floating-point/vector
445 /// arguments in the argument list. Floating-point and vector arguments 450 /// arguments in the argument list. Floating-point and vector arguments
446 /// can use q0-q3 (aka d0-d7, s0-s15). Technically, arguments that can 451 /// can use q0-q3 (aka d0-d7, s0-s15). Technically, arguments that can
447 /// start with registers but extend beyond the available registers can be 452 /// start with registers but extend beyond the available registers can be
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 519
515 private: 520 private:
516 ~TargetHeaderARM32() = default; 521 ~TargetHeaderARM32() = default;
517 522
518 TargetARM32Features CPUFeatures; 523 TargetARM32Features CPUFeatures;
519 }; 524 };
520 525
521 } // end of namespace Ice 526 } // end of namespace Ice
522 527
523 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H 528 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H
OLDNEW
« no previous file with comments | « src/IceTargetLowering.h ('k') | src/IceTargetLoweringARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698