class v5 shadow rule test: the synthetic rotate cases follow the census arm (two rotl by one amount merge, a rotl and a rotr do not, two rotr by one register merge)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
7674ea4325
commit
bea3af3908
1 changed files with 6 additions and 2 deletions
|
|
@ -2017,8 +2017,12 @@ mod tests {
|
|||
assert_eq!(shadow_removable_count(&pair), 1, "the known-failed case: an xor-cancel pair");
|
||||
let broken = vec![mk(Op::Xor, 1, 2), mk(Op::Add, 2, 3), mk(Op::Xor, 1, 2)];
|
||||
assert_eq!(shadow_removable_count(&broken), 0, "the source moved between the two");
|
||||
let rot = vec![mk(Op::Rotl, 4, 0), mk(Op::Rotr, 4, 5)];
|
||||
assert_eq!(shadow_removable_count(&rot), 1, "two rotates merge");
|
||||
let rot = vec![mk(Op::Rotl, 4, 0), mk(Op::Rotl, 4, 0)];
|
||||
assert_eq!(shadow_removable_count(&rot), 1, "two rotl by one amount merge");
|
||||
let mixed = vec![mk(Op::Rotl, 4, 0), mk(Op::Rotr, 4, 5)];
|
||||
assert_eq!(shadow_removable_count(&mixed), 0, "a rotl and a rotr are two sources: not the census's merge");
|
||||
let rotr = vec![mk(Op::Rotr, 4, 5), mk(Op::Rotr, 4, 5)];
|
||||
assert_eq!(shadow_removable_count(&rotr), 1, "two rotr by one register merge");
|
||||
let sum = vec![mk(Op::Add, 6, 7), mk(Op::Sub, 6, 7)];
|
||||
assert_eq!(shadow_removable_count(&sum), 1, "sum-cancel");
|
||||
let mut bad = Vec::new();
|
||||
|
|
|
|||
Loading…
Reference in a new issue