Re: [PATCH][ARM] Remove remaining Neon DImode support

2019-08-22 Thread Kyrill Tkachov

Hi Wilco,

On 7/22/19 5:18 PM, Wilco Dijkstra wrote:

Remove the remaining Neon adddi3, subdi3 and negdi2 patterns.  As a result
adddi3, subdi3 and negdi2 can now always be expanded early 
irrespectively of

whether Neon is available.  Also expand the extenddi patterns at the same
time.  Several Neon arch attributes are no longer used and removed.

Code generation is improved in all cases, saving another 400-500 
instructions
from the PR77308 testcase (total improvement is over 1700 instructions 
with

-mcpu=cortex-a57 -O2).

Bootstrap & regress OK on arm-none-linux-gnueabihf --with-cpu=cortex-a57


Ok.

Thanks,

Kyrill


ChangeLog:
2019-07-19  Wilco Dijkstra  

* config/arm/arm.md (neon_for_64bits): Remove.
(avoid_neon_for_64bits): Remove.
(arm_adddi3): Always split early.
(arm_subdi3): Always split early.
(negdi2): Remove Neon expansion.
(split zero_extend): Split before reload.
(split sign_extend): Split before reload.
---

diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 
10ed70dac4384354c0a2453c5e51a29108c6c062..6d8a5a54997caee0e6956f01018cb5300a9a07e1 
100644

--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -125,7 +125,7 @@ (define_attr "length" ""
 ; arm_arch6.  "v6t2" for Thumb-2 with arm_arch6 and "v8mb" for ARMv8-M
 ; Baseline.  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,v8mb,neon_for_64bits,avoid_neon_for_64bits,iwmmxt,iwmmxt2,armv6_or_vfpv3,neon"
+(define_attr "arch" 
"any,a,t,32,t1,t2,v6,nov6,v6t2,v8mb,iwmmxt,iwmmxt2,armv6_or_vfpv3,neon"

   (const_string "any"))

 (define_attr "arch_enabled" "no,yes"
@@ -168,16 +168,6 @@ (define_attr "arch_enabled" "no,yes"
   (match_test "TARGET_THUMB1 && arm_arch8"))
  (const_string "yes")

- (and (eq_attr "arch" "avoid_neon_for_64bits")
-  (match_test "TARGET_NEON")
-  (not (match_test "TARGET_PREFER_NEON_64BITS")))
- (const_string "yes")
-
- (and (eq_attr "arch" "neon_for_64bits")
-  (match_test "TARGET_NEON")
-  (match_test "TARGET_PREFER_NEON_64BITS"))
- (const_string "yes")
-
  (and (eq_attr "arch" "iwmmxt2")
   (match_test "TARGET_REALLY_IWMMXT2"))
  (const_string "yes")
@@ -450,13 +440,8 @@ (define_expand "adddi3"
 (clobber (reg:CC CC_REGNUM))])]
   "TARGET_EITHER"
   "
-  if (TARGET_THUMB1)
-    {
-  if (!REG_P (operands[1]))
-    operands[1] = force_reg (DImode, operands[1]);
-  if (!REG_P (operands[2]))
-    operands[2] = force_reg (DImode, operands[2]);
- }
+  if (TARGET_THUMB1 && !REG_P (operands[2]))
+    operands[2] = force_reg (DImode, operands[2]);
   "
 )

@@ -465,9 +450,9 @@ (define_insn_and_split "*arm_adddi3"
 (plus:DI (match_operand:DI 1 "arm_general_register_operand" "%0, 0, 
r, 0, r")

  (match_operand:DI 2 "arm_general_adddi_operand" "r,  0, r, Dd, Dd")))
    (clobber (reg:CC CC_REGNUM))]
-  "TARGET_32BIT && !TARGET_NEON"
+  "TARGET_32BIT"
   "#"
-  "TARGET_32BIT && ((!TARGET_NEON && !TARGET_IWMMXT) || 
reload_completed)"

