From: Evan Cheng Date: Thu, 19 Jan 2006 01:56:29 +0000 (+0000) Subject: Two peepholes: X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=68b951a5e5c8e3e36fd64af3c56a5d2b53d1bfaf;p=oota-llvm.git Two peepholes: (or (x >> c) | (y << (32 - c))) ==> (shrd x, y, c) (or (x << c) | (y >> (32 - c))) ==> (shld x, y, c) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25438 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td index 958aa098c10..741e7d17812 100644 --- a/lib/Target/X86/X86InstrInfo.td +++ b/lib/Target/X86/X86InstrInfo.td @@ -3066,3 +3066,13 @@ def : Pat<(f64 (undef)), (FpLD0)>, Requires<[FPStack]>; def : Pat<(shl R8 :$src1, (i8 1)), (ADD8rr R8 :$src1, R8 :$src1)>; def : Pat<(shl R16:$src1, (i8 1)), (ADD16rr R16:$src1, R16:$src1)>; def : Pat<(shl R32:$src1, (i8 1)), (ADD32rr R32:$src1, R32:$src1)>; + +// (or (x >> c) | (y << (32 - c))) ==> (shrd x, y, c) +def : Pat<(or (srl R32:$src1, CL:$amt), + (shl R32:$src2, (sub 32, CL:$amt))), + (SHRD32rrCL R32:$src1, R32:$src2)>; + +// (or (x << c) | (y >> (32 - c))) ==> (shld x, y, c) +def : Pat<(or (shl R32:$src1, CL:$amt), + (srl R32:$src2, (sub 32, CL:$amt))), + (SHLD32rrCL R32:$src1, R32:$src2)>;