Fix splitting of DImode orn.
authorRamana Radhakrishnan <ramana.radhakrishnan@linaro.org>
Fri, 3 Jun 2011 08:31:18 +0000 (08:31 +0000)
committerRamana Radhakrishnan <ramana@gcc.gnu.org>
Fri, 3 Jun 2011 08:31:18 +0000 (08:31 +0000)
From-SVN: r174597

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

index 9ad2d406b8abb0c34a9dab49922ee968849db738..8694bfb2b9c14518eead2eef95b95bb5475de631 100644 (file)
@@ -1,3 +1,7 @@
+2011-06-02  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
+
+       * config/arm/neon.md (orndi3_neon): Actually split it.
+
 2011-06-02  Alexandre Oliva  <aoliva@redhat.com>
 
        * params.def (PARAM_MAX_VARTRACK_EXPR_DEPTH): Bump default to 10.
index 2dfa9c14ef33dc8acb9116f53dcecb85895ede51..8c31c48b49552547bf2d5cfc4d354a0c988bf8b4 100644 (file)
   [(set_attr "neon_type" "neon_int_1")]
 )
 
-(define_insn "orndi3_neon"
-  [(set (match_operand:DI 0 "s_register_operand" "=w,?=&r,?&r")
-       (ior:DI (not:DI (match_operand:DI 2 "s_register_operand" "w,0,r"))
-               (match_operand:DI 1 "s_register_operand" "w,r,0")))]
+;; TODO: investigate whether we should disable 
+;; this and bicdi3_neon for the A8 in line with the other
+;; changes above. 
+(define_insn_and_split "orndi3_neon"
+  [(set (match_operand:DI 0 "s_register_operand" "=w,?&r,?&r,?&r")
+       (ior:DI (not:DI (match_operand:DI 2 "s_register_operand" "w,0,0,r"))
+               (match_operand:DI 1 "s_register_operand" "w,r,r,0")))]
   "TARGET_NEON"
   "@
    vorn\t%P0, %P1, %P2
    #
+   #
    #"
-  [(set_attr "neon_type" "neon_int_1,*,*")
-   (set_attr "length" "*,8,8")]
+  "reload_completed && 
+   (TARGET_NEON && !(IS_VFP_REGNUM (REGNO (operands[0]))))"
+  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
+   (set (match_dup 3) (ior:SI (not:SI (match_dup 4)) (match_dup 5)))]
+  "
+  {
+    if (TARGET_THUMB2)
+      {
+        operands[3] = gen_highpart (SImode, operands[0]);
+        operands[0] = gen_lowpart (SImode, operands[0]);
+        operands[4] = gen_highpart (SImode, operands[2]);
+        operands[2] = gen_lowpart (SImode, operands[2]);
+        operands[5] = gen_highpart (SImode, operands[1]);
+        operands[1] = gen_lowpart (SImode, operands[1]);
+      }
+    else
+      {
+        emit_insn (gen_one_cmpldi2 (operands[0], operands[2]));
+        emit_insn (gen_iordi3 (operands[0], operands[1], operands[0]));
+        DONE;
+      }
+  }"
+  [(set_attr "neon_type" "neon_int_1,*,*,*")
+   (set_attr "length" "*,16,8,8")
+   (set_attr "arch" "any,a,t2,t2")]
 )
 
 (define_insn "bic<mode>3_neon"