+  "TARGET_32BIT"
   [(parallel [(set (reg:CC_C CC_REGNUM)
    (compare:CC_C (plus:SI (match_dup 1) (match_dup 2))
  (match_dup 1)))
@@ -1290,24 +1275,16 @@ (define_expand "subdi3"
 (clobber (reg:CC CC_REGNUM))])]
   "TARGET_EITHER"
   "
-  if (TARGET_THUMB1)
-    {
-  if (!REG_P (operands[1]))
-    operands[1] = force_reg (DImode, operands[1]);
-  if (!REG_P (operands[2]))
-    operands[2] = force_reg (DImode, operands[2]);
- }
-  "
-)
+")

 (define_insn_and_split "*arm_subdi3"
   [(set (match_operand:DI   0 "arm_general_register_operand" 
"=&r,&r,&r")

 (minus:DI (match_operand:DI 1 "arm_general_register_operand" "0,r,0")
   (match_operand:DI 2 "arm_general_register_operand" "r,0,0")))
    (clobber (reg:CC CC_REGNUM))]
-  "TARGET_32BIT && !TARGET_NEON"
+  "TARGET_32BIT"
   "#"  ; "subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2"
-  "&& (!TARGET_IWMMXT || reload_completed)"
+  "TARGET_32BIT"
   [(parallel [(set (reg:CC CC_REGNUM)
    (compare:CC (match_dup 1) (match_dup 2)))
   (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
@@ -4164,13 +4141,6 @@ (define_expand "negdi2"
  (neg:DI (match_operand:DI 1 "s_register_operand")))
 (clobber (reg:CC CC_REGNUM))])]
   "TARGET_EITHER"
-  {
-    if (TARGET_NEON)
-  {
-    emit_insn (gen_negdi2_neon (operands[0], operands[1]));
-DONE;
-  }
-  }
 )

 ;; The constraints here are to prevent a *partial* overlap (where %Q0 
== %R1).

@@ -4182,7 +4152,7 @@ (define_insn_and_split "*negdi2_insn"
   "TARGET_32BIT"
   "#"; rsbs %Q0, %Q1, #0; rsc %R0, %R1, #0   (ARM)
 ; negs %Q0, %Q1    ; sbc %R0, %R1, %R1, lsl #1 (Thumb-2)
-  "&& reload_completed"
+  "TARGET_32BIT"
   [(parallel [(set (reg:CC CC_REGNUM)
    (compare:CC (const_int 0) (match_dup 1)))
   (set (match_dup 0) (minus:SI (const_int 0) (match_dup 1)))])
@@ -4714,25 +4684,17 @@ (define_insn "extenddi2"
 (define_split
   [(set (match_operand:DI 0 "s_register_operand" ""

Re: [PATCH][ARM] Remove remaining Neon DImode support

2019-08-19 Thread Wilco Dijkstra
   
 
ping
    
  
 Remove the remaining Neon adddi3, subdi3 and negdi2 patterns.  As a result
  adddi3, subdi3 and negdi2 can now always be expanded early irrespectively of
  whether Neon is available.  Also expand the extenddi patterns at the same
  time.  Several Neon arch attributes are no longer used and removed.
  
  Code generation is improved in all cases, saving another 400-500 instructions
  from the PR77308 testcase (total improvement is over 1700 instructions with
  -mcpu=cortex-a57 -O2).
  
  Bootstrap & regress OK on arm-none-linux-gnueabihf --with-cpu=cortex-a57
  
  ChangeLog:
  2019-07-19  Wilco Dijkstra  
  
  * config/arm/arm.md (neon_for_64bits): Remove.
  (avoid_neon_for_64bits): Remove.
  (arm_adddi3): Always split early.
  (arm_subdi3): Always split early.
  (negdi2): Remove Neon expansion.
  (split zero_extend): Split before reload.
  (split sign_extend): Split before reload.
  ---
  
  diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
  index 
10ed70dac4384354c0a2453c5e51a29108c6c062..6d8a5a54997caee0e6956f01018cb5300a9a07e1
 100644
  --- a/gcc/config/arm/arm.md
  +++ b/gcc/config/arm/arm.md
  @@ -125,7 +125,7 @@ (define_attr "length" ""
   ; arm_arch6.  "v6t2" for Thumb-2 with arm_arch6 and "v8mb" for ARMv8-M
   ; Baseline.  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,v8mb,neon_for_64bits,avoid_neon_for_64bits,iwmmxt,iwmmxt2,armv6_or_vfpv3,neon"
  +(define_attr "arch" 
"any,a,t,32,t1,t2,v6,nov6,v6t2,v8mb,iwmmxt,iwmmxt2,armv6_or_vfpv3,neon"
     (const_string "any"))
   
   (define_attr "arch_enabled" "no,yes"
  @@ -168,16 +168,6 @@ (define_attr "arch_enabled" "no,yes"
     (match_test "TARGET_THUMB1 && arm_arch8"))
    (const_string "yes")
   
  -    (and (eq_attr "arch" "avoid_neon_for_64bits")
  - (match_test "TARGET_NEON")
  - (not (match_test "TARGET_PREFER_NEON_64BITS")))
  -    (const_string "yes")
  -
  -    (and (eq_attr "arch" "neon_for_64bits")
  - (match_test "TARGET_NEON")
  - (match_test "TARGET_PREFER_NEON_64BITS"))
  -    (const_string "yes")
  -
    (and (eq_attr "arch" "iwmmxt2")
     (match_test "TARGET_REALLY_IWMMXT2"))
    (const_string "yes")
  @@ -450,13 +440,8 @@ (define_expand "adddi3"
   (clobber (reg:CC CC_REGNUM))])]
     "TARGET_EITHER"
     "
  -  if (TARGET_THUMB1)
  -    {
  -  if (!REG_P (operands[1]))
  -    operands[1] = force_reg (DImode, operands[1]);
  -  if (!REG_P (operands[2]))
  -    operands[2] = force_reg (DImode, operands[2]);
  - }
  +  if (TARGET_THUMB1 && !REG_P (operands[2]))
  +    operands[2] = force_reg (DImode, operands[2]);
     "
   )
   
  @@ -465,9 +450,9 @@ (define_insn_and_split "*arm_adddi3"
   (plus:DI (match_operand:DI 1 "arm_general_register_operand" "%0, 0, 
r, 0, r")
    (match_operand:DI 2 "arm_general_adddi_operand"    "r,  0, 
r, Dd, Dd")))
  (clobber (reg:CC CC_REGNUM))]
  -  "TARGET_32BIT && !TARGET_NEON"
  +  "TARGET_32BIT"
     "#"
  -  "TARGET_32BIT && ((!TARGET_NEON && !TARGET_IWMMXT) || reload_completed)"
  +  "TARGET_32BIT"
     [(parallel [(set (reg:CC_C CC_REGNUM)
  (compare:CC_C (plus:SI (match_dup 1) (match_dup 2))
    (match_dup 1)))
  @@ -1290,24 +1275,16 @@ (define_expand "subdi3"
   (clobber (reg:CC CC_REGNUM))])]
     "TARGET_EITHER"
     "
  -  if (TARGET_THUMB1)
  -    {
  -  if (!REG_P (operands[1]))
  -    operands[1] = force_reg (DImode, operands[1]);
  -  if (!REG_P (operands[2]))
  -    operands[2] = force_reg (DImode, operands[2]);
  - } 
  -  "
  -)
  +")
   
   (define_insn_and_split "*arm_subdi3"
     [(set (match_operand:DI   0 "arm_general_register_operand" 
"=&r,&r,&r")
   (minus:DI (match_operand:DI 1 "arm_general_register_operand" "0,r,0")
     (match_operand:DI 2 "arm_general_register_operand" 
"r,0,0")))
  (clobber (reg:CC CC_REGNUM))]
  -  "TARGET_32BIT && !TARGET_NEON"
  +  "TARGET_32BIT"
     "#"  ; "subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2"
  -  "&& (!TARGET_IWMMXT || reload_completed)"
  +  "TARGET_32BIT"
     [(parallel [(set (reg:CC CC_REGNUM)
  (compare:CC (match_dup 1) (match_dup 2)))
     (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
  @@ -4164,13 +4141,6 @@ (define_expand "negdi2"
    (neg:DI (match_operand:DI 1 "s_register_operand")))
   (clobber (reg:CC CC_REGNUM))])]
     "TARGET_EITHER"
  -  {
  -    if (TARGET_NEON)
  -  {
  -    emit_insn (gen_negdi2_neon (operands[0], operands[1]));
  -   DONE;
  -  }
  -  }
   )
   
   ;; The constraints here are to prevent a *partial* overlap (where %Q0 == 
%R1).
  @@ -4182,7 +4152,7 @@ (define_i

Re: [PATCH][ARM] Remove remaining Neon DImode support

2019-07-31 Thread Wilco Dijkstra
ping
   
 
Remove the remaining Neon adddi3, subdi3 and negdi2 patterns.  As a result
 adddi3, subdi3 and negdi2 can now always be expanded early irrespectively of
 whether Neon is available.  Also expand the extenddi patterns at the same
 time.  Several Neon arch attributes are no longer used and removed.
 
 Code generation is improved in all cases, saving another 400-500 instructions
 from the PR77308 testcase (total improvement is over 1700 instructions with
 -mcpu=cortex-a57 -O2).
 
 Bootstrap & regress OK on arm-none-linux-gnueabihf --with-cpu=cortex-a57
 
 ChangeLog:
 2019-07-19  Wilco Dijkstra  
 
     * config/arm/arm.md (neon_for_64bits): Remove.
     (avoid_neon_for_64bits): Remove.
     (arm_adddi3): Always split early.
     (arm_subdi3): Always split early.
     (negdi2): Remove Neon expansion.
     (split zero_extend): Split before reload.
     (split sign_extend): Split before reload.
 ---
 
 diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
 index 
10ed70dac4384354c0a2453c5e51a29108c6c062..6d8a5a54997caee0e6956f01018cb5300a9a07e1
 100644
 --- a/gcc/config/arm/arm.md
 +++ b/gcc/config/arm/arm.md
 @@ -125,7 +125,7 @@ (define_attr "length" ""
  ; arm_arch6.  "v6t2" for Thumb-2 with arm_arch6 and "v8mb" for ARMv8-M
  ; Baseline.  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,v8mb,neon_for_64bits,avoid_neon_for_64bits,iwmmxt,iwmmxt2,armv6_or_vfpv3,neon"
 +(define_attr "arch" 
"any,a,t,32,t1,t2,v6,nov6,v6t2,v8mb,iwmmxt,iwmmxt2,armv6_or_vfpv3,neon"
    (const_string "any"))
  
  (define_attr "arch_enabled" "no,yes"
 @@ -168,16 +168,6 @@ (define_attr "arch_enabled" "no,yes"
    (match_test "TARGET_THUMB1 && arm_arch8"))
   (const_string "yes")
  
 -    (and (eq_attr "arch" "avoid_neon_for_64bits")
 - (match_test "TARGET_NEON")
 - (not (match_test "TARGET_PREFER_NEON_64BITS")))
 -    (const_string "yes")
 -
 -    (and (eq_attr "arch" "neon_for_64bits")
 - (match_test "TARGET_NEON")
 - (match_test "TARGET_PREFER_NEON_64BITS"))
 -    (const_string "yes")
 -
   (and (eq_attr "arch" "iwmmxt2")
    (match_test "TARGET_REALLY_IWMMXT2"))
   (const_string "yes")
 @@ -450,13 +440,8 @@ (define_expand "adddi3"
  (clobber (reg:CC CC_REGNUM))])]
    "TARGET_EITHER"
    "
 -  if (TARGET_THUMB1)
 -    {
 -  if (!REG_P (operands[1]))
 -    operands[1] = force_reg (DImode, operands[1]);
 -  if (!REG_P (operands[2]))
 -    operands[2] = force_reg (DImode, operands[2]);
 - }
 +  if (TARGET_THUMB1 && !REG_P (operands[2]))
 +    operands[2] = force_reg (DImode, operands[2]);
    "
  )
  
 @@ -465,9 +450,9 @@ (define_insn_and_split "*arm_adddi3"
  (plus:DI (match_operand:DI 1 "arm_general_register_operand" "%0, 0, 
r, 0, r")
   (match_operand:DI 2 "arm_general_adddi_operand"    "r,  0, 
r, Dd, Dd")))
     (clobber (reg:CC CC_REGNUM))]
 -  "TARGET_32BIT && !TARGET_NEON"
 +  "TARGET_32BIT"
    "#"
 -  "TARGET_32BIT && ((!TARGET_NEON && !TARGET_IWMMXT) || reload_completed)"
 +  "TARGET_32BIT"
    [(parallel [(set (reg:CC_C CC_REGNUM)
     (compare:CC_C (plus:SI (match_dup 1) (match_dup 2))
   (match_dup 1)))
 @@ -1290,24 +1275,16 @@ (define_expand "subdi3"
  (clobber (reg:CC CC_REGNUM))])]
    "TARGET_EITHER"
    "
 -  if (TARGET_THUMB1)
 -    {
 -  if (!REG_P (operands[1]))
 -    operands[1] = force_reg (DImode, operands[1]);
 -  if (!REG_P (operands[2]))
 -    operands[2] = force_reg (DImode, operands[2]);
 - } 
 -  "
 -)
 +")
  
  (define_insn_and_split "*arm_subdi3"
    [(set (match_operand:DI   0 "arm_general_register_operand" 
"=&r,&r,&r")
  (minus:DI (match_operand:DI 1 "arm_general_register_operand" "0,r,0")
    (match_operand:DI 2 "arm_general_register_operand" 
"r,0,0")))
     (clobber (reg:CC CC_REGNUM))]
 -  "TARGET_32BIT && !TARGET_NEON"
 +  "TARGET_32BIT"
    "#"  ; "subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2"
 -  "&& (!TARGET_IWMMXT || reload_completed)"
 +  "TARGET_32BIT"
    [(parallel [(set (reg:CC CC_REGNUM)
     (compare:CC (match_dup 1) (match_dup 2)))
    (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
 @@ -4164,13 +4141,6 @@ (define_expand "negdi2"
   (neg:DI (match_operand:DI 1 "s_register_operand")))
  (clobber (reg:CC CC_REGNUM))])]
    "TARGET_EITHER"
 -  {
 -    if (TARGET_NEON)
 -  {
 -    emit_insn (gen_negdi2_neon (operands[0], operands[1]));
 -   DONE;
 -  }
 -  }
  )
  
  ;; The constraints here are to prevent a *partial* overlap (where %Q0 == %R1).
 @@ -4182,7 +4152,7 @@ (define_insn_and_split "*negdi2_insn"
    "TARGET_32BIT"
    "#"  ; rsbs %Q0, %Q1, #0; rsc %R0, %R1, #0  (ARM)
  ; negs %Q0, %

[PATCH][ARM] Remove remaining Neon DImode support

2019-07-22 Thread Wilco Dijkstra
Remove the remaining Neon adddi3, subdi3 and negdi2 patterns.  As a result
adddi3, subdi3 and negdi2 can now always be expanded early irrespectively of
whether Neon is available.  Also expand the extenddi patterns at the same
time.  Several Neon arch attributes are no longer used and removed.

Code generation is improved in all cases, saving another 400-500 instructions
from the PR77308 testcase (total improvement is over 1700 instructions with
-mcpu=cortex-a57 -O2).

Bootstrap & regress OK on arm-none-linux-gnueabihf --with-cpu=cortex-a57

ChangeLog:
2019-07-19  Wilco Dijkstra  

* config/arm/arm.md (neon_for_64bits): Remove.
(avoid_neon_for_64bits): Remove.
(arm_adddi3): Always split early.
(arm_subdi3): Always split early.
(negdi2): Remove Neon expansion.
(split zero_extend): Split before reload.
(split sign_extend): Split before reload.
---

diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 
10ed70dac4384354c0a2453c5e51a29108c6c062..6d8a5a54997caee0e6956f01018cb5300a9a07e1
 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -125,7 +125,7 @@ (define_attr "length" ""
 ; arm_arch6.  "v6t2" for Thumb-2 with arm_arch6 and "v8mb" for ARMv8-M
 ; Baseline.  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,v8mb,neon_for_64bits,avoid_neon_for_64bits,iwmmxt,iwmmxt2,armv6_or_vfpv3,neon"
+(define_attr "arch" 
"any,a,t,32,t1,t2,v6,nov6,v6t2,v8mb,iwmmxt,iwmmxt2,armv6_or_vfpv3,neon"
   (const_string "any"))
 
 (define_attr "arch_enabled" "no,yes"
@@ -168,16 +168,6 @@ (define_attr "arch_enabled" "no,yes"
  (match_test "TARGET_THUMB1 && arm_arch8"))
 (const_string "yes")
 
-(and (eq_attr "arch" "avoid_neon_for_64bits")
- (match_test "TARGET_NEON")
- (not (match_test "TARGET_PREFER_NEON_64BITS")))
-(const_string "yes")
-
-(and (eq_attr "arch" "neon_for_64bits")
- (match_test "TARGET_NEON")
- (match_test "TARGET_PREFER_NEON_64BITS"))
-(const_string "yes")
-
 (and (eq_attr "arch" "iwmmxt2")
  (match_test "TARGET_REALLY_IWMMXT2"))
 (const_string "yes")
@@ -450,13 +440,8 @@ (define_expand "adddi3"
 (clobber (reg:CC CC_REGNUM))])]
   "TARGET_EITHER"
   "
-  if (TARGET_THUMB1)
-{
-  if (!REG_P (operands[1]))
-operands[1] = force_reg (DImode, operands[1]);
-  if (!REG_P (operands[2]))
-operands[2] = force_reg (DImode, operands[2]);
- }
+  if (TARGET_THUMB1 && !REG_P (operands[2]))
+operands[2] = force_reg (DImode, operands[2]);
   "
 )
 
@@ -465,9 +450,9 @@ (define_insn_and_split "*arm_adddi3"
(plus:DI (match_operand:DI 1 "arm_general_register_operand" "%0, 0, r, 
0, r")
 (match_operand:DI 2 "arm_general_adddi_operand""r,  0, r, 
Dd, Dd")))
(clobber (reg:CC CC_REGNUM))]
-  "TARGET_32BIT && !TARGET_NEON"
+  "TARGET_32BIT"
   "#"
-  "TARGET_32BIT && ((!TARGET_NEON && !TARGET_IWMMXT) || reload_completed)"
+  "TARGET_32BIT"
   [(parallel [(set (reg:CC_C CC_REGNUM)
   (compare:CC_C (plus:SI (match_dup 1) (match_dup 2))
 (match_dup 1)))
@@ -1290,24 +1275,16 @@ (define_expand "subdi3"
 (clobber (reg:CC CC_REGNUM))])]
   "TARGET_EITHER"
   "
-  if (TARGET_THUMB1)
-{
-  if (!REG_P (operands[1]))
-operands[1] = force_reg (DImode, operands[1]);
-  if (!REG_P (operands[2]))
-operands[2] = force_reg (DImode, operands[2]);
- } 
-  "
-)
+")
 
 (define_insn_and_split "*arm_subdi3"
   [(set (match_operand:DI   0 "arm_general_register_operand" 
"=&r,&r,&r")
(minus:DI (match_operand:DI 1 "arm_general_register_operand" "0,r,0")
  (match_operand:DI 2 "arm_general_register_operand" "r,0,0")))
(clobber (reg:CC CC_REGNUM))]
-  "TARGET_32BIT && !TARGET_NEON"
+  "TARGET_32BIT"
   "#"  ; "subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2"
-  "&& (!TARGET_IWMMXT || reload_completed)"
+  "TARGET_32BIT"
   [(parallel [(set (reg:CC CC_REGNUM)
   (compare:CC (match_dup 1) (match_dup 2)))
  (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
@@ -4164,13 +4141,6 @@ (define_expand "negdi2"
 (neg:DI (match_operand:DI 1 "s_register_operand")))
 (clobber (reg:CC CC_REGNUM))])]
   "TARGET_EITHER"
-  {
-if (TARGET_NEON)
-  {
-emit_insn (gen_negdi2_neon (operands[0], operands[1]));
-   DONE;
-  }
-  }
 )
 
 ;; The constraints here are to prevent a *partial* overlap (where %Q0 == %R1).
@@ -4182,7 +4152,7 @@ (define_insn_and_split "*negdi2_insn"
   "TARGET_32BIT"
   "#"  ; rsbs %Q0, %Q1, #0; rsc %R0, %R1, #0  (ARM)
; negs %Q0, %Q1; sbc %R0, %R1, %R1, lsl #1 (Thumb-2)
-  "&& reload_completed"
+  "TARGET_32BIT"
   [(parallel [(set (reg:CC CC_REGNUM)
   (compare