aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/arm/Ralloc.h
diff options
context:
space:
mode:
authorBill Buzbee <buzbee@google.com>2010-07-07 06:55:56 -0700
committerBill Buzbee <buzbee@google.com>2010-07-07 11:23:29 -0700
commit749e8162846b9dec5418d4d8f2334e683af81d52 (patch)
tree8706998c3e7539daeecbffc5fc353803e007bfff /vm/compiler/codegen/arm/Ralloc.h
parent41f27a080e89d995e3475bc837eaddcb5048a854 (diff)
JIT: Fix for 2813841, use core regs for sub-word data
In an attempt to avoid unnecessary register copies, the JIT allows data items to live in either floating point or core registers until an instruction is used which requires one or the other. The bug here was that sub-word data was allowed to live in floating point registers at the point of a load or store. This cl forces the use of core registers in those cases. Change-Id: I60c2a0d1df9a299f6c5130371f44f2be9c348ded
Diffstat (limited to 'vm/compiler/codegen/arm/Ralloc.h')
-rw-r--r--vm/compiler/codegen/arm/Ralloc.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/vm/compiler/codegen/arm/Ralloc.h b/vm/compiler/codegen/arm/Ralloc.h
index 6c7dfaaae..cc3e60587 100644
--- a/vm/compiler/codegen/arm/Ralloc.h
+++ b/vm/compiler/codegen/arm/Ralloc.h
@@ -27,6 +27,20 @@
#include "compiler/Dataflow.h"
#include "compiler/codegen/arm/ArmLIR.h"
+/*
+ * Return most flexible allowed register class based on size.
+ * Bug: 2813841
+ * Must use a core register for data types narrower than word (due
+ * to possible unaligned load/store.
+ */
+static inline RegisterClass dvmCompilerRegClassBySize(OpSize size)
+{
+ return (size == kUnsignedHalf ||
+ size == kSignedHalf ||
+ size == kUnsignedByte ||
+ size == kSignedByte ) ? kCoreReg : kAnyReg;
+}
+
static inline int dvmCompilerS2VReg(CompilationUnit *cUnit, int sReg)
{
assert(sReg != INVALID_SREG);