Skip to content

Commit

Permalink
The mask used when modifying a certain range of bits of a value was c…
Browse files Browse the repository at this point in the history
…learing out the bits that didn't need to be modified and perserving those that needed to be. Fixed to use the invert of this as the actual mask.

Additionally, the 'imm' and 'bit_pos' variables correspond to the second, and not the first, operand in the operand list.
  • Loading branch information
ssunny7 committed Oct 4, 2016
1 parent 3a8715b commit 16295d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dataflowAPI/rose/semantics/DispatcherARM64.C
Expand Up @@ -501,11 +501,11 @@ namespace rose {

if ((EXTR (31, 31) == 1)) {
base =
ops->or_(ops->and_(base, ops->number_(12, 0xfff)),
ops->or_(ops->and_(base, ops->number_(64, 0xfffffffffffff000)),
d->Zeros(12));
}

d->write(args[0], ops->add(base, d->read(args[0])));
d->write(args[0], ops->add(base, d->read(args[1])));
}
};

Expand All @@ -516,11 +516,11 @@ namespace rose {

if ((EXTR (31, 31) == 1)) {
base =
ops->or_(ops->and_(base, ops->number_(12, 0xfff)),
ops->or_(ops->and_(base, ops->number_(64, 0xfffffffffffff000)),
d->Zeros(12));
}

d->write(args[0], ops->add(base, d->read(args[0])));
d->write(args[0], ops->add(base, d->read(args[1])));
}
};

Expand Down Expand Up @@ -606,7 +606,7 @@ namespace rose {

BaseSemantics::SValuePtr operand = d->read(args[0]);
d->BranchTo(ops->ite(ops->isEqual(
ops->and_(ops->shiftRight(operand, d->read(args[0])), ops->number_(1, 1)),
ops->and_(ops->shiftRight(operand, d->read(args[1])), ops->number_(1, 1)),
ops->number_(1, EXTR (24, 24))),
d->read(args[2]), d->readRegister(d->REG_PC)));
}
Expand All @@ -617,7 +617,7 @@ namespace rose {

BaseSemantics::SValuePtr operand = d->read(args[0]);
d->BranchTo(ops->ite(ops->isEqual(
ops->and_(ops->shiftRight(operand, d->read(args[0])), ops->number_(1, 1)),
ops->and_(ops->shiftRight(operand, d->read(args[1])), ops->number_(1, 1)),
ops->number_(1, EXTR (24, 24))),
d->read(args[2]), d->readRegister(d->REG_PC)));
}
Expand Down

0 comments on commit 16295d1

Please sign in to comment.