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

Side by Side Diff: src/IceTargetLoweringX8632.h

Issue 870653002: Subzero: Initial implementation of multithreaded translation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Cleanup Created 5 years, 11 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/IceTargetLoweringX8632.h - x86-32 lowering ---*- C++ -*-===// 1 //===- subzero/src/IceTargetLoweringX8632.h - x86-32 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 TargetLoweringX8632 class, which 10 // This file declares the TargetLoweringX8632 class, which
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 size_t typeWidthInBytesOnStack(Type Ty) const override { 50 size_t typeWidthInBytesOnStack(Type Ty) const override {
51 // Round up to the next multiple of 4 bytes. In particular, i1, 51 // Round up to the next multiple of 4 bytes. In particular, i1,
52 // i8, and i16 are rounded up to 4 bytes. 52 // i8, and i16 are rounded up to 4 bytes.
53 return (typeWidthInBytes(Ty) + 3) & ~3; 53 return (typeWidthInBytes(Ty) + 3) & ~3;
54 } 54 }
55 void emitVariable(const Variable *Var) const override; 55 void emitVariable(const Variable *Var) const override;
56 void lowerArguments() override; 56 void lowerArguments() override;
57 void addProlog(CfgNode *Node) override; 57 void addProlog(CfgNode *Node) override;
58 void addEpilog(CfgNode *Node) override; 58 void addEpilog(CfgNode *Node) override;
59 void emitConstants() const override; 59 static void emitConstants(GlobalContext *Ctx);
JF 2015/01/22 20:50:56 Why not keep this as override, and implement per t
Jim Stichnoth 2015/01/23 07:55:55 The reason was explained in the CL description: "
60 SizeT makeNextLabelNumber() { return NextLabelNumber++; } 60 SizeT makeNextLabelNumber() { return NextLabelNumber++; }
61 // Ensure that a 64-bit Variable has been split into 2 32-bit 61 // Ensure that a 64-bit Variable has been split into 2 32-bit
62 // Variables, creating them if necessary. This is needed for all 62 // Variables, creating them if necessary. This is needed for all
63 // I64 operations, and it is needed for pushing F64 arguments for 63 // I64 operations, and it is needed for pushing F64 arguments for
64 // function calls using the 32-bit push instruction (though the 64 // function calls using the 32-bit push instruction (though the
65 // latter could be done by directly writing to the stack). 65 // latter could be done by directly writing to the stack).
66 void split64(Variable *Var); 66 void split64(Variable *Var);
67 void finishArgumentLowering(Variable *Arg, Variable *FramePtr, 67 void finishArgumentLowering(Variable *Arg, Variable *FramePtr,
68 size_t BasicFrameOffset, size_t &InArgsSizeBytes); 68 size_t BasicFrameOffset, size_t &InArgsSizeBytes);
69 Operand *loOperand(Operand *Operand); 69 Operand *loOperand(Operand *Operand);
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 size_t SpillAreaSizeBytes; 480 size_t SpillAreaSizeBytes;
481 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; 481 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM];
482 llvm::SmallBitVector ScratchRegs; 482 llvm::SmallBitVector ScratchRegs;
483 llvm::SmallBitVector RegsUsed; 483 llvm::SmallBitVector RegsUsed;
484 SizeT NextLabelNumber; 484 SizeT NextLabelNumber;
485 VarList PhysicalRegisters[IceType_NUM]; 485 VarList PhysicalRegisters[IceType_NUM];
486 static IceString RegNames[]; 486 static IceString RegNames[];
487 487
488 private: 488 private:
489 ~TargetX8632() override {} 489 ~TargetX8632() override {}
490 template <typename T> void emitConstantPool() const; 490 template <typename T> static void emitConstantPool(GlobalContext *Ctx);
491 }; 491 };
492 492
493 class TargetGlobalInitX8632 : public TargetGlobalInitLowering { 493 class TargetGlobalInitX8632 : public TargetGlobalInitLowering {
494 TargetGlobalInitX8632(const TargetGlobalInitX8632 &) = delete; 494 TargetGlobalInitX8632(const TargetGlobalInitX8632 &) = delete;
495 TargetGlobalInitX8632 &operator=(const TargetGlobalInitX8632 &) = delete; 495 TargetGlobalInitX8632 &operator=(const TargetGlobalInitX8632 &) = delete;
496 496
497 public: 497 public:
498 static TargetGlobalInitLowering *create(GlobalContext *Ctx) { 498 static TargetGlobalInitLowering *create(GlobalContext *Ctx) {
499 return new TargetGlobalInitX8632(Ctx); 499 return new TargetGlobalInitX8632(Ctx);
500 } 500 }
501 501
502 virtual void lower(const VariableDeclaration &Var) final; 502 virtual void lower(const VariableDeclaration &Var) final;
503 503
504 protected: 504 protected:
505 TargetGlobalInitX8632(GlobalContext *Ctx); 505 TargetGlobalInitX8632(GlobalContext *Ctx);
506 506
507 private: 507 private:
508 ~TargetGlobalInitX8632() override {} 508 ~TargetGlobalInitX8632() override {}
509 }; 509 };
510 510
511 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const; 511 template <> void ConstantInteger32::emit(GlobalContext *Ctx) const;
512 template <> void ConstantInteger64::emit(GlobalContext *Ctx) const; 512 template <> void ConstantInteger64::emit(GlobalContext *Ctx) const;
513 template <> void ConstantFloat::emit(GlobalContext *Ctx) const; 513 template <> void ConstantFloat::emit(GlobalContext *Ctx) const;
514 template <> void ConstantDouble::emit(GlobalContext *Ctx) const; 514 template <> void ConstantDouble::emit(GlobalContext *Ctx) const;
515 515
516 } // end of namespace Ice 516 } // end of namespace Ice
517 517
518 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H 518 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698