aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/v850
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2018-06-25 10:02:16 -0600
committerJeff Law <law@gcc.gnu.org>2018-06-25 10:02:16 -0600
commitad111b8eb9a011d1c9c7abd92a4282d00fa1ea4f (patch)
tree9b10d9438b4dd24e5c137cf3ab43a2d6475d057d /gcc/config/v850
parent3e85d88526441a9d936a71015f00482abcea3d9f (diff)
downloadgcc-ad111b8eb9a011d1c9c7abd92a4282d00fa1ea4f.zip
gcc-ad111b8eb9a011d1c9c7abd92a4282d00fa1ea4f.tar.gz
gcc-ad111b8eb9a011d1c9c7abd92a4282d00fa1ea4f.tar.bz2
v850.md (divmodhi4): Make sure to sign extend the dividend to 32 bits.
* config/v850/v850.md (divmodhi4): Make sure to sign extend the dividend to 32 bits. Adjust length. (udivmodhi4): Cleanup output template. Fix length. From-SVN: r262022
Diffstat (limited to 'gcc/config/v850')
-rw-r--r--gcc/config/v850/v850.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md
index 2656e90..e01a310 100644
--- a/gcc/config/v850/v850.md
+++ b/gcc/config/v850/v850.md
@@ -738,13 +738,13 @@
(match_dup 2)))
(clobber (reg:CC CC_REGNUM))]
"TARGET_V850E_UP"
- "divh %2,%0,%3"
- [(set_attr "length" "4")
+ "sxh %0\n\tdivh %2,%0,%3"
+ [(set_attr "length" "6")
(set_attr "cc" "clobber")
(set_attr "type" "div")])
-;; Half-words are sign-extended by default, so we must zero extend to a word
-;; here before doing the divide.
+;; The half word needs to be zero/sign extended to 32 bits before doing
+;; the division/modulo operation.
(define_insn "udivmodhi4"
[(set (match_operand:HI 0 "register_operand" "=r")
@@ -755,8 +755,8 @@
(match_dup 2)))
(clobber (reg:CC CC_REGNUM))]
"TARGET_V850E_UP"
- "zxh %0 ; divhu %2,%0,%3"
- [(set_attr "length" "4")
+ "zxh %0\n\tdivhu %2,%0,%3"
+ [(set_attr "length" "6")
(set_attr "cc" "clobber")
(set_attr "type" "div")])