Hi,

The attached patch is a first part to solve PR 67591: it removes
several occurrences of "IT blocks containing 32-bit Thumb
instructions are deprecated in ARMv8" messages in the
gcc/g++/libstdc++/fortran testsuites.

It does not remove them all yet. This patch only modifies the
*cmp_and, *cmp_ior, *ior_scc_scc, *ior_scc_scc_cmp,
*and_scc_scc and *and_scc_scc_cmp patterns.
Additional work is required in sub_shiftsi etc, at least.
I've started looking at these, but I decided I could already
post this self-contained patch to check if this implementation
is OK.

Regarding *cmp_and and *cmp_ior patterns, the addition of the
enabled_for_depr_it attribute is aggressive in the sense that it keeps
only the alternatives with 'l' and 'Py' constraints, while in some
cases the constraints could be relaxed. Indeed, these 2 patterns can
swap their input comparisons, meaning that any of them can be emitted
in the IT-block, and is thus subject to the ARMv8 deprecation.
The generated code is possibly suboptimal in the cases where the
operands are not swapped, since 'r' could be used.

Cross-tested on arm-none-linux-gnueabihf with -mthumb/-march=armv8-a
and --with-cpu=cortex-a57 --with-mode=thumb, showing only improvements:
http://people.linaro.org/~christophe.lyon/cross-validation/gcc-test-patches/239850-depr-it-4/report-build-info.html

Bootstrapped OK on armv8l HW.

Is this OK?

Thanks,

Christophe
2016-09-05  Christophe Lyon  <christophe.l...@linaro.org>

        PR target/67591
        * config/arm/arm.md (*cmp_and): Add enabled_for_depr_it attribute.
        (*cmp_ior): Likewise.
        (*ior_scc_scc): Add alternative for enabled_for_depr_it attribute.
        (*ior_scc_scc_cmp): Likewise.
        (*and_scc_scc): Likewise.
        (*and_scc_scc_cmp): Likewise.
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 318db75..0374bdd 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -9340,6 +9340,7 @@
   [(set_attr "conds" "set")
    (set_attr "predicable" "no")
    (set_attr "arch" "t2,t2,t2,t2,t2,any,any,any,any")
+   (set_attr "enabled_for_depr_it" "yes,no,no,no,no,no,no,no,no")
    (set_attr_alternative "length"
       [(const_int 6)
        (const_int 8)
@@ -9422,6 +9423,7 @@
   "
   [(set_attr "conds" "set")
    (set_attr "arch" "t2,t2,t2,t2,t2,any,any,any,any")
+   (set_attr "enabled_for_depr_it" "yes,no,no,no,no,no,no,no,no")
    (set_attr_alternative "length"
       [(const_int 6)
        (const_int 8)
@@ -9444,13 +9446,13 @@
 )
 
 (define_insn_and_split "*ior_scc_scc"
-  [(set (match_operand:SI 0 "s_register_operand" "=Ts")
+  [(set (match_operand:SI 0 "s_register_operand" "=Ts,Ts")
        (ior:SI (match_operator:SI 3 "arm_comparison_operator"
-                [(match_operand:SI 1 "s_register_operand" "r")
-                 (match_operand:SI 2 "arm_add_operand" "rIL")])
+                [(match_operand:SI 1 "s_register_operand" "r,l")
+                 (match_operand:SI 2 "arm_add_operand" "rIL,lPy")])
                (match_operator:SI 6 "arm_comparison_operator"
-                [(match_operand:SI 4 "s_register_operand" "r")
-                 (match_operand:SI 5 "arm_add_operand" "rIL")])))
+                [(match_operand:SI 4 "s_register_operand" "r,l")
+                 (match_operand:SI 5 "arm_add_operand" "rIL,lPy")])))
    (clobber (reg:CC CC_REGNUM))]
   "TARGET_32BIT
    && (arm_select_dominance_cc_mode (operands[3], operands[6], DOM_CC_X_OR_Y)
@@ -9469,6 +9471,7 @@
                                                  DOM_CC_X_OR_Y),
                    CC_REGNUM);"
   [(set_attr "conds" "clob")
+   (set_attr "enabled_for_depr_it" "no,yes")
    (set_attr "length" "16")
    (set_attr "type" "multiple")]
 )
@@ -9478,13 +9481,13 @@
 (define_insn_and_split "*ior_scc_scc_cmp"
   [(set (match_operand 0 "dominant_cc_register" "")
        (compare (ior:SI (match_operator:SI 3 "arm_comparison_operator"
-                         [(match_operand:SI 1 "s_register_operand" "r")
-                          (match_operand:SI 2 "arm_add_operand" "rIL")])
+                         [(match_operand:SI 1 "s_register_operand" "r,l")
+                          (match_operand:SI 2 "arm_add_operand" "rIL,lPy")])
                         (match_operator:SI 6 "arm_comparison_operator"
-                         [(match_operand:SI 4 "s_register_operand" "r")
-                          (match_operand:SI 5 "arm_add_operand" "rIL")]))
+                         [(match_operand:SI 4 "s_register_operand" "r,l")
+                          (match_operand:SI 5 "arm_add_operand" "rIL,lPy")]))
                 (const_int 0)))
-   (set (match_operand:SI 7 "s_register_operand" "=Ts")
+   (set (match_operand:SI 7 "s_register_operand" "=Ts,Ts")
        (ior:SI (match_op_dup 3 [(match_dup 1) (match_dup 2)])
                (match_op_dup 6 [(match_dup 4) (match_dup 5)])))]
   "TARGET_32BIT"
@@ -9499,18 +9502,19 @@
    (set (match_dup 7) (ne:SI (match_dup 0) (const_int 0)))]
   ""
   [(set_attr "conds" "set")
+   (set_attr "enabled_for_depr_it" "no,yes")
    (set_attr "length" "16")
    (set_attr "type" "multiple")]
 )
 
 (define_insn_and_split "*and_scc_scc"
-  [(set (match_operand:SI 0 "s_register_operand" "=Ts")
+  [(set (match_operand:SI 0 "s_register_operand" "=Ts,Ts")
        (and:SI (match_operator:SI 3 "arm_comparison_operator"
-                [(match_operand:SI 1 "s_register_operand" "r")
-                 (match_operand:SI 2 "arm_add_operand" "rIL")])
+                [(match_operand:SI 1 "s_register_operand" "r,l")
+                 (match_operand:SI 2 "arm_add_operand" "rIL,lPy")])
                (match_operator:SI 6 "arm_comparison_operator"
-                [(match_operand:SI 4 "s_register_operand" "r")
-                 (match_operand:SI 5 "arm_add_operand" "rIL")])))
+                [(match_operand:SI 4 "s_register_operand" "r,l")
+                 (match_operand:SI 5 "arm_add_operand" "rIL,lPy")])))
    (clobber (reg:CC CC_REGNUM))]
   "TARGET_32BIT
    && (arm_select_dominance_cc_mode (operands[3], operands[6], DOM_CC_X_AND_Y)
@@ -9531,6 +9535,7 @@
                                                  DOM_CC_X_AND_Y),
                    CC_REGNUM);"
   [(set_attr "conds" "clob")
+   (set_attr "enabled_for_depr_it" "no,yes")
    (set_attr "length" "16")
    (set_attr "type" "multiple")]
 )
