]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
v850.md (mulhisi3): Expand the const_int case separately to avoid trying to sign...
authorDJ Delorie <dj@redhat.com>
Tue, 4 Nov 2003 18:22:37 +0000 (13:22 -0500)
committerDJ Delorie <dj@gcc.gnu.org>
Tue, 4 Nov 2003 18:22:37 +0000 (13:22 -0500)
* config/v850/v850.md (mulhisi3): Expand the const_int case
separately to avoid trying to sign extend the const.

From-SVN: r73256

gcc/ChangeLog
gcc/config/v850/v850.md

index e26d5c3ac59b7b45de36a3547cea7db1e491d73e..cb0d1b55de4a6faa07c32610832fe073343c100d 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-04  DJ Delorie  <dj@redhat.com>
+
+       * config/v850/v850.md (mulhisi3): Expand the const_int case
+       separately to avoid trying to sign extend the const.
+
 2003-11-04  Richard Sandiford  <rsandifo@redhat.com>
 
        * emit-rtl.c (copy_rtx_if_shared): Don't allow MEMs with constant
index ba058a45e761b91ca7818b0d78050897086fae9c..8e028aba559af29cf574a9b78c562324e2f48d42 100644 (file)
          (sign_extend:SI (match_operand:HI 1 "register_operand" ""))
          (sign_extend:SI (match_operand:HI 2 "nonmemory_operand" ""))))]
   ""
-  "")
+  "if (GET_CODE (operands[2]) == CONST_INT)
+     {
+       emit_insn (gen_mulhisi3_internal2 (operands[0], operands[1], operands[2]));
+       DONE;
+     }")
 
 (define_insn "*mulhisi3_internal1"
   [(set (match_operand:SI 0 "register_operand" "=r")
    (set_attr "cc" "none_0hit")
    (set_attr "type" "mult")])
 
-;; ??? Sign extending constants isn't valid.  Fix?
-
-(define_insn "*mulhisi3_internal2"
+(define_insn "mulhisi3_internal2"
   [(set (match_operand:SI 0 "register_operand" "=r,r")
        (mult:SI
          (sign_extend:SI (match_operand:HI 1 "register_operand" "%0,r"))
-         (sign_extend:SI (match_operand 2 "const_int_operand" "J,K"))))]
+         (match_operand:HI 2 "const_int_operand" "J,K")))]
   ""
   "@
    mulh %2,%0