summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/x86/ArchUtility.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-10-30 15:48:42 -0700
committer buzbee <buzbee@google.com> 2012-11-01 12:05:35 -0700
commitb046e16d8b8da318d6055f9308950131f1255e08 (patch)
treed4472622967d02fcc87bb422bddea9a9140c75f9 /src/compiler/codegen/x86/ArchUtility.cc
parent6e30145f1ed992be8d4e5a9973410c19f3de59f9 (diff)
Remove all TARGET_[ARM|X86|MIPS] #ifdefs
Two steps forward, one step back towards elimination of the "#include" build model for target-specific compilers. This CL does some restructuring to eliminate all of the TARGET_xxx #ifdefs and convert them to run-time tests. Considerable work is still required to fully eliminate the multiple builds. In particular, much of the "common" codegen code relies on macros defined by the target-specific [Arm|X86|Mips]Lir.h include file. Next step is more restructuring to better isolate target-independent code generation code. Change-Id: If6efbde65c48031a48423344d8dc3e2ff2c4ad9d
Diffstat (limited to 'src/compiler/codegen/x86/ArchUtility.cc')
-rw-r--r--src/compiler/codegen/x86/ArchUtility.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/compiler/codegen/x86/ArchUtility.cc b/src/compiler/codegen/x86/ArchUtility.cc
index 4e75ef2a70..4c28b35e03 100644
--- a/src/compiler/codegen/x86/ArchUtility.cc
+++ b/src/compiler/codegen/x86/ArchUtility.cc
@@ -22,6 +22,32 @@
namespace art {
+void setupTargetResourceMasks(CompilationUnit* cUnit, LIR* lir)
+{
+ DCHECK_EQ(cUnit->instructionSet, kX86);
+
+ // X86-specific resource map setup here.
+ int flags = EncodingMap[lir->opcode].flags;
+ if (flags & REG_DEFA) {
+ oatSetupRegMask(cUnit, &lir->defMask, rAX);
+ }
+
+ if (flags & REG_DEFD) {
+ oatSetupRegMask(cUnit, &lir->defMask, rDX);
+ }
+ if (flags & REG_USEA) {
+ oatSetupRegMask(cUnit, &lir->useMask, rAX);
+ }
+
+ if (flags & REG_USEC) {
+ oatSetupRegMask(cUnit, &lir->useMask, rCX);
+ }
+
+ if (flags & REG_USED) {
+ oatSetupRegMask(cUnit, &lir->useMask, rDX);
+ }
+}
+
/* For dumping instructions */
static const char* x86RegName[] = {
"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",