The cmp_and and cmp_ior patterns were missing a couple of short-it
variants for thumb2, where the comparisons are all using registers some
of which were HI_REGS.
* config/arm/arm.md (cmp_and): Add short-it variant for thumb2 with
high regs.
(cmp_ior): Likewise.
Committed to trunk.
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index ed49c4beda1..3bcfdfd51e5 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -9107,15 +9107,15 @@ (define_insn "*cmp_and"
(compare
(and:SI
(match_operator 4 "arm_comparison_operator"
- [(match_operand:SI 0 "s_register_operand"
- "l,l,l,r,r,r,r,r,r")
- (match_operand:SI 1 "arm_add_operand"
- "lPy,lPy,lPy,rI,L,rI,L,rI,L")])
+ [(match_operand:SI 0 "s_register_operand"
+ "l,l,l,r,r,r,r,r,r,r")
+ (match_operand:SI 1 "arm_add_operand"
+ "lPy,lPy,lPy,rI,L,r,rI,L,rI,L")])
(match_operator:SI 5 "arm_comparison_operator"
- [(match_operand:SI 2 "s_register_operand"
- "l,r,r,l,l,r,r,r,r")
- (match_operand:SI 3 "arm_add_operand"
- "lPy,rI,L,lPy,lPy,rI,rI,L,L")]))
+ [(match_operand:SI 2 "s_register_operand"
+ "l,r,r,l,l,r,r,r,r,r")
+ (match_operand:SI 3 "arm_add_operand"
+ "lPy,rI,L,lPy,lPy,r,rI,rI,L,L")]))
(const_int 0)))]
"TARGET_32BIT"
"*
@@ -9147,9 +9147,10 @@ (define_insn "*cmp_and"
\"it\\t%d5\",
\"it\\t%d4\"
};
- static const int cmp_idx[9] = {CMP_CMP, CMP_CMP, CMP_CMN,
- CMP_CMP, CMN_CMP, CMP_CMP,
- CMN_CMP, CMP_CMN, CMN_CMN};
+ static const int cmp_idx[] = {CMP_CMP, CMP_CMP, CMP_CMN,
+ CMP_CMP, CMN_CMP, CMP_CMP,
+ CMP_CMP, CMN_CMP, CMP_CMN,
+ CMN_CMN};
int swap =
comparison_dominates_p (GET_CODE (operands[5]), GET_CODE (operands[4]));
@@ -9162,14 +9163,15 @@ (define_insn "*cmp_and"
}"
[(set_attr "conds" "set")
(set_attr "predicable" "no")
- (set_attr "arch" "t2,t2,t2,t2,t2,any,any,any,any")
- (set_attr "enabled_for_short_it" "yes,no,no,no,no,no,no,no,no")
+ (set_attr "arch" "t2,t2,t2,t2,t2,t2,any,any,any,any")
+ (set_attr "enabled_for_short_it" "yes,no,no,no,no,yes,no,no,no,no")
(set_attr_alternative "length"
[(const_int 6)
(const_int 8)
(const_int 8)
(const_int 8)
(const_int 8)
+ (const_int 6)
(if_then_else (eq_attr "is_thumb" "no")
(const_int 8)
(const_int 10))
@@ -9191,14 +9193,14 @@ (define_insn "*cmp_ior"
(ior:SI
(match_operator 4 "arm_comparison_operator"
[(match_operand:SI 0 "s_register_operand"
- "l,l,l,r,r,r,r,r,r")
+ "l,l,l,r,r,r,r,r,r,r")
(match_operand:SI 1 "arm_add_operand"
- "lPy,lPy,lPy,rI,L,rI,L,rI,L")])
+ "lPy,lPy,lPy,rI,L,r,rI,L,rI,L")])
(match_operator:SI 5 "arm_comparison_operator"
[(match_operand:SI 2 "s_register_operand"
- "l,r,r,l,l,r,r,r,r")
+ "l,r,r,l,l,r,r,r,r,r")
(match_operand:SI 3 "arm_add_operand"
- "lPy,rI,L,lPy,lPy,rI,rI,L,L")]))
+ "lPy,rI,L,lPy,lPy,r,rI,rI,L,L")]))
(const_int 0)))]
"TARGET_32BIT"
"*
@@ -9230,9 +9232,10 @@ (define_insn "*cmp_ior"
\"it\\t%D4\",
\"it\\t%D5\"
};
- static const int cmp_idx[9] = {CMP_CMP, CMP_CMP, CMP_CMN,
- CMP_CMP, CMN_CMP, CMP_CMP,
- CMN_CMP, CMP_CMN, CMN_CMN};
+ static const int cmp_idx[] = {CMP_CMP, CMP_CMP, CMP_CMN,
+ CMP_CMP, CMN_CMP, CMP_CMP,
+ CMP_CMP, CMN_CMP, CMP_CMN,
+ CMN_CMN};
int swap =
comparison_dominates_p (GET_CODE (operands[5]), GET_CODE (operands[4]));
@@ -9245,14 +9248,15 @@ (define_insn "*cmp_ior"
}
"
[(set_attr "conds" "set")
- (set_attr "arch" "t2,t2,t2,t2,t2,any,any,any,any")
- (set_attr "enabled_for_short_it" "yes,no,no,no,no,no,no,no,no")
+ (set_attr "arch" "t2,t2,t2,t2,t2,t2,any,any,any,any")
+ (set_attr "enabled_for_short_it" "yes,no,no,no,no,yes,no,no,no,no")
(set_attr_alternative "length"
[(const_int 6)
(const_int 8)
(const_int 8)
(const_int 8)
(const_int 8)
+ (const_int 6)
(if_then_else (eq_attr "is_thumb" "no")
(const_int 8)
(const_int 10))