llvm.org GIT mirror llvm / 8c479ef
[ARM] Extra qdadd patterns This adds some new qdadd patterns to go along with the other recently added qadd's. Differential Revision: https://reviews.llvm.org/D68999 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375414 91177308-0d34-0410-b5e6-96231b3b80d8 David Green 1 year, 1 month ago
3 changed file(s) with 14 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
37583758 (QADD GPR:$a, GPR:$b)>;
37593759 def : ARMV5TEPat<(ssubsat GPR:$a, GPR:$b),
37603760 (QSUB GPR:$a, GPR:$b)>;
3761 def : ARMV5TEPat<(saddsat(saddsat rGPR:$Rm, rGPR:$Rm), rGPR:$Rn),
3762 (QDADD rGPR:$Rm, rGPR:$Rn)>;
3763 def : ARMV5TEPat<(ssubsat rGPR:$Rm, (saddsat rGPR:$Rn, rGPR:$Rn)),
3764 (QDSUB rGPR:$Rm, rGPR:$Rn)>;
37613765 def : ARMV6Pat<(ARMqadd8b rGPR:$Rm, rGPR:$Rn),
37623766 (QADD8 rGPR:$Rm, rGPR:$Rn)>;
37633767 def : ARMV6Pat<(ARMqsub8b rGPR:$Rm, rGPR:$Rn),
23982398 (t2QADD rGPR:$Rm, rGPR:$Rn)>;
23992399 def : Thumb2DSPPat<(ssubsat rGPR:$Rm, rGPR:$Rn),
24002400 (t2QSUB rGPR:$Rm, rGPR:$Rn)>;
2401 def : Thumb2DSPPat<(saddsat(saddsat rGPR:$Rm, rGPR:$Rm), rGPR:$Rn),
2402 (t2QDADD rGPR:$Rm, rGPR:$Rn)>;
2403 def : Thumb2DSPPat<(ssubsat rGPR:$Rm, (saddsat rGPR:$Rn, rGPR:$Rn)),
2404 (t2QDSUB rGPR:$Rm, rGPR:$Rn)>;
24012405 def : Thumb2DSPPat<(ARMqadd8b rGPR:$Rm, rGPR:$Rn),
24022406 (t2QADD8 rGPR:$Rm, rGPR:$Rn)>;
24032407 def : Thumb2DSPPat<(ARMqsub8b rGPR:$Rm, rGPR:$Rn),
3535 ;
3636 ; CHECK-T2DSP-LABEL: qdadd:
3737 ; CHECK-T2DSP: @ %bb.0:
38 ; CHECK-T2DSP-NEXT: qadd r0, r0, r0
39 ; CHECK-T2DSP-NEXT: qadd r0, r0, r1
38 ; CHECK-T2DSP-NEXT: qdadd r0, r0, r1
4039 ; CHECK-T2DSP-NEXT: bx lr
4140 ;
4241 ; CHECK-ARM-LABEL: qdadd:
4342 ; CHECK-ARM: @ %bb.0:
44 ; CHECK-ARM-NEXT: qadd r0, r0, r0
45 ; CHECK-ARM-NEXT: qadd r0, r0, r1
43 ; CHECK-ARM-NEXT: qdadd r0, r0, r1
4644 ; CHECK-ARM-NEXT: bx lr
4745 %z = call i32 @llvm.sadd.sat.i32(i32 %x, i32 %x)
4846 %tmp = call i32 @llvm.sadd.sat.i32(i32 %z, i32 %y)
8179 ;
8280 ; CHECK-T2DSP-LABEL: qdadd_c:
8381 ; CHECK-T2DSP: @ %bb.0:
84 ; CHECK-T2DSP-NEXT: qadd r0, r0, r0
85 ; CHECK-T2DSP-NEXT: qadd r0, r1, r0
82 ; CHECK-T2DSP-NEXT: qdadd r0, r0, r1
8683 ; CHECK-T2DSP-NEXT: bx lr
8784 ;
8885 ; CHECK-ARM-LABEL: qdadd_c:
8986 ; CHECK-ARM: @ %bb.0:
90 ; CHECK-ARM-NEXT: qadd r0, r0, r0
91 ; CHECK-ARM-NEXT: qadd r0, r1, r0
87 ; CHECK-ARM-NEXT: qdadd r0, r0, r1
9288 ; CHECK-ARM-NEXT: bx lr
9389 %z = call i32 @llvm.sadd.sat.i32(i32 %x, i32 %x)
9490 %tmp = call i32 @llvm.sadd.sat.i32(i32 %y, i32 %z)
127123 ;
128124 ; CHECK-T2DSP-LABEL: qdsub:
129125 ; CHECK-T2DSP: @ %bb.0:
130 ; CHECK-T2DSP-NEXT: qadd r0, r0, r0
131 ; CHECK-T2DSP-NEXT: qsub r0, r1, r0
126 ; CHECK-T2DSP-NEXT: qdsub r0, r1, r0
132127 ; CHECK-T2DSP-NEXT: bx lr
133128 ;
134129 ; CHECK-ARM-LABEL: qdsub:
135130 ; CHECK-ARM: @ %bb.0:
136 ; CHECK-ARM-NEXT: qadd r0, r0, r0
137 ; CHECK-ARM-NEXT: qsub r0, r1, r0
131 ; CHECK-ARM-NEXT: qdsub r0, r1, r0
138132 ; CHECK-ARM-NEXT: bx lr
139133 %z = call i32 @llvm.sadd.sat.i32(i32 %x, i32 %x)
140134 %tmp = call i32 @llvm.ssub.sat.i32(i32 %y, i32 %z)