binutils-gdb/sim
Jozef Lawrynowicz e8a387fb5f MSP430: sim: Fix incorrect simulation of unsigned widening multiply
Operand sizes used for simulation of MSP430 hardware multiply
operations are not aligned with the sizes used on the target, resulting
in the simulator storing signed operands with too much precision.

Additionally, simulation of unsigned multiplication is missing explicit
casts to prevent any implicit sign extension.

gcc.c-torture/execute/pr91450-1.c uses unsigned widening multiplication
of 32-bit operands -4 and 2, to produce a 64-bit result:
0xffff fffc * 0x2 = 0x1 ffff fff8

If -4 is stored in 64-bit precision, then the multiplication is
essentially signed and the result is -8 in 64-bit precision
(0xffff ffff ffff fffc), which is not correct.

sim/msp430/ChangeLog:

	* msp430-sim.c (put_op): For unsigned multiplication, explicitly cast
	operands to the unsigned type before multiplying.
	* msp430-sim.h (struct msp430_cpu_state): Fix types used to store hwmult
	operands.

sim/testsuite/sim/msp430/ChangeLog:

	* mpyull_hwmult.s: New test.
2020-08-05 15:02:30 +01:00
..
aarch64
arm
avr
bfin Run autoreconf -vf throughout 2020-07-29 16:03:55 -04:00
bpf sim: generated files for the eBPF simulator 2020-08-04 18:11:31 +02:00
common
cr16
cris
d10v
erc32 Run autoreconf -vf throughout 2020-07-29 16:03:55 -04:00
frv
ft32
h8300
igen
iq2000
lm32
m32c
m32r
m68hc11
mcore
microblaze
mips Run autoreconf -vf throughout 2020-07-29 16:03:55 -04:00
mn10300
moxie
msp430 MSP430: sim: Fix incorrect simulation of unsigned widening multiply 2020-08-05 15:02:30 +01:00
or1k
ppc
pru
rl78
rx
sh
sh64
testsuite MSP430: sim: Fix incorrect simulation of unsigned widening multiply 2020-08-05 15:02:30 +01:00
v850
.gitignore
ChangeLog sim: generated files for the eBPF simulator 2020-08-04 18:11:31 +02:00
configure sim: eBPF simulator 2020-08-04 18:09:16 +02:00
configure.ac
configure.tgt sim: eBPF simulator 2020-08-04 18:09:16 +02:00
MAINTAINERS sim: eBPF simulator 2020-08-04 18:09:16 +02:00
Makefile.in
README-HACKING