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

Side by Side Diff: src/IceTargetLoweringX86BaseImpl.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/IceTargetLoweringX86Base.h ('k') | no next file » | 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/IceTargetLoweringX86BaseImpl.h - x86 lowering -*- C++ -*-==// 1 //===- subzero/src/IceTargetLoweringX86BaseImpl.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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 "Traits::InstructionSet range different from TargetInstructionSet"); 274 "Traits::InstructionSet range different from TargetInstructionSet");
275 if (Func->getContext()->getFlags().getTargetInstructionSet() != 275 if (Func->getContext()->getFlags().getTargetInstructionSet() !=
276 TargetInstructionSet::BaseInstructionSet) { 276 TargetInstructionSet::BaseInstructionSet) {
277 InstructionSet = static_cast<typename Traits::InstructionSet>( 277 InstructionSet = static_cast<typename Traits::InstructionSet>(
278 (Func->getContext()->getFlags().getTargetInstructionSet() - 278 (Func->getContext()->getFlags().getTargetInstructionSet() -
279 TargetInstructionSet::X86InstructionSet_Begin) + 279 TargetInstructionSet::X86InstructionSet_Begin) +
280 Traits::InstructionSet::Begin); 280 Traits::InstructionSet::Begin);
281 } 281 }
282 // TODO: Don't initialize IntegerRegisters and friends every time. Instead, 282 // TODO: Don't initialize IntegerRegisters and friends every time. Instead,
283 // initialize in some sort of static initializer for the class. 283 // initialize in some sort of static initializer for the class.
284 llvm::SmallBitVector IntegerRegisters(Traits::RegisterSet::Reg_NUM); 284 Traits::initRegisterSet(&TypeToRegisterSet, &RegisterAliases, &ScratchRegs);
285 llvm::SmallBitVector IntegerRegistersI8(Traits::RegisterSet::Reg_NUM);
286 llvm::SmallBitVector FloatRegisters(Traits::RegisterSet::Reg_NUM);
287 llvm::SmallBitVector VectorRegisters(Traits::RegisterSet::Reg_NUM);
288 llvm::SmallBitVector InvalidRegisters(Traits::RegisterSet::Reg_NUM);
289 ScratchRegs.resize(Traits::RegisterSet::Reg_NUM);
290
291 Traits::initRegisterSet(&IntegerRegisters, &IntegerRegistersI8,
292 &FloatRegisters, &VectorRegisters, &ScratchRegs);
293
294 TypeToRegisterSet[IceType_void] = InvalidRegisters;
295 TypeToRegisterSet[IceType_i1] = IntegerRegistersI8;
296 TypeToRegisterSet[IceType_i8] = IntegerRegistersI8;
297 TypeToRegisterSet[IceType_i16] = IntegerRegisters;
298 TypeToRegisterSet[IceType_i32] = IntegerRegisters;
299 TypeToRegisterSet[IceType_i64] = IntegerRegisters;
300 TypeToRegisterSet[IceType_f32] = FloatRegisters;
301 TypeToRegisterSet[IceType_f64] = FloatRegisters;
302 TypeToRegisterSet[IceType_v4i1] = VectorRegisters;
303 TypeToRegisterSet[IceType_v8i1] = VectorRegisters;
304 TypeToRegisterSet[IceType_v16i1] = VectorRegisters;
305 TypeToRegisterSet[IceType_v16i8] = VectorRegisters;
306 TypeToRegisterSet[IceType_v8i16] = VectorRegisters;
307 TypeToRegisterSet[IceType_v4i32] = VectorRegisters;
308 TypeToRegisterSet[IceType_v4f32] = VectorRegisters;
309 } 285 }
310 286
311 template <class Machine> void TargetX86Base<Machine>::translateO2() { 287 template <class Machine> void TargetX86Base<Machine>::translateO2() {
312 TimerMarker T(TimerStack::TT_O2, Func); 288 TimerMarker T(TimerStack::TT_O2, Func);
313 289
314 if (!Ctx->getFlags().getPhiEdgeSplit()) { 290 if (!Ctx->getFlags().getPhiEdgeSplit()) {
315 // Lower Phi instructions. 291 // Lower Phi instructions.
316 Func->placePhiLoads(); 292 Func->placePhiLoads();
317 if (Func->hasError()) 293 if (Func->hasError())
318 return; 294 return;
(...skipping 5043 matching lines...) Expand 10 before | Expand all | Expand 10 after
5362 } 5338 }
5363 // the offset is not eligible for blinding or pooling, return the original 5339 // the offset is not eligible for blinding or pooling, return the original
5364 // mem operand 5340 // mem operand
5365 return MemOperand; 5341 return MemOperand;
5366 } 5342 }
5367 5343
5368 } // end of namespace X86Internal 5344 } // end of namespace X86Internal
5369 } // end of namespace Ice 5345 } // end of namespace Ice
5370 5346
5371 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H 5347 #endif // SUBZERO_SRC_ICETARGETLOWERINGX86BASEIMPL_H
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX86Base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698