OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// |
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 implements the TargetLoweringX8632 class, which | 10 // This file implements the TargetLoweringX8632 class, which |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 namespace cl = ::llvm::cl; | 141 namespace cl = ::llvm::cl; |
142 cl::opt<TargetX8632::X86InstructionSet> CLInstructionSet( | 142 cl::opt<TargetX8632::X86InstructionSet> CLInstructionSet( |
143 "mattr", cl::desc("X86 target attributes"), | 143 "mattr", cl::desc("X86 target attributes"), |
144 cl::init(TargetX8632::SSE2), | 144 cl::init(TargetX8632::SSE2), |
145 cl::values( | 145 cl::values( |
146 clEnumValN(TargetX8632::SSE2, "sse2", | 146 clEnumValN(TargetX8632::SSE2, "sse2", |
147 "Enable SSE2 instructions (default)"), | 147 "Enable SSE2 instructions (default)"), |
148 clEnumValN(TargetX8632::SSE4_1, "sse4.1", | 148 clEnumValN(TargetX8632::SSE4_1, "sse4.1", |
149 "Enable SSE 4.1 instructions"), clEnumValEnd)); | 149 "Enable SSE 4.1 instructions"), clEnumValEnd)); |
150 | 150 |
151 // Return a string representation of the type that is suitable for use | |
152 // in an identifier. | |
153 IceString typeIdentString(const Type Ty) { | |
154 IceString Str; | |
155 llvm::raw_string_ostream BaseOS(Str); | |
156 if (isVectorType(Ty)) { | |
157 BaseOS << "v" << typeNumElements(Ty) << typeElementType(Ty); | |
158 } else { | |
159 BaseOS << Ty; | |
160 } | |
161 return BaseOS.str(); | |
162 } | |
163 | |
164 // In some cases, there are x-macros tables for both high-level and | 151 // In some cases, there are x-macros tables for both high-level and |
165 // low-level instructions/operands that use the same enum key value. | 152 // low-level instructions/operands that use the same enum key value. |
166 // The tables are kept separate to maintain a proper separation | 153 // The tables are kept separate to maintain a proper separation |
167 // between abstraction layers. There is a risk that the tables | 154 // between abstraction layers. There is a risk that the tables |
168 // could get out of sync if enum values are reordered or if entries | 155 // could get out of sync if enum values are reordered or if entries |
169 // are added or deleted. This dummy function uses static_assert to | 156 // are added or deleted. This dummy function uses static_assert to |
170 // ensure everything is kept in sync. | 157 // ensure everything is kept in sync. |
171 void __attribute__((unused)) xMacroIntegrityCheck() { | 158 void __attribute__((unused)) xMacroIntegrityCheck() { |
172 // Validate the enum values in FCMPX8632_TABLE. | 159 // Validate the enum values in FCMPX8632_TABLE. |
173 { | 160 { |
(...skipping 4075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4249 for (SizeT i = 0; i < Size; ++i) { | 4236 for (SizeT i = 0; i < Size; ++i) { |
4250 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; | 4237 Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n"; |
4251 } | 4238 } |
4252 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; | 4239 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; |
4253 } | 4240 } |
4254 Str << "\t" << (IsInternal ? ".local" : ".global") << "\t" << MangledName | 4241 Str << "\t" << (IsInternal ? ".local" : ".global") << "\t" << MangledName |
4255 << "\n"; | 4242 << "\n"; |
4256 } | 4243 } |
4257 | 4244 |
4258 } // end of namespace Ice | 4245 } // end of namespace Ice |
OLD | NEW |