[PATCH] D68999: [ARM] Extra qdadd patterns
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 15 10:20:28 PDT 2019
dmgreen created this revision.
dmgreen added reviewers: samparker, SjoerdMeijer, efriedma.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: LLVM.
This adds some new qdadd patterns to go along with the other recently added qadd's.
https://reviews.llvm.org/D68999
Files:
llvm/lib/Target/ARM/ARMInstrInfo.td
llvm/lib/Target/ARM/ARMInstrThumb2.td
llvm/test/CodeGen/ARM/qdadd.ll
Index: llvm/test/CodeGen/ARM/qdadd.ll
===================================================================
--- llvm/test/CodeGen/ARM/qdadd.ll
+++ llvm/test/CodeGen/ARM/qdadd.ll
@@ -36,14 +36,12 @@
;
; CHECK-T2DSP-LABEL: qdadd:
; CHECK-T2DSP: @ %bb.0:
-; CHECK-T2DSP-NEXT: qadd r0, r0, r0
-; CHECK-T2DSP-NEXT: qadd r0, r0, r1
+; CHECK-T2DSP-NEXT: qdadd r0, r0, r1
; CHECK-T2DSP-NEXT: bx lr
;
; CHECK-ARM-LABEL: qdadd:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM-NEXT: qadd r0, r0, r0
-; CHECK-ARM-NEXT: qadd r0, r0, r1
+; CHECK-ARM-NEXT: qdadd r0, r0, r1
; CHECK-ARM-NEXT: bx lr
%z = call i32 @llvm.sadd.sat.i32(i32 %x, i32 %x)
%tmp = call i32 @llvm.sadd.sat.i32(i32 %z, i32 %y)
@@ -82,14 +80,12 @@
;
; CHECK-T2DSP-LABEL: qdadd_c:
; CHECK-T2DSP: @ %bb.0:
-; CHECK-T2DSP-NEXT: qadd r0, r0, r0
-; CHECK-T2DSP-NEXT: qadd r0, r1, r0
+; CHECK-T2DSP-NEXT: qdadd r0, r0, r1
; CHECK-T2DSP-NEXT: bx lr
;
; CHECK-ARM-LABEL: qdadd_c:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM-NEXT: qadd r0, r0, r0
-; CHECK-ARM-NEXT: qadd r0, r1, r0
+; CHECK-ARM-NEXT: qdadd r0, r0, r1
; CHECK-ARM-NEXT: bx lr
%z = call i32 @llvm.sadd.sat.i32(i32 %x, i32 %x)
%tmp = call i32 @llvm.sadd.sat.i32(i32 %y, i32 %z)
@@ -128,14 +124,12 @@
;
; CHECK-T2DSP-LABEL: qdsub:
; CHECK-T2DSP: @ %bb.0:
-; CHECK-T2DSP-NEXT: qadd r0, r0, r0
-; CHECK-T2DSP-NEXT: qsub r0, r1, r0
+; CHECK-T2DSP-NEXT: qdsub r0, r1, r0
; CHECK-T2DSP-NEXT: bx lr
;
; CHECK-ARM-LABEL: qdsub:
; CHECK-ARM: @ %bb.0:
-; CHECK-ARM-NEXT: qadd r0, r0, r0
-; CHECK-ARM-NEXT: qsub r0, r1, r0
+; CHECK-ARM-NEXT: qdsub r0, r1, r0
; CHECK-ARM-NEXT: bx lr
%z = call i32 @llvm.sadd.sat.i32(i32 %x, i32 %x)
%tmp = call i32 @llvm.ssub.sat.i32(i32 %y, i32 %z)
Index: llvm/lib/Target/ARM/ARMInstrThumb2.td
===================================================================
--- llvm/lib/Target/ARM/ARMInstrThumb2.td
+++ llvm/lib/Target/ARM/ARMInstrThumb2.td
@@ -2399,6 +2399,10 @@
(t2QADD rGPR:$Rm, rGPR:$Rn)>;
def : Thumb2DSPPat<(ssubsat rGPR:$Rm, rGPR:$Rn),
(t2QSUB rGPR:$Rm, rGPR:$Rn)>;
+def : Thumb2DSPPat<(saddsat(saddsat rGPR:$Rm, rGPR:$Rm), rGPR:$Rn),
+ (t2QDADD rGPR:$Rm, rGPR:$Rn)>;
+def : Thumb2DSPPat<(ssubsat rGPR:$Rm, (saddsat rGPR:$Rn, rGPR:$Rn)),
+ (t2QDSUB rGPR:$Rm, rGPR:$Rn)>;
def : Thumb2DSPPat<(ARMqadd8b rGPR:$Rm, rGPR:$Rn),
(t2QADD8 rGPR:$Rm, rGPR:$Rn)>;
def : Thumb2DSPPat<(ARMqsub8b rGPR:$Rm, rGPR:$Rn),
Index: llvm/lib/Target/ARM/ARMInstrInfo.td
===================================================================
--- llvm/lib/Target/ARM/ARMInstrInfo.td
+++ llvm/lib/Target/ARM/ARMInstrInfo.td
@@ -3759,6 +3759,10 @@
(QADD GPR:$a, GPR:$b)>;
def : ARMV5TEPat<(ssubsat GPR:$a, GPR:$b),
(QSUB GPR:$a, GPR:$b)>;
+def : ARMV5TEPat<(saddsat(saddsat rGPR:$Rm, rGPR:$Rm), rGPR:$Rn),
+ (QDADD rGPR:$Rm, rGPR:$Rn)>;
+def : ARMV5TEPat<(ssubsat rGPR:$Rm, (saddsat rGPR:$Rn, rGPR:$Rn)),
+ (QDSUB rGPR:$Rm, rGPR:$Rn)>;
def : ARMV6Pat<(ARMqadd8b rGPR:$Rm, rGPR:$Rn),
(QADD8 rGPR:$Rm, rGPR:$Rn)>;
def : ARMV6Pat<(ARMqsub8b rGPR:$Rm, rGPR:$Rn),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68999.225069.patch
Type: text/x-patch
Size: 3286 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191015/0e500cdb/attachment.bin>
More information about the llvm-commits
mailing list