more floating point bugfixes

This commit is contained in:
Joel Dice 2009-12-01 02:06:01 +00:00
parent 7fa10909f4
commit 175cb8e89b
2 changed files with 20 additions and 15 deletions

View File

@ -2320,13 +2320,17 @@ acceptMatch(Context* c, Site* s, Read*, const SiteMask& mask)
Site* Site*
pickSourceSite(Context* c, Read* read, Site* target = 0, pickSourceSite(Context* c, Read* read, Site* target = 0,
unsigned* cost = 0, uint8_t typeMask = ~0, unsigned* cost = 0, SiteMask* extraMask = 0,
bool intersectRead = true, bool includeBuddies = true, bool intersectRead = true, bool includeBuddies = true,
bool includeNextWord = true, bool includeNextWord = true,
bool (*accept)(Context*, Site*, Read*, const SiteMask&) bool (*accept)(Context*, Site*, Read*, const SiteMask&)
= acceptMatch) = acceptMatch)
{ {
SiteMask mask(typeMask, ~0, AnyFrameIndex); SiteMask mask;
if (extraMask) {
mask = intersect(mask, *extraMask);
}
if (intersectRead) { if (intersectRead) {
read->intersect(&mask); read->intersect(&mask);
@ -2477,7 +2481,7 @@ pickSiteOrMove(Context* c, Read* read, bool intersectRead,
bool includeNextWord, unsigned registerReserveCount = 0) bool includeNextWord, unsigned registerReserveCount = 0)
{ {
Site* s = pickSourceSite Site* s = pickSourceSite
(c, read, 0, 0, ~0, intersectRead, true, includeNextWord); (c, read, 0, 0, 0, intersectRead, true, includeNextWord);
if (s) { if (s) {
return s; return s;
@ -3594,7 +3598,7 @@ pickSiteOrMove(Context* c, Value* src, Value* dst, Site* nextWord,
if (nextWord) { if (nextWord) {
s = pickMatchOrMove(c, read, nextWord, index, false); s = pickMatchOrMove(c, read, nextWord, index, false);
} else { } else {
s = pickSourceSite(c, read, 0, 0, ~0, false, true, true); s = pickSourceSite(c, read, 0, 0, 0, false, true, true);
if (s == 0 or s->isVolatile(c)) { if (s == 0 or s->isVolatile(c)) {
s = maybeMove(c, read, false, true); s = maybeMove(c, read, false, true);
@ -5270,13 +5274,14 @@ resolveSourceSites(Context* c, Event* e, SiteRecordList* frozen, Site** sites)
Read* r = live(v); Read* r = live(v);
if (r and sites[el.localIndex] == 0) { if (r and sites[el.localIndex] == 0) {
const uint32_t mask = (1 << RegisterOperand) | (1 << MemoryOperand); SiteMask mask((1 << RegisterOperand) | (1 << MemoryOperand),
c->arch->generalRegisterMask(), AnyFrameIndex);
Site* s = pickSourceSite Site* s = pickSourceSite
(c, r, 0, 0, mask, true, false, true, acceptForResolve); (c, r, 0, 0, &mask, true, false, true, acceptForResolve);
if (s == 0) { if (s == 0) {
s = pickSourceSite s = pickSourceSite
(c, r, 0, 0, mask, false, false, true, acceptForResolve); (c, r, 0, 0, &mask, false, false, true, acceptForResolve);
} }
if (s) { if (s) {
@ -5307,15 +5312,16 @@ resolveTargetSites(Context* c, Event* e, SiteRecordList* frozen, Site** sites)
Read* r = live(v); Read* r = live(v);
if (r and sites[el.localIndex] == 0) { if (r and sites[el.localIndex] == 0) {
const uint32_t mask = (1 << RegisterOperand) | (1 << MemoryOperand); SiteMask mask((1 << RegisterOperand) | (1 << MemoryOperand),
c->arch->generalRegisterMask(), AnyFrameIndex);
Site* s = pickSourceSite Site* s = pickSourceSite
(c, r, 0, 0, mask, true, true, true, acceptForResolve); (c, r, 0, 0, &mask, true, true, true, acceptForResolve);
if (s == 0) { if (s == 0) {
s = pickSourceSite s = pickSourceSite
(c, r, 0, 0, mask, false, true, true, acceptForResolve); (c, r, 0, 0, &mask, false, true, true, acceptForResolve);
if (s == 0) { if (s == 0) {
s = maybeMove(c, r, false, true, ResolveRegisterReserveCount); s = maybeMove(c, v, mask, false, true, ResolveRegisterReserveCount);
} }
} }

View File

@ -978,12 +978,12 @@ sseMoveRR(Context* c, unsigned aSize, Assembler::Register* a,
opcode(c, 0xf3); opcode(c, 0xf3);
maybeRex(c, 4, a, b); maybeRex(c, 4, a, b);
opcode(c, 0x0f, 0x10); opcode(c, 0x0f, 0x10);
modrm(c, 0xc0, b, a); modrm(c, 0xc0, a, b);
} else { } else {
opcode(c, 0xf2); opcode(c, 0xf2);
maybeRex(c, 4, a, b); maybeRex(c, 8, a, b);
opcode(c, 0x0f, 0x10); opcode(c, 0x0f, 0x10);
modrm(c, 0xc0, b, a); modrm(c, 0xc0, a, b);
} }
} else if (floatReg(a)) { } else if (floatReg(a)) {
opcode(c, 0x66); opcode(c, 0x66);
@ -1118,7 +1118,6 @@ 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 >= 4);
assert(c, aSize == bSize);
if (BytesPerWord == 4 and aSize == 8) { if (BytesPerWord == 4 and aSize == 8) {
opcode(c, 0xf3); opcode(c, 0xf3);