mirror of
https://github.com/corda/corda.git
synced 2025-06-05 09:00:53 +00:00
fix 4-to-8 byte sign extensions for ia32 and clean up MoveEvent; all tests now pass on ia32
This commit is contained in:
parent
acfd9689b2
commit
191bfb6141
@ -2446,6 +2446,21 @@ maybePreserve(Context* c, Stack* stack, Local* locals, unsigned size,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
addBuddy(Value* original, Value* buddy)
|
||||||
|
{
|
||||||
|
buddy->buddy = original;
|
||||||
|
Value* p = original;
|
||||||
|
while (p->buddy != original) p = p->buddy;
|
||||||
|
p->buddy = buddy;
|
||||||
|
|
||||||
|
// fprintf(stderr, "add buddy %p to", buddy);
|
||||||
|
// for (Value* p = buddy->buddy; p != buddy; p = p->buddy) {
|
||||||
|
// fprintf(stderr, " %p", p);
|
||||||
|
// }
|
||||||
|
// fprintf(stderr, "\n");
|
||||||
|
}
|
||||||
|
|
||||||
class MoveEvent: public Event {
|
class MoveEvent: public Event {
|
||||||
public:
|
public:
|
||||||
MoveEvent(Context* c, BinaryOperation type, unsigned srcSize, Value* src,
|
MoveEvent(Context* c, BinaryOperation type, unsigned srcSize, Value* src,
|
||||||
@ -2465,8 +2480,15 @@ class MoveEvent: public Event {
|
|||||||
|
|
||||||
Site* target = targetOrRegister(c, dst);
|
Site* target = targetOrRegister(c, dst);
|
||||||
unsigned cost = src->source->copyCost(c, target);
|
unsigned cost = src->source->copyCost(c, target);
|
||||||
|
|
||||||
|
if (srcSize != dstSize) cost = 1;
|
||||||
|
|
||||||
if (cost == 0) {
|
if (cost == 0) {
|
||||||
target = src->source;
|
target = src->source;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target == src->source) {
|
||||||
|
addBuddy(src, dst);
|
||||||
|
|
||||||
if (DebugMoves) {
|
if (DebugMoves) {
|
||||||
char dstb[256]; target->toString(c, dstb, 256);
|
char dstb[256]; target->toString(c, dstb, 256);
|
||||||
@ -2474,16 +2496,11 @@ class MoveEvent: public Event {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target == src->source) {
|
|
||||||
maybePreserve(c, stackBefore, localsBefore, srcSize, src, target);
|
|
||||||
removeSite(c, src, target);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (not isStore) {
|
if (not isStore) {
|
||||||
addSite(c, stackBefore, localsBefore, dstSize, dst, target);
|
addSite(c, stackBefore, localsBefore, dstSize, dst, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cost or srcSize != dstSize) {
|
if (cost) {
|
||||||
uint8_t typeMask = ~static_cast<uint8_t>(0);
|
uint8_t typeMask = ~static_cast<uint8_t>(0);
|
||||||
uint64_t registerMask = ~static_cast<uint64_t>(0);
|
uint64_t registerMask = ~static_cast<uint64_t>(0);
|
||||||
int frameIndex = AnyFrameIndex;
|
int frameIndex = AnyFrameIndex;
|
||||||
@ -3287,16 +3304,7 @@ class BuddyEvent: public Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void compile(Context* c) {
|
virtual void compile(Context* c) {
|
||||||
buddy->buddy = original;
|
addBuddy(original, buddy);
|
||||||
Value* p = original;
|
|
||||||
while (p->buddy != original) p = p->buddy;
|
|
||||||
p->buddy = buddy;
|
|
||||||
|
|
||||||
// fprintf(stderr, "add buddy %p to", buddy);
|
|
||||||
// for (Value* p = buddy->buddy; p != buddy; p = p->buddy) {
|
|
||||||
// fprintf(stderr, " %p", p);
|
|
||||||
// }
|
|
||||||
// fprintf(stderr, "\n");
|
|
||||||
|
|
||||||
nextRead(c, this, original);
|
nextRead(c, this, original);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user