Add a basic enum for ARM InstructionSet / cpu features.
That way, we don't have to use -mattr=sse2 for ARM in
cross tests, etc.
Default to NEON for now. Also put in an entry for HW
divide in ARM mode. There's bunches of features that are
possible though, e.g.,:
https://github.com/llvm-mirror/llvm/blob/master/lib/Target/ARM/ARM.td
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/1191573003.
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index dbb4e4a..b686579 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -395,16 +395,20 @@
}
TargetX8632::TargetX8632(Cfg *Func)
- : TargetLowering(Func),
- InstructionSet(static_cast<X86InstructionSet>(
- Func->getContext()->getFlags().getTargetInstructionSet() -
- TargetInstructionSet::X86InstructionSet_Begin)),
+ : TargetLowering(Func), InstructionSet(X86InstructionSet::Begin),
IsEbpBasedFrame(false), NeedsStackAlignment(false),
SpillAreaSizeBytes(0) {
static_assert((X86InstructionSet::End - X86InstructionSet::Begin) ==
(TargetInstructionSet::X86InstructionSet_End -
TargetInstructionSet::X86InstructionSet_Begin),
"X86InstructionSet range different from TargetInstructionSet");
+ if (Func->getContext()->getFlags().getTargetInstructionSet() !=
+ TargetInstructionSet::BaseInstructionSet) {
+ InstructionSet = static_cast<X86InstructionSet>(
+ (Func->getContext()->getFlags().getTargetInstructionSet() -
+ TargetInstructionSet::X86InstructionSet_Begin) +
+ X86InstructionSet::Begin);
+ }
// TODO: Don't initialize IntegerRegisters and friends every time.
// Instead, initialize in some sort of static initializer for the
// class.