@@ -9540,13 +9545,13 @@
 (define_insn_and_split "*and_scc_scc_cmp"
   [(set (match_operand 0 "dominant_cc_register" "")
        (compare (and:SI (match_operator:SI 3 "arm_comparison_operator"
-                         [(match_operand:SI 1 "s_register_operand" "r")
-                          (match_operand:SI 2 "arm_add_operand" "rIL")])
+                         [(match_operand:SI 1 "s_register_operand" "r,l")
+                          (match_operand:SI 2 "arm_add_operand" "rIL,lPy")])
                         (match_operator:SI 6 "arm_comparison_operator"
-                         [(match_operand:SI 4 "s_register_operand" "r")
-                          (match_operand:SI 5 "arm_add_operand" "rIL")]))
+                         [(match_operand:SI 4 "s_register_operand" "r,l")
+                          (match_operand:SI 5 "arm_add_operand" "rIL,lPy")]))
                 (const_int 0)))
-   (set (match_operand:SI 7 "s_register_operand" "=Ts")
+   (set (match_operand:SI 7 "s_register_operand" "=Ts,Ts")
        (and:SI (match_op_dup 3 [(match_dup 1) (match_dup 2)])
                (match_op_dup 6 [(match_dup 4) (match_dup 5)])))]
   "TARGET_32BIT"
@@ -9561,6 +9566,7 @@
    (set (match_dup 7) (ne:SI (match_dup 0) (const_int 0)))]
   ""
   [(set_attr "conds" "set")
+   (set_attr "enabled_for_depr_it" "no,yes")
    (set_attr "length" "16")
    (set_attr "type" "multiple")]
 )

Reply via email to