aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/CombineOp.v
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-10-24 09:55:46 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-10-24 09:55:46 +0000
commit514ea1ae1fc8a2e40c6b45966419c27e1f6aaaa2 (patch)
tree316890c56bb24e2493253629c590a7efab6684f7 /powerpc/CombineOp.v
parentbf40c619812888bd1505a0c3e12f215090c430c7 (diff)
downloadcompcert-kvx-514ea1ae1fc8a2e40c6b45966419c27e1f6aaaa2.tar.gz
compcert-kvx-514ea1ae1fc8a2e40c6b45966419c27e1f6aaaa2.zip
Fine-tuning of the "andimm" case to generate a move rather than an andimm when possible.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2348 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
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 b92e045e..5cb76308 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 =>