This commit is contained in:
Joel Dice 2009-09-26 19:43:44 +00:00
parent 325f93b4d1
commit 6cef085d7e
4 changed files with 376 additions and 299 deletions

View File

@ -115,6 +115,11 @@ enum OperandType {
MemoryOperand MemoryOperand
}; };
enum ValueType {
ValueGeneral,
ValueFloat
};
const unsigned OperandTypeCount = MemoryOperand + 1; const unsigned OperandTypeCount = MemoryOperand + 1;
const int NoRegister = -1; const int NoRegister = -1;
@ -292,12 +297,10 @@ class Assembler {
class Architecture { class Architecture {
public: public:
virtual unsigned registerCount() = 0; virtual unsigned floatRegisterSize() = 0;
virtual unsigned generalRegisterCount() = 0;
virtual unsigned floatRegisterCount() = 0; virtual uint32_t generalRegisterMask() = 0;
virtual uint64_t generalRegisters() = 0; virtual uint32_t floatRegisterMask() = 0;
virtual uint64_t floatRegisters() = 0;
virtual uint64_t allRegisters() = 0;
virtual int stack() = 0; virtual int stack() = 0;
virtual int thread() = 0; virtual int thread() = 0;
@ -307,6 +310,8 @@ class Assembler {
virtual int virtualCallIndex() = 0; virtual int virtualCallIndex() = 0;
virtual bool bigEndian() = 0; virtual bool bigEndian() = 0;
virtual unsigned registerSize(ValueType type) = 0;
virtual bool supportsFloatCompare(unsigned size) = 0; virtual bool supportsFloatCompare(unsigned size) = 0;

View File

@ -34,7 +34,7 @@ namespace {
namespace local { namespace local {
const bool DebugCompile = false; const bool DebugCompile = true;
const bool DebugNatives = false; const bool DebugNatives = false;
const bool DebugCallTable = false; const bool DebugCallTable = false;
const bool DebugMethodTree = false; const bool DebugMethodTree = false;
@ -5353,19 +5353,17 @@ finish(MyThread* t, Allocator* allocator, Context* context)
(&byteArrayBody(t, methodSpec(t, context->method), 0))); (&byteArrayBody(t, methodSpec(t, context->method), 0)));
// for debugging: // for debugging:
if (false and if (//false and
::strcmp ::strcmp
(reinterpret_cast<const char*> (reinterpret_cast<const char*>
(&byteArrayBody(t, className(t, methodClass(t, context->method)), 0)), (&byteArrayBody(t, className(t, methodClass(t, context->method)), 0)),
"java/lang/Throwable") == 0 and "AllFloats") == 0 and
::strcmp ::strcmp
(reinterpret_cast<const char*> (reinterpret_cast<const char*>
(&byteArrayBody(t, methodName(t, context->method), 0)), (&byteArrayBody(t, methodName(t, context->method), 0)),
"write") == 0) "multiplyByFive") == 0)
{ {
trap(); trap();
fprintf(stderr, "Address: %p\n",
::vmAddressFromLine(t, (object)(context->method), 1176));
} }
syncInstructionCache(start, codeSize); syncInstructionCache(start, codeSize);

File diff suppressed because it is too large Load Diff

View File

@ -2505,38 +2505,21 @@ class MyArchitecture: public Assembler::Architecture {
populateTables(&c); populateTables(&c);
} }
virtual unsigned registerCount() { virtual unsigned floatRegisterSize() {
if (supportsSSE()) { if (supportsSSE()) {
return BytesPerWord == 4 ? 24 : 32; return 8;
} else {
return BytesPerWord == 4 ? 8 : 16;
}
}
virtual unsigned generalRegisterCount() {
return BytesPerWord == 4 ? 8 : 16;
}
virtual unsigned floatRegisterCount() {
if (supportsSSE()) {
return BytesPerWord == 4 ? 8 : 16;
} else { } else {
return 0; return 0;
} }
} }
virtual uint64_t generalRegisters() { virtual uint32_t generalRegisterMask() {
return GeneralRegisterMask; return GeneralRegisterMask;
} }
virtual uint64_t floatRegisters() { virtual uint32_t floatRegisterMask() {
return supportsSSE() ? FloatRegisterMask : 0; return supportsSSE() ? FloatRegisterMask : 0;
} }
virtual uint64_t allRegisters() {
return generalRegisters() | floatRegisters();
}
virtual int stack() { virtual int stack() {
return rsp; return rsp;
@ -2566,6 +2549,14 @@ class MyArchitecture: public Assembler::Architecture {
return false; return false;
} }
virtual unsigned registerSize(ValueType type) {
switch (type) {
case ValueGeneral: return BytesPerWord;
case ValueFloat: return 8;
default: abort(&c);
}
}
virtual bool reserved(int register_) { virtual bool reserved(int register_) {
switch (register_) { switch (register_) {
case rbp: case rbp:
@ -2993,8 +2984,12 @@ class MyArchitecture: public Assembler::Architecture {
if (supportsSSE()) { if (supportsSSE()) {
*aTypeMask = (1 << RegisterOperand) | (1 << MemoryOperand); *aTypeMask = (1 << RegisterOperand) | (1 << MemoryOperand);
*bTypeMask = (1 << RegisterOperand); *bTypeMask = (1 << RegisterOperand);
*aRegisterMask = FloatRegisterMask;
*bRegisterMask = FloatRegisterMask; const uint64_t mask
= (static_cast<uint64_t>(FloatRegisterMask) << 32)
| FloatRegisterMask;
*aRegisterMask = mask;
*bRegisterMask = mask;
} else { } else {
*thunk = true; *thunk = true;
} }