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

Unified Diff: src/IceTargetLoweringARM32.cpp

Issue 1191573003: Add a basic enum for ARM InstructionSet / cpu features. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: plus begin Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTargetLoweringARM32.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringARM32.cpp
diff --git a/src/IceTargetLoweringARM32.cpp b/src/IceTargetLoweringARM32.cpp
index a4aa51794f03882f5e96d4d4c646693224cb4f79..2d3c5c1f50285a3de17f5193f78beff965efb585 100644
--- a/src/IceTargetLoweringARM32.cpp
+++ b/src/IceTargetLoweringARM32.cpp
@@ -135,8 +135,21 @@ uint32_t applyStackAlignment(uint32_t Value) {
} // end of anonymous namespace
TargetARM32::TargetARM32(Cfg *Func)
- : TargetLowering(Func), UsesFramePointer(false), NeedsStackAlignment(false),
- MaybeLeafFunc(true), SpillAreaSizeBytes(0) {
+ : TargetLowering(Func), InstructionSet(ARM32InstructionSet::Begin),
+ UsesFramePointer(false), NeedsStackAlignment(false), MaybeLeafFunc(true),
+ SpillAreaSizeBytes(0) {
+ static_assert(
+ (ARM32InstructionSet::End - ARM32InstructionSet::Begin) ==
+ (TargetInstructionSet::ARM32InstructionSet_End -
+ TargetInstructionSet::ARM32InstructionSet_Begin),
+ "ARM32InstructionSet range different from TargetInstructionSet");
+ if (Func->getContext()->getFlags().getTargetInstructionSet() !=
+ TargetInstructionSet::BaseInstructionSet) {
+ InstructionSet = static_cast<ARM32InstructionSet>(
+ (Func->getContext()->getFlags().getTargetInstructionSet() -
+ TargetInstructionSet::ARM32InstructionSet_Begin) +
+ ARM32InstructionSet::Begin);
+ }
// TODO: Don't initialize IntegerRegisters and friends every time.
// Instead, initialize in some sort of static initializer for the
// class.
« no previous file with comments | « src/IceTargetLoweringARM32.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698