[llvm] r185714 - ARM: Add a pack pattern for matching arithmetic shift right
Arnold Schwaighofer
aschwaighofer at apple.com
Fri Jul 5 11:57:49 PDT 2013
Author: arnolds
Date: Fri Jul 5 13:57:49 2013
New Revision: 185714
URL: http://llvm.org/viewvc/llvm-project?rev=185714&view=rev
Log:
ARM: Add a pack pattern for matching arithmetic shift right
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
llvm/trunk/test/CodeGen/ARM/pack.ll
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=185714&r1=185713&r2=185714&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Fri Jul 5 13:57:49 2013
@@ -4017,6 +4017,9 @@ def : ARMV6Pat<(or (and GPRnopc:$src1, 0
(srl GPRnopc:$src2, imm16:$sh)),
(PKHTB GPRnopc:$src1, GPRnopc:$src2, imm16:$sh)>;
def : ARMV6Pat<(or (and GPRnopc:$src1, 0xFFFF0000),
+ (sra GPRnopc:$src2, imm16_31:$sh)),
+ (PKHTB GPRnopc:$src1, GPRnopc:$src2, imm16_31:$sh)>;
+def : ARMV6Pat<(or (and GPRnopc:$src1, 0xFFFF0000),
(and (srl GPRnopc:$src2, imm1_15:$sh), 0xFFFF)),
(PKHTB GPRnopc:$src1, GPRnopc:$src2, imm1_15:$sh)>;
Modified: llvm/trunk/test/CodeGen/ARM/pack.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/pack.ll?rev=185714&r1=185713&r2=185714&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/pack.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/pack.ll Fri Jul 5 13:57:49 2013
@@ -99,3 +99,13 @@ entry:
%tmp3 = or i32 %tmp, %tmp2
ret i32 %tmp3
}
+
+; CHECK: test10:
+; CHECK: pkhtb r0, r0, r1, asr #17
+define i32 @test10(i32 %src1, i32 %src2) {
+entry:
+ %tmp = and i32 %src1, -65536
+ %tmp2 = ashr i32 %src2, 17
+ %tmp3 = or i32 %tmp, %tmp2
+ ret i32 %tmp3
+}
More information about the llvm-commits
mailing list