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

Side by Side Diff: src/IceTargetLoweringX86Base.h

Issue 1326013002: Refactor Lo and Hi out of Variable. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Refactor Hi and Lo out of Variable 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/IceTargetLoweringX8632.cpp ('k') | src/IceTargetLoweringX86BaseImpl.h » ('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/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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 SizeT getFrameOrStackReg() const override { 85 SizeT getFrameOrStackReg() const override {
86 return IsEbpBasedFrame ? Traits::RegisterSet::Reg_ebp 86 return IsEbpBasedFrame ? Traits::RegisterSet::Reg_ebp
87 : Traits::RegisterSet::Reg_esp; 87 : Traits::RegisterSet::Reg_esp;
88 } 88 }
89 size_t typeWidthInBytesOnStack(Type Ty) const override { 89 size_t typeWidthInBytesOnStack(Type Ty) const override {
90 // Round up to the next multiple of WordType bytes. 90 // Round up to the next multiple of WordType bytes.
91 const uint32_t WordSizeInBytes = typeWidthInBytes(Traits::WordType); 91 const uint32_t WordSizeInBytes = typeWidthInBytes(Traits::WordType);
92 return Utils::applyAlignment(typeWidthInBytes(Ty), WordSizeInBytes); 92 return Utils::applyAlignment(typeWidthInBytes(Ty), WordSizeInBytes);
93 } 93 }
94 94
95 bool shouldSplitToVariable64On32(Type Ty) const override {
96 return Traits::Is64Bit ? false : Ty == IceType_i64;
97 }
98
95 SizeT getMinJumpTableSize() const override { return 4; } 99 SizeT getMinJumpTableSize() const override { return 4; }
96 100
97 void emitVariable(const Variable *Var) const override; 101 void emitVariable(const Variable *Var) const override;
98 102
99 const char *getConstantPrefix() const final { return "$"; } 103 const char *getConstantPrefix() const final { return "$"; }
100 void emit(const ConstantUndef *C) const final; 104 void emit(const ConstantUndef *C) const final;
101 void emit(const ConstantInteger32 *C) const final; 105 void emit(const ConstantInteger32 *C) const final;
102 void emit(const ConstantInteger64 *C) const final; 106 void emit(const ConstantInteger64 *C) const final;
103 void emit(const ConstantFloat *C) const final; 107 void emit(const ConstantFloat *C) const final;
104 void emit(const ConstantDouble *C) const final; 108 void emit(const ConstantDouble *C) const final;
105 109
106 void initNodeForLowering(CfgNode *Node) override; 110 void initNodeForLowering(CfgNode *Node) override;
107 /// x86-32: Ensure that a 64-bit Variable has been split into 2 32-bit
108 /// Variables, creating them if necessary. This is needed for all I64
109 /// operations, and it is needed for pushing F64 arguments for function calls
110 /// using the 32-bit push instruction (though the latter could be done by
111 /// directly writing to the stack).
112 ///
113 /// x86-64: Complains loudly if invoked because the cpu can handle 64-bit
114 /// types natively.
115 template <typename T = Traits>
116 typename std::enable_if<!T::Is64Bit, void>::type split64(Variable *Var);
117 template <typename T = Traits>
118 typename std::enable_if<T::Is64Bit, void>::type split64(Variable *) {
119 llvm::report_fatal_error(
120 "Hey, yo! This is x86-64. Watcha doin'? (split64)");
121 }
122 111
123 template <typename T = Traits> 112 template <typename T = Traits>
124 typename std::enable_if<!T::Is64Bit, Operand>::type * 113 typename std::enable_if<!T::Is64Bit, Operand>::type *
125 loOperand(Operand *Operand); 114 loOperand(Operand *Operand);
126 template <typename T = Traits> 115 template <typename T = Traits>
127 typename std::enable_if<T::Is64Bit, Operand>::type *loOperand(Operand *) { 116 typename std::enable_if<T::Is64Bit, Operand>::type *loOperand(Operand *) {
128 llvm::report_fatal_error( 117 llvm::report_fatal_error(
129 "Hey, yo! This is x86-64. Watcha doin'? (loOperand)"); 118 "Hey, yo! This is x86-64. Watcha doin'? (loOperand)");
130 } 119 }
131 120
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 } 714 }
726 715
727 BoolFolding FoldingInfo; 716 BoolFolding FoldingInfo;
728 }; 717 };
729 } // end of namespace X86Internal 718 } // end of namespace X86Internal
730 } // end of namespace Ice 719 } // end of namespace Ice
731 720
732 #include "IceTargetLoweringX86BaseImpl.h" 721 #include "IceTargetLoweringX86BaseImpl.h"
733 722
734 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H 723 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASE_H
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTargetLoweringX86BaseImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698