mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-23 11:30:24 +00:00
Add TODO to self on undefined behaviour.
This commit is contained in:
parent
abb19e6670
commit
fb2b7969a2
@ -435,6 +435,13 @@ template <Operation operation, typename IntT, typename FlowController> void rox(
|
||||
// When shift is zero, extend is unaffected but is copied to carry.
|
||||
status.carry_flag = status.extend_flag;
|
||||
} else {
|
||||
// TODO: if the value of the right operand is negative or is greater or equal to
|
||||
// the number of bits in the promoted left operand, the behavior is undefined.
|
||||
//
|
||||
// i.e. for a long if shift >= 32,
|
||||
// or size + 1 - shift >= 32, i.e. 1 - shift >= 0, 1 >= shift; i.e. shift <= 1
|
||||
// ... the code below is undefined behaviour.
|
||||
|
||||
switch(operation) {
|
||||
case Operation::ROXLb: case Operation::ROXLw: case Operation::ROXLl:
|
||||
status.carry_flag = Status::FlagT((destination >> (size - shift)) & 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user