aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86InstrInfo.td
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-01-19 01:56:29 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-01-19 01:56:29 +0000
commit68b951a5e5c8e3e36fd64af3c56a5d2b53d1bfaf (patch)
treef317056094a8ae62e5f161004ec5a47f6058a6d9 /lib/Target/X86/X86InstrInfo.td
parentb4ad33c4aedc124f956ff6866fc73db14be534ee (diff)
downloadexternal_llvm-68b951a5e5c8e3e36fd64af3c56a5d2b53d1bfaf.zip
external_llvm-68b951a5e5c8e3e36fd64af3c56a5d2b53d1bfaf.tar.gz
external_llvm-68b951a5e5c8e3e36fd64af3c56a5d2b53d1bfaf.tar.bz2
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
Diffstat (limited to 'lib/Target/X86/X86InstrInfo.td')
-rw-r--r--lib/Target/X86/X86InstrInfo.td10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td
index 958aa09..741e7d1 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)>;