diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 95293bd..dc62caa 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -2183,29 +2183,28 @@
 )
 
 (define_insn_and_split "*anddi3_insn"
-  [(set (match_operand:DI         0 "s_register_operand"     "=&r,&r,&r,&r,w,w ,?&r,?&r,?w,?w")
-	(and:DI (match_operand:DI 1 "s_register_operand"     "%0 ,r ,0,r ,w,0 ,0  ,r  ,w ,0")
-		(match_operand:DI 2 "arm_anddi_operand_neon" "r  ,r ,De,De,w,DL,r  ,r  ,w ,DL")))]
+  [(set (match_operand:DI         0 "s_register_operand"     "=w,w ,&r,&r,&r,&r,?w,?w")
+        (and:DI (match_operand:DI 1 "s_register_operand"     "%w,0 ,0 ,r ,0 ,r ,w ,0")
+                (match_operand:DI 2 "arm_anddi_operand_neon" "w ,DL,r ,r ,De,De,w ,DL")))]
   "TARGET_32BIT && !TARGET_IWMMXT"
 {
   switch (which_alternative)
     {
-    case 0:
-    case 1:
+    case 0: /* fall through */
+    case 6: return "vand\t%P0, %P1, %P2";
+    case 1: /* fall through */
+    case 7: return neon_output_logic_immediate ("vand", &operands[2],
+                    DImode, 1, VALID_NEON_QREG_MODE (DImode));
     case 2:
-    case 3: /* fall through */
-      return "#";
-    case 4: /* fall through */
-    case 8: return "vand\t%P0, %P1, %P2";
+    case 3:
+    case 4:
     case 5: /* fall through */
-    case 9: return neon_output_logic_immediate ("vand", &operands[2],
-                    DImode, 1, VALID_NEON_QREG_MODE (DImode));
-    case 6: return "#";
-    case 7: return "#";
+      return "#";
     default: gcc_unreachable ();
     }
 }
-  "TARGET_32BIT && !TARGET_IWMMXT"
+  "TARGET_32BIT && !TARGET_IWMMXT && reload_completed
+   && !(IS_VFP_REGNUM (REGNO (operands[0])))"
   [(set (match_dup 3) (match_dup 4))
    (set (match_dup 5) (match_dup 6))]
   "
@@ -2221,19 +2220,11 @@
                                            gen_highpart_mode (SImode, DImode, operands[2]));
 
   }"
-  [(set_attr "neon_type" "*,*,*,*,neon_int_1,neon_int_1,*,*,neon_int_1,neon_int_1")
-   (set_attr "arch" "*,*,*,*,neon_for_64bits,neon_for_64bits,*,*,
+  [(set_attr "neon_type" "neon_int_1,neon_int_1,*,*,*,*,neon_int_1,neon_int_1")
+   (set_attr "arch" "neon_for_64bits,neon_for_64bits,*,*,*,*,
                      avoid_neon_for_64bits,avoid_neon_for_64bits")
-   (set_attr "length" "8,8,8,8,*,*,8,8,*,*")
-   (set (attr "insn_enabled") (if_then_else
-                                (lt (symbol_ref "which_alternative")
-                                    (const_int 4))
-                                (if_then_else (match_test "!TARGET_NEON")
-                                              (const_string "yes")
-                                              (const_string "no"))
-                                (if_then_else (match_test "TARGET_NEON")
-                                              (const_string "yes")
-                                              (const_string "no"))))]
+   (set_attr "length" "*,*,8,8,8,8,*,*")
+  ]
 )
 
 (define_insn_and_split "*anddi_zesidi_di"
