]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Properly handle multiplication by constant in muldi3_v8plus.
authorBernd Schmidt <bernds@redhat.com>
Fri, 30 Mar 2001 14:06:36 +0000 (14:06 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Fri, 30 Mar 2001 14:06:36 +0000 (14:06 +0000)
From-SVN: r40967

gcc/ChangeLog
gcc/config/sparc/sparc.md

index ef4dfa751993921c8ab1f215bcdc74d11ca25cf7..95d5f35fb5ddb6e4f9f72fd927760b93a77a7398 100644 (file)
        * mips.md: Define conditional move patterns for floating point
        operands and DI mode conditions.
 
+       2000-11-25  Jakub Jelinek  <jakub@redhat.com>
+       * config/sparc/sparc.md (muldi3_v8plus): Remove H constraint.
+       Handle CONST_INT as second argument.
+
 2001-03-28  Bernd Schmidt  <bernds@redhat.com>
 
        * flow.c (propagate_block): When trying to delete a case vector, cope
index 58e882c5ac7aa217647b539932695ef377fdb439..0438614ee4cd3ae9e4fb17abb51169a73586b5f7 100644 (file)
 (define_insn "muldi3_v8plus"
   [(set (match_operand:DI 0 "register_operand" "=r,h")
        (mult:DI (match_operand:DI 1 "arith_double_operand" "%r,0")
-                (match_operand:DI 2 "arith_double_operand" "rHI,rHI")))
+                (match_operand:DI 2 "arith_double_operand" "rI,rI")))
    (clobber (match_scratch:SI 3 "=&h,X"))
    (clobber (match_scratch:SI 4 "=&h,X"))]
   "TARGET_V8PLUS"
     output_asm_insn (\"srl\\t%L1, 0, %L1\", operands);
   if (which_alternative == 1)
     output_asm_insn (\"sllx\\t%H1, 32, %H1\", operands);
+  if (GET_CODE (operands[2]) == CONST_INT)
+    {
+      if (which_alternative == 1)
+       return \"or\\t%L1, %H1, %H1\\n\\tmulx\\t%H1, %2, %L0\;srlx\\t%L0, 32, %H0\";
+      else
+       return \"sllx\\t%H1, 32, %3\\n\\tor\\t%L1, %3, %3\\n\\tmulx\\t%3, %2, %3\\n\\tsrlx\\t%3, 32, %H0\\n\\tmov\\t%3, %L0\";
+    }
   if (sparc_check_64 (operands[2], insn) <= 0)
     output_asm_insn (\"srl\\t%L2, 0, %L2\", operands);
   if (which_alternative == 1)