From d2b9858f3f5e013bbd9d2221c8d1a3d2960665be Mon Sep 17 00:00:00 2001 From: xleroy Date: Sat, 21 Jan 2012 16:11:50 +0000 Subject: powerpc/SelectOp: optimize the pattern ((x >>s N) & N1) & N2 common in a certain customer's code backend/Coloringaux: avoid spilling the dummy result registers for built-ins that have no result. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1799 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- powerpc/SelectOp.vp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'powerpc/SelectOp.vp') diff --git a/powerpc/SelectOp.vp b/powerpc/SelectOp.vp index 40c9011..3bb5544 100644 --- a/powerpc/SelectOp.vp +++ b/powerpc/SelectOp.vp @@ -210,6 +210,13 @@ Nondetfunction andimm (n1: int) (e2: expr) := match e2 with | Eop (Ointconst n2) Enil => Eop (Ointconst (Int.and n1 n2)) Enil + | Eop (Oandimm n2) (Eop (Oshrimm amount) (t2:::Enil) ::: Enil) => + let n := Int.and n1 n2 in + if Int.eq (Int.shru (Int.shl n amount) amount) n + && Int.ltu amount Int.iwordsize + then rolm t2 (Int.sub Int.iwordsize amount) + (Int.and (Int.shru Int.mone amount) n) + else Eop (Oandimm n) (Eop (Oshrimm amount) (t2:::Enil) ::: Enil) | Eop (Oandimm n2) (t2:::Enil) => Eop (Oandimm (Int.and n1 n2)) (t2:::Enil) | Eop (Orolm amount2 mask2) (t2:::Enil) => -- cgit v1.2.3