Skip to content

Commit a02b858

Browse files
author
rearnsha
committed
[Arm] Add 16-bit thumb alternatives to iorsi3_compare0[_scratch]
The iorsi3_compare0 and iorsi3_compare0_scratch patterns can make use of the 16-bit thumb orrs instruction if suitable registers are allocated. This patch adds the alternative to allow this to happen. * config/arm/arm.md (iorsi3_compare0): Add alternative for 16-bit thumb insn. (iorsi3_compare0_scratch): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274822 138bc75d-0d04-0410-961f-82ee72b054a4
1 parent 4866558 commit a02b858

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

gcc/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2019-08-22 Richard Earnshaw <rearnsha@arm.com>
2+
3+
* config/arm/arm.md (iorsi3_compare0): Add alternative for 16-bit thumb
4+
insn.
5+
(iorsi3_compare0_scratch): Likewise.
6+
17
2019-08-22 Sylvia Taylor <sylvia.taylor@arm.com>
28

39
* config/aarch64/aarch64-simd-builtins.def:

gcc/config/arm/arm.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3339,27 +3339,33 @@
33393339

33403340
(define_insn "*iorsi3_compare0"
33413341
[(set (reg:CC_NOOV CC_REGNUM)
3342-
(compare:CC_NOOV (ior:SI (match_operand:SI 1 "s_register_operand" "%r,r")
3343-
(match_operand:SI 2 "arm_rhs_operand" "I,r"))
3344-
(const_int 0)))
3345-
(set (match_operand:SI 0 "s_register_operand" "=r,r")
3342+
(compare:CC_NOOV
3343+
(ior:SI (match_operand:SI 1 "s_register_operand" "%r,0,r")
3344+
(match_operand:SI 2 "arm_rhs_operand" "I,l,r"))
3345+
(const_int 0)))
3346+
(set (match_operand:SI 0 "s_register_operand" "=r,l,r")
33463347
(ior:SI (match_dup 1) (match_dup 2)))]
33473348
"TARGET_32BIT"
33483349
"orrs%?\\t%0, %1, %2"
33493350
[(set_attr "conds" "set")
3350-
(set_attr "type" "logics_imm,logics_reg")]
3351+
(set_attr "arch" "*,t2,*")
3352+
(set_attr "length" "4,2,4")
3353+
(set_attr "type" "logics_imm,logics_reg,logics_reg")]
33513354
)
33523355

33533356
(define_insn "*iorsi3_compare0_scratch"
33543357
[(set (reg:CC_NOOV CC_REGNUM)
3355-
(compare:CC_NOOV (ior:SI (match_operand:SI 1 "s_register_operand" "%r,r")
3356-
(match_operand:SI 2 "arm_rhs_operand" "I,r"))
3357-
(const_int 0)))
3358-
(clobber (match_scratch:SI 0 "=r,r"))]
3358+
(compare:CC_NOOV
3359+
(ior:SI (match_operand:SI 1 "s_register_operand" "%r,0,r")
3360+
(match_operand:SI 2 "arm_rhs_operand" "I,l,r"))
3361+
(const_int 0)))
3362+
(clobber (match_scratch:SI 0 "=r,l,r"))]
33593363
"TARGET_32BIT"
33603364
"orrs%?\\t%0, %1, %2"
33613365
[(set_attr "conds" "set")
3362-
(set_attr "type" "logics_imm,logics_reg")]
3366+
(set_attr "arch" "*,t2,*")
3367+
(set_attr "length" "4,2,4")
3368+
(set_attr "type" "logics_imm,logics_reg,logics_reg")]
33633369
)
33643370

33653371
(define_expand "xordi3"

0 commit comments

Comments
 (0)