mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +00:00
Don't trample on X before use.
This commit is contained in:
parent
8148397f62
commit
555250dbd9
@ -435,20 +435,22 @@ template <Operation operation, typename IntT, typename FlowController> void rox(
|
|||||||
} else {
|
} else {
|
||||||
switch(operation) {
|
switch(operation) {
|
||||||
case Operation::ROXLb: case Operation::ROXLw: case Operation::ROXLl:
|
case Operation::ROXLb: case Operation::ROXLw: case Operation::ROXLl:
|
||||||
status.carry_flag = status.extend_flag = Status::FlagT((destination >> (size - shift)) & 1);
|
status.carry_flag = Status::FlagT((destination >> (size - shift)) & 1);
|
||||||
destination = IntT(
|
destination = IntT(
|
||||||
(destination << shift) |
|
(destination << shift) |
|
||||||
(IntT(status.extend_flag ? 1 : 0) << (shift - 1)) |
|
(IntT(status.extend_flag ? 1 : 0) << (shift - 1)) |
|
||||||
(destination >> (size + 1 - shift))
|
(destination >> (size + 1 - shift))
|
||||||
);
|
);
|
||||||
|
status.extend_flag = status.carry_flag;
|
||||||
break;
|
break;
|
||||||
case Operation::ROXRb: case Operation::ROXRw: case Operation::ROXRl:
|
case Operation::ROXRb: case Operation::ROXRw: case Operation::ROXRl:
|
||||||
status.carry_flag = status.extend_flag = Status::FlagT(destination & (1 << (shift - 1)));
|
status.carry_flag = Status::FlagT(destination & (1 << (shift - 1)));
|
||||||
destination = IntT(
|
destination = IntT(
|
||||||
(destination >> shift) |
|
(destination >> shift) |
|
||||||
((status.extend_flag ? top_bit<IntT>() : 0) >> (shift - 1)) |
|
((status.extend_flag ? top_bit<IntT>() : 0) >> (shift - 1)) |
|
||||||
(destination << (size + 1 - shift))
|
(destination << (size + 1 - shift))
|
||||||
);
|
);
|
||||||
|
status.extend_flag = status.carry_flag;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user