arm.h (TARGET_USE_MOVT): Check MOVT/MOVW availability with TARGET_HAVE_MOVT.
authorThomas Preud'homme <thomas.preudhomme@arm.com>
Thu, 7 Jul 2016 08:54:59 +0000 (08:54 +0000)
committerThomas Preud'homme <thopre01@gcc.gnu.org>
Thu, 7 Jul 2016 08:54:59 +0000 (08:54 +0000)
2016-07-07  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config/arm/arm.h (TARGET_USE_MOVT): Check MOVT/MOVW availability
    with TARGET_HAVE_MOVT.
    (TARGET_HAVE_MOVT): Define.
    * config/arm/arm.c (const_ok_for_op): Check MOVT/MOVW
    availability with TARGET_HAVE_MOVT.
    * config/arm/arm.md (arm_movt): Use TARGET_HAVE_MOVT to check MOVT
    availability.
    (addsi splitter): Use TARGET_THUMB && TARGET_HAVE_MOVT rather than
    TARGET_THUMB2.
    (symbol_refs movsi splitter): Remove TARGET_32BIT check.
    (arm_movtas_ze): Use TARGET_HAVE_MOVT to check MOVT availability.
    * config/arm/constraints.md (define_constraint "j"): Use
    TARGET_HAVE_MOVT to check MOVT availability.

From-SVN: r238083

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/arm/arm.md
gcc/config/arm/constraints.md

index a0c61adda0c76e2c6b8858ba1f35a39f6fa15b6f..7cfc92cf97525257970e43c171e1e0a9eae9d34d 100644 (file)
@@ -1,3 +1,19 @@
+2016-07-07  Thomas Preud'homme  <thomas.preudhomme@arm.com>
+
+       * config/arm/arm.h (TARGET_USE_MOVT): Check MOVT/MOVW availability
+       with TARGET_HAVE_MOVT.
+       (TARGET_HAVE_MOVT): Define.
+       * config/arm/arm.c (const_ok_for_op): Check MOVT/MOVW
+       availability with TARGET_HAVE_MOVT.
+       * config/arm/arm.md (arm_movt): Use TARGET_HAVE_MOVT to check MOVT
+       availability.
+       (addsi splitter): Use TARGET_THUMB && TARGET_HAVE_MOVT rather than
+       TARGET_THUMB2.
+       (symbol_refs movsi splitter): Remove TARGET_32BIT check.
+       (arm_movtas_ze): Use TARGET_HAVE_MOVT to check MOVT availability.
+       * config/arm/constraints.md (define_constraint "j"): Use
+       TARGET_HAVE_MOVT to check MOVT availability.
+
 2016-07-07  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * config/arm/arm-protos.h: Reindent FL_FOR_* macro definitions.
index 3a9b9cb7bb8b42ba73ee2822b353e300d967c7c3..2394a173f053a4751196029339f6656b6976a017 100644 (file)
@@ -3947,7 +3947,7 @@ const_ok_for_op (HOST_WIDE_INT i, enum rtx_code code)
     {
     case SET:
       /* See if we can use movw.  */
-      if (arm_arch_thumb2 && (i & 0xffff0000) == 0)
+      if (TARGET_HAVE_MOVT && (i & 0xffff0000) == 0)
        return 1;
       else
        /* Otherwise, try mvn.  */
index 07353629c6b04166e65505652130e3a6d93789d3..c9aaa6090872c24d9e6ffcadd5f1bf81d0a5890f 100644 (file)
@@ -232,7 +232,7 @@ extern void (*arm_lang_output_object_attributes_hook)(void);
 
 /* Should MOVW/MOVT be used in preference to a constant pool.  */
 #define TARGET_USE_MOVT \
-  (arm_arch_thumb2 \
+  (TARGET_HAVE_MOVT \
    && (arm_disable_literal_pool \
        || (!optimize_size && !current_tune->prefer_constant_pool)))
 
@@ -263,6 +263,9 @@ extern void (*arm_lang_output_object_attributes_hook)(void);
 /* Nonzero if this chip supports load-acquire and store-release.  */
 #define TARGET_HAVE_LDACQ      (TARGET_ARM_ARCH >= 8 && arm_arch_notm)
 
+/* Nonzero if this chip provides the MOVW and MOVW instructions.  */
+#define TARGET_HAVE_MOVT       (arm_arch_thumb2)
+
 /* Nonzero if integer division instructions supported.  */
 #define TARGET_IDIV    ((TARGET_ARM && arm_arch_arm_hwdiv)     \
                         || (TARGET_THUMB2 && arm_arch_thumb_hwdiv))
index 16498316bee9f19baff414885efe1e78191da047..3cd76f935a45305b4e7fe7b55b517a1404edfa0b 100644 (file)
   [(set (match_operand:SI 0 "nonimmediate_operand" "=r")
        (lo_sum:SI (match_operand:SI 1 "nonimmediate_operand" "0")
                   (match_operand:SI 2 "general_operand"      "i")))]
-  "arm_arch_thumb2 && arm_valid_symbolic_address_p (operands[2])"
+  "TARGET_HAVE_MOVT && arm_valid_symbolic_address_p (operands[2])"
   "movt%?\t%0, #:upper16:%c2"
   [(set_attr "predicable" "yes")
    (set_attr "predicable_short_it" "no")
   [(set (match_operand:SI 0 "arm_general_register_operand" "")
        (const:SI (plus:SI (match_operand:SI 1 "general_operand" "")
                           (match_operand:SI 2 "const_int_operand" ""))))]
-  "TARGET_THUMB2
+  "TARGET_THUMB
+   && TARGET_HAVE_MOVT
    && arm_disable_literal_pool
    && reload_completed
    && GET_CODE (operands[1]) == SYMBOL_REF"
 (define_split
   [(set (match_operand:SI 0 "arm_general_register_operand" "")
        (match_operand:SI 1 "general_operand" ""))]
-  "TARGET_32BIT
-   && TARGET_USE_MOVT && GET_CODE (operands[1]) == SYMBOL_REF
+  "TARGET_USE_MOVT && GET_CODE (operands[1]) == SYMBOL_REF
    && !flag_pic && !target_word_relocations
    && !arm_tls_referenced_p (operands[1])"
   [(clobber (const_int 0))]
                    (const_int 16)
                    (const_int 16))
         (match_operand:SI 1 "const_int_operand" ""))]
-  "arm_arch_thumb2"
+  "TARGET_HAVE_MOVT"
   "movt%?\t%0, %L1"
  [(set_attr "predicable" "yes")
   (set_attr "predicable_short_it" "no")
index 3b71c4a527064290066348cb234c6abb8c8e2e43..4ece5f013c92adee04157b5c909e1d47c894c994 100644 (file)
@@ -66,7 +66,7 @@
 
 (define_constraint "j"
  "A constant suitable for a MOVW instruction. (ARM/Thumb-2)"
- (and (match_test "TARGET_32BIT && arm_arch_thumb2")
+ (and (match_test "TARGET_HAVE_MOVT")
       (ior (and (match_code "high")
                (match_test "arm_valid_symbolic_address_p (XEXP (op, 0))"))
           (and (match_code "const_int")