binutils-gdb/sim/mcore
Jeff Law c524b5f2f6 [RFA] Fix for mcore simulator
I was looking for cases where a GCC patch under evaluation would cause test
results to change.  Quite surprisingly the mcore-elf port showed test
differences.   After a fair amount of digging my conclusion was the sequences
before/after the patch should have been semantically the same.

Of course if the code is supposed to behave the same, then that points to
problems elsewhere (assembler, linker, simulator).  Sure enough the mcore
simulator was mis-handling the sign extension instructions.  The simulator
implementation of sextb is via paired shift-by-24 operations. Similarly the
simulator implements sexth via paired shift-by-16 operations.

The temporary holding the value was declared as a "long" thus this approach
worked fine for hosts with a 32 bit wide long and failed miserably for hosts
with a 64 bit wide long.

This patch makes the shift count automatically adjust based on the size of the
temporary.  It includes a simple test for sextb and sexth.  I have _not_ done a
full audit of the mcore simulator for more 32->64 bit issues.

This also fixes 443 execution tests in the GCC testsuite
2023-10-11 16:31:11 -06:00
..
ChangeLog-2021 sim: rename ChangeLog files to ChangeLog-2021 2021-08-17 20:27:36 -04:00
interp.c [RFA] Fix for mcore simulator 2023-10-11 16:31:11 -06:00
local.mk sim: modules.c: fix generation after recent refactors 2023-01-15 20:55:48 -05:00
mcore-sim.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-main.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00