From 514ea1ae1fc8a2e40c6b45966419c27e1f6aaaa2 Mon Sep 17 00:00:00 2001 From: xleroy Date: Thu, 24 Oct 2013 09:55:46 +0000 Subject: 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 --- powerpc/CombineOp.v | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'powerpc/CombineOp.v') 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 => -- cgit