encourage loads from memory directly into SSE registers where appropriate

This commit is contained in:
Joel Dice 2009-11-30 02:17:08 +00:00
parent 1c61c1f421
commit 79d281f7fa
2 changed files with 13 additions and 3 deletions

View File

@ -3447,6 +3447,10 @@ maybeMove(Context* c, BinaryOperation type, unsigned srcSize,
c->arch->planSource(type, dstSize, &srcTypeMask, &srcRegisterMask, c->arch->planSource(type, dstSize, &srcTypeMask, &srcRegisterMask,
dstSize, &thunk); dstSize, &thunk);
if (src->type == ValueGeneral) {
srcRegisterMask &= c->arch->generalRegisterMask();
}
assert(c, thunk == 0); assert(c, thunk == 0);
assert(c, dstMask.typeMask & srcTypeMask & (1 << RegisterOperand)); assert(c, dstMask.typeMask & srcTypeMask & (1 << RegisterOperand));
@ -6013,7 +6017,7 @@ class MyCompiler: public Compiler {
virtual void push(unsigned footprint UNUSED) { virtual void push(unsigned footprint UNUSED) {
assert(&c, footprint == 1); assert(&c, footprint == 1);
Value* v = value(&c, ValueFloat); Value* v = value(&c, ValueGeneral);
Stack* s = local::stack(&c, v, c.stack); Stack* s = local::stack(&c, v, c.stack);
v->home = frameIndex(&c, s->index + c.localFootprint); v->home = frameIndex(&c, s->index + c.localFootprint);

View File

@ -946,6 +946,9 @@ void
sseMoveRR(Context* c, unsigned aSize, Assembler::Register* a, sseMoveRR(Context* c, unsigned aSize, Assembler::Register* a,
unsigned bSize UNUSED, Assembler::Register* b) unsigned bSize UNUSED, Assembler::Register* b)
{ {
assert(c, aSize >= 4);
assert(c, aSize == bSize);
if (floatReg(a) and floatReg(b)) { if (floatReg(a) and floatReg(b)) {
if (aSize == 4) { if (aSize == 4) {
opcode(c, 0xf3); opcode(c, 0xf3);
@ -1090,6 +1093,9 @@ void
sseMoveMR(Context* c, unsigned aSize, Assembler::Memory* a, sseMoveMR(Context* c, unsigned aSize, Assembler::Memory* a,
unsigned bSize UNUSED, Assembler::Register* b) unsigned bSize UNUSED, Assembler::Register* b)
{ {
assert(c, aSize >= 4);
assert(c, aSize == bSize);
if (BytesPerWord == 4 and aSize == 8) { if (BytesPerWord == 4 and aSize == 8) {
opcode(c, 0xf3); opcode(c, 0xf3);
opcode(c, 0x0f, 0x7e); opcode(c, 0x0f, 0x7e);
@ -1165,6 +1171,7 @@ void
sseMoveRM(Context* c, unsigned aSize, Assembler::Register* a, sseMoveRM(Context* c, unsigned aSize, Assembler::Register* a,
UNUSED unsigned bSize, Assembler::Memory* b) UNUSED unsigned bSize, Assembler::Memory* b)
{ {
assert(c, aSize >= 4);
assert(c, aSize == bSize); assert(c, aSize == bSize);
if (BytesPerWord == 4 and aSize == 8) { if (BytesPerWord == 4 and aSize == 8) {
@ -2942,8 +2949,7 @@ class MyArchitecture: public Assembler::Architecture {
case Move: case Move:
*aTypeMask = (1 << RegisterOperand) | (1 << MemoryOperand); *aTypeMask = (1 << RegisterOperand) | (1 << MemoryOperand);
*aRegisterMask = GeneralRegisterMask *aRegisterMask = ~static_cast<uint64_t>(0);
| (static_cast<uint64_t>(GeneralRegisterMask) << 32);
if (BytesPerWord == 4) { if (BytesPerWord == 4) {
if (aSize == 4 and bSize == 8) { if (aSize == 4 and bSize == 8) {