summaryrefslogtreecommitdiff
path: root/compiler/optimizing/common_arm.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/common_arm.h')
-rw-r--r--compiler/optimizing/common_arm.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/optimizing/common_arm.h b/compiler/optimizing/common_arm.h
index ecb86875d6..e184745520 100644
--- a/compiler/optimizing/common_arm.h
+++ b/compiler/optimizing/common_arm.h
@@ -17,6 +17,7 @@
#ifndef ART_COMPILER_OPTIMIZING_COMMON_ARM_H_
#define ART_COMPILER_OPTIMIZING_COMMON_ARM_H_
+#include "instruction_simplifier_shared.h"
#include "debug/dwarf/register.h"
#include "locations.h"
#include "nodes.h"
@@ -29,6 +30,9 @@
#pragma GCC diagnostic pop
namespace art {
+
+using helpers::HasShifterOperand;
+
namespace arm {
namespace helpers {
@@ -218,6 +222,14 @@ inline Location LocationFrom(const vixl::aarch32::SRegister& low,
return Location::FpuRegisterPairLocation(low.GetCode(), high.GetCode());
}
+inline bool ShifterOperandSupportsExtension(HInstruction* instruction) {
+ DCHECK(HasShifterOperand(instruction, kArm));
+ // TODO: HAdd applied to the other integral types could make use of
+ // the SXTAB, SXTAH, UXTAB and UXTAH instructions.
+ return instruction->GetType() == Primitive::kPrimLong &&
+ (instruction->IsAdd() || instruction->IsSub());
+}
+
} // namespace helpers
} // namespace arm
} // namespace art