]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[ARM] PR target/69161: Don't ignore mode when matching comparison operator in cstore...
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 17 Feb 2016 13:39:30 +0000 (13:39 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Wed, 17 Feb 2016 13:39:30 +0000 (13:39 +0000)
PR target/69161
* config/arm/predicates.md (arm_comparison_operator_mode):
New predicate.
* config/arm/arm.md (*mov_scc): Use arm_comparison_operator_mode
instead of arm_comparison_operator.
(*mov_negscc): Likewise.
(*mov_notscc): Likewise.
* config/arm/thumb2.md (*thumb2_mov_scc): Likewise.
(*thumb2_mov_negscc): Likewise.
(*thumb2_mov_negscc_strict_it): Likewise.
(*thumb2_mov_notscc): Likewise.
(*thumb2_mov_notscc_strict_it): Likewise.

From-SVN: r233495

gcc/ChangeLog
gcc/config/arm/arm.md
gcc/config/arm/predicates.md
gcc/config/arm/thumb2.md

index 607b33fa2e42521c2b38ec812d5cf0a504269bee..5f4bd78259578c2ef860f95d8ab9d16ab87008a0 100644 (file)
@@ -1,3 +1,18 @@
+2016-02-17  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       PR target/69161
+       * config/arm/predicates.md (arm_comparison_operator_mode):
+       New predicate.
+       * config/arm/arm.md (*mov_scc): Use arm_comparison_operator_mode
+       instead of arm_comparison_operator.
+       (*mov_negscc): Likewise.
+       (*mov_notscc): Likewise.
+       * config/arm/thumb2.md (*thumb2_mov_scc): Likewise.
+       (*thumb2_mov_negscc): Likewise.
+       (*thumb2_mov_negscc_strict_it): Likewise.
+       (*thumb2_mov_notscc): Likewise.
+       (*thumb2_mov_notscc_strict_it): Likewise.
+
 2016-02-17  Wilco Dijkstra  <wdijkstr@arm.com>
 
        * config/aarch64/aarch64.c (aarch64_internal_mov_immediate):
index 64873a2ded8944f5fb173aaae4af764fe318c91e..e67239deb6de88710fd6589311ef407dc6836a83 100644 (file)
 
 (define_insn_and_split "*mov_scc"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
-       (match_operator:SI 1 "arm_comparison_operator"
+       (match_operator:SI 1 "arm_comparison_operator_mode"
         [(match_operand 2 "cc_register" "") (const_int 0)]))]
   "TARGET_ARM"
   "#"   ; "mov%D1\\t%0, #0\;mov%d1\\t%0, #1"
 
 (define_insn_and_split "*mov_negscc"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
-       (neg:SI (match_operator:SI 1 "arm_comparison_operator"
+       (neg:SI (match_operator:SI 1 "arm_comparison_operator_mode"
                 [(match_operand 2 "cc_register" "") (const_int 0)])))]
   "TARGET_ARM"
   "#"   ; "mov%D1\\t%0, #0\;mvn%d1\\t%0, #0"
index 41a6ea4bb275e2929421dd391644ea6ffb6b9c35..b1cd556211a200a73487c5947fcab08886ae749e 100644 (file)
   (and (match_operand 0 "expandable_comparison_operator")
        (match_test "maybe_get_arm_condition_code (op) != ARM_NV")))
 
+;; Likewise, but don't ignore the mode.
+;; RTL SET operations require their operands source and destination have
+;; the same modes, so we can't ignore the modes there.  See PR target/69161.
+(define_predicate "arm_comparison_operator_mode"
+  (and (match_operand 0 "expandable_comparison_operator")
+       (match_test "maybe_get_arm_condition_code (op) != ARM_NV")))
+
 (define_special_predicate "lt_ge_comparison_operator"
   (match_code "lt,ge"))
 
index 39a3d80691814c3cb2ef10a3f608d25f075bbad6..992536593d6c0a8b8fe5a324f32e279c69746157 100644 (file)
 
 (define_insn_and_split "*thumb2_mov_scc"
   [(set (match_operand:SI 0 "s_register_operand" "=l,r")
-       (match_operator:SI 1 "arm_comparison_operator"
+       (match_operator:SI 1 "arm_comparison_operator_mode"
         [(match_operand 2 "cc_register" "") (const_int 0)]))]
   "TARGET_THUMB2"
   "#"   ; "ite\\t%D1\;mov%D1\\t%0, #0\;mov%d1\\t%0, #1"
 
 (define_insn_and_split "*thumb2_mov_negscc"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
-       (neg:SI (match_operator:SI 1 "arm_comparison_operator"
+       (neg:SI (match_operator:SI 1 "arm_comparison_operator_mode"
                 [(match_operand 2 "cc_register" "") (const_int 0)])))]
   "TARGET_THUMB2 && !arm_restrict_it"
   "#"   ; "ite\\t%D1\;mov%D1\\t%0, #0\;mvn%d1\\t%0, #0"
 
 (define_insn_and_split "*thumb2_mov_negscc_strict_it"
   [(set (match_operand:SI 0 "low_register_operand" "=l")
-       (neg:SI (match_operator:SI 1 "arm_comparison_operator"
+       (neg:SI (match_operator:SI 1 "arm_comparison_operator_mode"
                 [(match_operand 2 "cc_register" "") (const_int 0)])))]
   "TARGET_THUMB2 && arm_restrict_it"
   "#"   ; ";mvn\\t%0, #0 ;it\\t%D1\;mov%D1\\t%0, #0\"
 
 (define_insn_and_split "*thumb2_mov_notscc"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
-       (not:SI (match_operator:SI 1 "arm_comparison_operator"
+       (not:SI (match_operator:SI 1 "arm_comparison_operator_mode"
                 [(match_operand 2 "cc_register" "") (const_int 0)])))]
   "TARGET_THUMB2 && !arm_restrict_it"
   "#"   ; "ite\\t%D1\;mvn%D1\\t%0, #0\;mvn%d1\\t%0, #1"
 
 (define_insn_and_split "*thumb2_mov_notscc_strict_it"
   [(set (match_operand:SI 0 "low_register_operand" "=l")
-        (not:SI (match_operator:SI 1 "arm_comparison_operator"
+       (not:SI (match_operator:SI 1 "arm_comparison_operator_mode"
                  [(match_operand 2 "cc_register" "") (const_int 0)])))]
   "TARGET_THUMB2 && arm_restrict_it"
   "#"   ; "mvn %0, #0 ; it%d1 ; lsl%d1 %0, %0, #1"