summaryrefslogtreecommitdiff
path: root/powerpc/CombineOp.v
diff options
context:
space:
mode:
Diffstat (limited to 'powerpc/CombineOp.v')
-rw-r--r--powerpc/CombineOp.v8
1 files changed, 6 insertions, 2 deletions
diff --git a/powerpc/CombineOp.v b/powerpc/CombineOp.v
index b92e045..5cb7630 100644
--- a/powerpc/CombineOp.v
+++ b/powerpc/CombineOp.v
@@ -101,8 +101,12 @@ Function combine_op (op: operation) (args: list valnum) : option(operation * lis
end
| Oandimm n, x :: nil =>
match get x with
- | Some(Op (Oandimm m) ys) => Some(Oandimm (Int.and m n), ys)
- | Some(Op (Orolm amount m) ys) => Some(Orolm amount (Int.and m n), ys)
+ | Some(Op (Oandimm m) ys) =>
+ Some(let p := Int.and m n in
+ if Int.eq p m then (Omove, x :: nil) else (Oandimm p, ys))
+ | Some(Op (Orolm amount m) ys) =>
+ Some(let p := Int.and m n in
+ if Int.eq p m then (Omove, x :: nil) else (Orolm amount p, ys))
| _ => None
end
| Oorimm n, x :: nil =>