binutils-gdb/sim/common
Mike Frysinger b2ea48df92 sim: cgen: rework DI macros to avoid signed left shifts
The cgen code uses DI as int64_t and UDI as uint64_t.  The DI macros
are used to construct 64-bit values from 32-bit values (for the low
and high parts).  The MAKEDI macro casts the high 32-bit value to a
signed 32-bit value before shifting.  If this created a negative
value, this would be undefined behavior according to the C standard.
All we care about is shifting the 32-bits as they are to the high
32-bits, not caring about sign extension (since there's nothing left
to shift into), and the low 32-bits being empty.  This is what we
get from shifting an unsigned value, so cast it to unsigned 32-bit
to avoid undefined behavior.

While we're here, change the SETLODI macro to truncate the lower
value to 32-bits before we set it.  If it was passing in a 64-bit
value, those high bits would get included too, and that's not what
we want.

Similarly, tweak the SETHIDI macro to cast the value to an unsigned
64-bit instead of a signed 64-bit.  If the value was only 32-bits,
the behavior would be the same.  If it happened to be signed 64-bit,
it would trigger the undefined behavior too.
2024-01-08 20:01:05 -05:00
..
callback.c sim: formally assume unistd.h always exists (via gnulib) 2023-01-16 04:35:48 -05:00
cgen-accfp.c sim: common: migrate to standard uintXX_t types 2022-01-06 01:17:39 -05:00
cgen-cpu.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cgen-defs.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cgen-engine.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cgen-fpu.c
cgen-fpu.h
cgen-mem.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cgen-ops.h sim: cgen: mark cgen_rtx_error noreturn 2023-12-24 05:09:28 -05:00
cgen-par.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cgen-par.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cgen-run.c sim: common: fix -Wunused-variable warnings 2023-12-19 05:51:09 -05:00
cgen-scache.c sim: common: fix -Wunused-variable warnings 2023-12-19 05:51:09 -05:00
cgen-scache.h sim: info: convert verbose field to a bool 2023-01-18 20:47:55 -05:00
cgen-sim.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cgen-trace.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cgen-trace.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cgen-types.h sim: cgen: rework DI macros to avoid signed left shifts 2024-01-08 20:01:05 -05:00
cgen-utils.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cgen.sh Simplify definition of GUILE 2023-08-26 13:09:38 -06:00
ChangeLog-2021
create-version.sh Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
defs.h sim: add ATTRIBUTE_FALLTHROUGH for local code 2023-12-21 01:59:22 -05:00
dv-cfi.c sim: common: fix -Wimplicit-fallthrough warnings 2023-12-21 01:59:22 -05:00
dv-cfi.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
dv-core.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
dv-glue.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
dv-pal.c sim: formally assume unistd.h always exists (via gnulib) 2023-01-16 04:35:48 -05:00
dv-sockser.c sim: formally assume unistd.h always exists (via gnulib) 2023-01-16 04:35:48 -05:00
dv-sockser.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdbinit.in sim: add arch/.gdbinit stub scripts 2022-03-28 23:10:34 -04:00
genmloop.sh sim: mloop: add #line pragmas everywhere 2023-12-21 20:16:26 -05:00
gennltvals.py sim: common: pull in newlib extensions for Linux compatibility 2023-12-26 22:53:31 -05:00
hw-alloc.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-alloc.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-base.c sim: common: fix -Wunused-but-set-variable warnings 2023-12-07 22:31:21 -07:00
hw-base.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-device.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-device.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-events.c sim: common: move test-hw-events to top-level build 2023-01-10 01:15:29 -05:00
hw-events.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-handles.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-handles.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-instances.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-instances.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-main.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-ports.c sim: fix pervasive typo 2024-01-01 10:44:13 -05:00
hw-ports.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-properties.c sim: fix pervasive typo 2024-01-01 10:44:13 -05:00
hw-properties.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hw-tree.c sim: fix pervasive typo 2024-01-01 10:44:13 -05:00
hw-tree.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
lineno.sh sim: common: add $LINENO rewriting support to genmloop scripts 2023-12-21 20:16:26 -05:00
local.mk sim: common: add $LINENO rewriting support to genmloop scripts 2023-12-21 20:16:26 -05:00
nrun.c sim: formally assume unistd.h always exists (via gnulib) 2023-01-16 04:35:48 -05:00
portability.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
portability.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
run.1 Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-abort.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-alu.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-arange.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-arange.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-assert.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-base.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-basics.h sim: fix pervasive typo 2024-01-01 10:44:13 -05:00
sim-bits.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-bits.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-close.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-command.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-config.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-config.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-core.c sim: fix pervasive typo 2024-01-01 10:44:13 -05:00
sim-core.h sim: signal: mark signal callback funcs as noreturn since they don't return 2023-12-21 01:59:22 -05:00
sim-cpu.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-cpu.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-endian.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-endian.h sim: common: include sim-types.h in the endian header directly 2024-01-03 02:15:54 -05:00
sim-engine.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-engine.h sim: common: mark engine restart as noreturn 2023-12-21 01:23:00 -05:00
sim-events.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-events.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-fpu.c sim: common: fix -Wshadow=local warnings 2023-12-22 23:29:19 -05:00
sim-fpu.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-hload.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-hrw.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-hw.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-hw.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-info.c sim: info: convert verbose field to a bool 2023-01-18 20:47:55 -05:00
sim-inline.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-inline.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-io.c sim: formally assume unistd.h always exists (via gnulib) 2023-01-16 04:35:48 -05:00
sim-io.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-load.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-memopt.c sim: common: fix -Wimplicit-fallthrough warnings 2023-12-21 01:59:22 -05:00
sim-memopt.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-model.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-model.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-module.c sim: common: fix -Wunused-variable warnings 2023-12-19 05:51:09 -05:00
sim-module.h sim: info: convert verbose field to a bool 2023-01-18 20:47:55 -05:00
sim-n-bits.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-n-core.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-n-endian.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-options.c sim: common: fix -Wshadow=local warnings 2023-12-22 23:29:19 -05:00
sim-options.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-profile.c sim: info: convert verbose field to a bool 2023-01-18 20:47:55 -05:00
sim-profile.h sim: info: convert verbose field to a bool 2023-01-18 20:47:55 -05:00
sim-reason.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-reg.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-resume.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-run.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-signal.c sim: unify sim-signal.o building 2023-01-18 19:26:58 -05:00
sim-signal.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-stop.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-syscall.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-syscall.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-trace.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-trace.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-types.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-utils.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-utils.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
sim-watch.c sim: common: fix -Wunused-variable warnings 2023-12-19 05:51:09 -05:00
sim-watch.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
syscall.c sim: common: fix -Wunused-variable warnings 2023-12-19 05:51:09 -05:00
target-newlib-errno.c sim: common: pull in newlib extensions for Linux compatibility 2023-12-26 22:53:31 -05:00
target-newlib-open.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
target-newlib-signal.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
target-newlib-syscall.c Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
target-newlib-syscall.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
version.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00