summaryrefslogtreecommitdiff
path: root/gcc/config/v850/v850.md
diff options
context:
space:
mode:
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-04 18:22:37 +0000
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-04 18:22:37 +0000
commitfbe30bb98a52a97f6fbff7c2ab2abdf96a340825 (patch)
tree3e06902999f4959350f141b265846baff33ff176 /gcc/config/v850/v850.md
parentb1fa16194be35023463ae2a85d6116da1fc556ae (diff)
downloadgcc-fbe30bb98a52a97f6fbff7c2ab2abdf96a340825.tar.gz
* config/v850/v850.md (mulhisi3): Expand the const_int case
separately to avoid trying to sign extend the const. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73256 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/v850/v850.md')
-rw-r--r--gcc/config/v850/v850.md12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md
index ba058a45e76..8e028aba559 100644
--- a/gcc/config/v850/v850.md
+++ b/gcc/config/v850/v850.md
@@ -368,7 +368,11 @@
(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")
@@ -381,13 +385,11 @@
(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