diff options
author | Jeff Law <jeffreyalaw@gmail.com> | 2022-03-29 20:05:51 -0400 |
---|---|---|
committer | Jeff Law <jeffreyalaw@gmail.com> | 2022-03-29 20:08:35 -0400 |
commit | 5321c31bc78379a33f07dc7bef9256d05b942ad7 (patch) | |
tree | 6b645d1443adc5e72097b29fec1a9f584c60b6a7 /sim/v850 | |
parent | c09115ad6e3531be5fc779098a093605622b161e (diff) | |
download | fsf-binutils-gdb-5321c31bc78379a33f07dc7bef9256d05b942ad7.zip fsf-binutils-gdb-5321c31bc78379a33f07dc7bef9256d05b942ad7.tar.gz fsf-binutils-gdb-5321c31bc78379a33f07dc7bef9256d05b942ad7.tar.bz2 |
Fix for MUL instruction on the v850
* sim/v850/simops.c (Multiply64): Properly test if we need to
negate either of the operands.
* sim/testsuite/v850/mul.cgs: New test.
Diffstat (limited to 'sim/v850')
-rw-r--r-- | sim/v850/simops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sim/v850/simops.c b/sim/v850/simops.c index 8fac8bd..d264057 100644 --- a/sim/v850/simops.c +++ b/sim/v850/simops.c @@ -339,10 +339,10 @@ Multiply64 (int sign, unsigned long op0) sign = (op0 ^ op1) & 0x80000000; - if (((signed long) op0) < 0) + if (op0 & 0x80000000) op0 = - op0; - if (((signed long) op1) < 0) + if (op1 & 0x80000000) op1 = - op1; } |