]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/54950 (Incorrect 32-bit moltiplication on m32c target)
authorDJ Delorie <dj@delorie.com>
Thu, 18 Oct 2012 01:50:24 +0000 (21:50 -0400)
committerDJ Delorie <dj@gcc.gnu.org>
Thu, 18 Oct 2012 01:50:24 +0000 (21:50 -0400)
PR target/54950
* config/m32c/predicates.md (m32c_const_u16_operand): New.
* config/m32c/muldiv.md: Use it.

From-SVN: r192553

gcc/ChangeLog
gcc/config/m32c/muldiv.md
gcc/config/m32c/predicates.md

index d5e09948d6fdd2d61c399fac7cb147fafb407e5e..c7b26bbcc854e2ab88f74527ad94b21e040273b4 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-17  DJ Delorie  <dj@delorie.com>
+
+       PR target/54950
+       * config/m32c/predicates.md (m32c_const_u16_operand): New.
+       * config/m32c/muldiv.md: Use it.
+
 2012-10-10  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * config/pa/pa.md (addhi3): Fix typo in last change.
index 49870838b903956374d0d1e7ea3fbe9adc922e05..17b0b5d18111e90261bc8e1922feb99e445e2920 100644 (file)
 (define_insn "umulhisi3_c"
   [(set (match_operand:SI 0 "ra_operand" "=Rsi")
         (mult:SI (zero_extend:SI (match_operand:HI 1 "mra_operand" "%0"))
-                 (match_operand 2 "immediate_operand" "i")))]
+                 (match_operand 2 "m32c_const_u16_operand" "i")))]
   ""
   "mulu.w\t%u2,%1"
   [(set_attr "flags" "o")]
index 9293baa65f1f1552a0e99e664e07d8a57b63a026..982bb1be849cae9b44934fd63d2b42b48fdb80d4 100644 (file)
 (define_predicate "m32c_1mask16_operand"
   (and (match_operand 0 "const_int_operand")
        (match_test "m32c_const_ok_for_constraint_p(INTVAL(op), 'I', \"Imw\")")))
+
+(define_predicate "m32c_const_u16_operand"
+  (and (match_operand 0 "const_int_operand")
+       (match_test "fprintf(stderr, \"u16=%d\\n\", INTVAL(op)),INTVAL (op) >= 0 && INTVAL (op) <= 65535")))