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

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: comment 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
Index: src/IceTargetLoweringARM32.cpp
diff --git a/src/IceTargetLoweringARM32.cpp b/src/IceTargetLoweringARM32.cpp
index a2091b22c74e60b4a3e6b153d4f89b5b9267ff56..41cef911e8aa364ad23215f3bbd4819997eb4729 100644
--- a/src/IceTargetLoweringARM32.cpp
+++ b/src/IceTargetLoweringARM32.cpp
@@ -135,8 +135,20 @@ 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);
+ }
// TODO: Don't initialize IntegerRegisters and friends every time.
// Instead, initialize in some sort of static initializer for the
// class.

Powered by Google App Engine
This is Rietveld 408576698