add size parameter to Assembler::returnLow since the register used depends on the return value size on PowerPC

This commit is contained in:
Joel Dice 2009-02-17 18:19:31 -07:00
parent c88e3fa230
commit 324caaf98b
4 changed files with 9 additions and 9 deletions

View File

@ -259,7 +259,7 @@ class Assembler {
virtual int stack() = 0; virtual int stack() = 0;
virtual int thread() = 0; virtual int thread() = 0;
virtual int returnLow() = 0; virtual int returnLow(unsigned size) = 0;
virtual int returnHigh() = 0; virtual int returnHigh() = 0;
virtual bool condensedAddressing() = 0; virtual bool condensedAddressing() = 0;

View File

@ -5713,7 +5713,7 @@ compileThunks(MyThread* t, Allocator* allocator, MyProcessor* p,
a->popFrame(); a->popFrame();
Assembler::Register result(t->arch->returnLow()); Assembler::Register result(t->arch->returnLow(BytesPerWord));
a->apply(Jump, BytesPerWord, RegisterOperand, &result); a->apply(Jump, BytesPerWord, RegisterOperand, &result);
a->endBlock(false)->resolve(0, 0); a->endBlock(false)->resolve(0, 0);

View File

@ -2322,7 +2322,7 @@ class CallEvent: public Event {
clean(c, this, stackBefore, localsBefore, reads, popIndex); clean(c, this, stackBefore, localsBefore, reads, popIndex);
if (resultSize and live(result)) { if (resultSize and live(result)) {
addSite(c, result, registerSite(c, c->arch->returnLow())); addSite(c, result, registerSite(c, c->arch->returnLow(resultSize)));
if (resultSize > BytesPerWord and live(result->high)) { if (resultSize > BytesPerWord and live(result->high)) {
addSite(c, result->high, registerSite(c, c->arch->returnHigh())); addSite(c, result->high, registerSite(c, c->arch->returnHigh()));
} }
@ -2357,7 +2357,7 @@ class ReturnEvent: public Event {
Event(c), value(value) Event(c), value(value)
{ {
if (value) { if (value) {
addRead(c, this, value, fixedRegisterRead(c, c->arch->returnLow())); addRead(c, this, value, fixedRegisterRead(c, c->arch->returnLow(size)));
if (size > BytesPerWord) { if (size > BytesPerWord) {
addRead(c, this, value->high, addRead(c, this, value->high,
fixedRegisterRead(c, c->arch->returnHigh())); fixedRegisterRead(c, c->arch->returnHigh()));

View File

@ -1997,10 +1997,14 @@ class MyArchitecture: public Assembler::Architecture {
return rbx; return rbx;
} }
virtual int returnLow() { virtual int returnLow(unsigned) {
return rax; return rax;
} }
virtual int returnHigh() {
return (BytesPerWord == 4 ? rdx : NoRegister);
}
virtual bool condensedAddressing() { virtual bool condensedAddressing() {
return true; return true;
} }
@ -2017,10 +2021,6 @@ class MyArchitecture: public Assembler::Architecture {
} }
} }
virtual int returnHigh() {
return (BytesPerWord == 4 ? rdx : NoRegister);
}
virtual unsigned argumentRegisterCount() { virtual unsigned argumentRegisterCount() {
return (BytesPerWord == 4 ? 0 : 6); return (BytesPerWord == 4 ? 0 : 6);
} }