aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 958aa098c1..741e7d1781 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)>;