]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/59593 ([arm big-endian] using "ldrh" access a immediate ...
authorShanyao Chen <chenshanyao@huawei.com>
Thu, 4 Dec 2014 15:15:57 +0000 (15:15 +0000)
committerFei Yang <fyang@gcc.gnu.org>
Thu, 4 Dec 2014 15:15:57 +0000 (15:15 +0000)
       Backport from mainline
       2014-11-20  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

       PR target/59593
       * config/arm/arm.md (*movhi_insn): Use right formatting
       for immediate.

       2014-11-19  Felix Yang  <felix.yang@huawei.com>
                   Shanyao Chen  <chenshanyao@huawei.com>

       PR target/59593
       * config/arm/arm.md (define_attr "arch"): Add v6t2.
       (define_attr "arch_enabled"): Add test for the above.
       (*movhi_insn_arch4): Add new alternative.

From-SVN: r218376

gcc/ChangeLog
gcc/config/arm/arm.md

index da6e1602b4961ca1bf4773e7664a9fd960ce282a..ba46f179f38bc7c0dde69cfeb53656c1d552ace3 100644 (file)
@@ -1,3 +1,20 @@
+2014-12-04  Shanyao Chen  <chenshanyao@huawei.com>
+
+       Backport from mainline
+       2014-11-20  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
+
+       PR target/59593
+       * config/arm/arm.md (*movhi_insn): Use right formatting
+       for immediate.
+
+       2014-11-19  Felix Yang  <felix.yang@huawei.com>
+                   Shanyao Chen  <chenshanyao@huawei.com>
+
+       PR target/59593
+       * config/arm/arm.md (define_attr "arch"): Add v6t2.
+       (define_attr "arch_enabled"): Add test for the above.
+       (*movhi_insn_arch4): Add new alternative.
+
 2014-12-04  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/56493
index cb910f118c1189bd7fb4a496d0cd3025597110f6..611c4eae95f4fb506246b2a0fe1b66f86ca1db50 100644 (file)
 ; This can be "a" for ARM, "t" for either of the Thumbs, "32" for
 ; TARGET_32BIT, "t1" or "t2" to specify a specific Thumb mode.  "v6"
 ; for ARM or Thumb-2 with arm_arch6, and nov6 for ARM without
-; arm_arch6.  This attribute is used to compute attribute "enabled",
-; use type "any" to enable an alternative in all cases.
-(define_attr "arch" "any,a,t,32,t1,t2,v6,nov6,onlya8,neon_onlya8,nota8,neon_nota8,iwmmxt,iwmmxt2"
+; arm_arch6.  "v6t2" for Thumb-2 with arm_arch6.  This attribute is
+; used to compute attribute "enabled", use type "any" to enable an
+; alternative in all cases.
+
+(define_attr "arch" "any,a,t,32,t1,t2,v6,nov6,v6t2,onlya8,neon_onlya8,nota8,neon_nota8,iwmmxt,iwmmxt2"
   (const_string "any"))
 
 (define_attr "arch_enabled" "no,yes"
              (match_test "TARGET_32BIT && !arm_arch6"))
         (const_string "yes")
 
+        (and (eq_attr "arch" "v6t2")
+             (match_test "TARGET_32BIT && arm_arch6 && arm_arch_thumb2"))
+        (const_string "yes")
+
         (and (eq_attr "arch" "onlya8")
              (eq_attr "tune" "cortexa8"))
         (const_string "yes")
 
 ;; Pattern to recognize insn generated default case above
 (define_insn "*movhi_insn_arch4"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,m,r")
-       (match_operand:HI 1 "general_operand"      "rI,K,r,mi"))]
+  [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,m,r")
+       (match_operand:HI 1 "general_operand"      "rI,K,n,r,mi"))]
   "TARGET_ARM
    && arm_arch4
    && (register_operand (operands[0], HImode)
   "@
    mov%?\\t%0, %1\\t%@ movhi
    mvn%?\\t%0, #%B1\\t%@ movhi
+   movw%?\\t%0, %L1\\t%@ movhi
    str%(h%)\\t%1, %0\\t%@ movhi
    ldr%(h%)\\t%0, %1\\t%@ movhi"
   [(set_attr "predicable" "yes")
-   (set_attr "insn" "mov,mvn,*,*")
-   (set_attr "pool_range" "*,*,*,256")
-   (set_attr "neg_pool_range" "*,*,*,244")
+   (set_attr "insn" "mov,mvn,mov,*,*")
+   (set_attr "pool_range" "*,*,*,*,256")
+   (set_attr "neg_pool_range" "*,*,*,*,244")
+   (set_attr "arch" "*,*,v6t2,*,*")
    (set_attr_alternative "type"
                          [(if_then_else (match_operand 1 "const_int_operand" "")
                                         (const_string "simple_alu_imm" )
                                         (const_string "*"))
                           (const_string "simple_alu_imm")
+                          (const_string "simple_alu_imm")
                           (const_string "store1")
                           (const_string "load1")])]
 )