Now that we check for valid sub-insns in parallel insns, we can
enable the tests that explicitly validate those code paths.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Now that we keep track of the exact parallel insn slot we're in, we can
make sure that the current insn being decoded is valid for that slot.
This brings us much closer to the hardware in flagging invalid parallel
insn combinations.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Some insns need to know which slot they're in to determine whether they
are valid. So add an enum for each slot, and check that rather than the
overall insn len. This makes tracking things in the code much clearer.
However, this code is functionally the same, so a follow up patch will
leverage this more to properly flag invalid parallel insn combos.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Now that we have the se_all helpers together and working, we can see
what pieces are duplicated in each test and unify them in the common
header file.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The amod1 helper includes a leading space so it can expand into the empty
string when need be, which means the caller need not add spacing itself.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Parallel insns can only do one 32bit, then two 16bits. So if we see
a 2nd 32bit insn after the first 32bit in a parallel insn, abort.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This fix the build time warning:
warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
machs.c: In function 'bfin_model_cpu_init':
machs.c:1657:1: warning: 'bfrom' may be used uninitialized
in this function [-Wuninitialized]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Fix warning about mixing decls and code by moving auxvt_size decl
down to the scope where it is used.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The current code triggers a warning:
dv-bfin_sic.c: In function 'bfin_sic_finish':
dv-bfin_sic.c:930:41: warning: operation on 'sic-><U78e8>.bf54x.iwr1'
may be undefined [-Wsequence-point]
This points out the IWR2 register was not being setup because of a typo.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The place where these funcs get defined do not include the header that
declares their prototypes. Add that to fix -Wmissing-prototypes:
devices.c:59:1: warning: no previous prototype for 'dv_bfin_mmr_invalid'
devices.c:66:1: warning: no previous prototype for 'dv_bfin_mmr_require'
devices.c:99:1: warning: no previous prototype for 'dv_bfin_mmr_check'
devices.c:159:14: warning: no previous prototype for 'dv_get_bus_num'
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The common code has a sim_core_trans_addr() helper that only the m32r code
uses. Move the inline extern in the m32r code to the proper common header.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Similar to logic in the cris exp, attempt a simple compile and if it fails
(presumably due to the compiler being broken), skip all the related tests.
Fortunately, most tests (~600 out of ~800) are pure assembly, so people should
still get pretty good coverage.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Before POSIX standardized strsignal(), old systems would hide the
prototype unless the normal extension defines were enabled. So use
the AC_USE_SYSTEM_EXTENSIONS helper for that.
Then make sure we include string.h ourselves in nrun.c rather than
relying on implicit includes via other sim headers.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The sim code gets the logic for SIM_AC_OPTION_WARNINGS from gdb, but
it hasn't been updated in a good long while. Sync with the latest
gdb code.
There is a sim specific change in here: we disable -Werror for now.
This is because all sim code atm contains warnings. Will probably
have to slowly add a white list of targets which can tolerate this
until everyone is updated.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The current se_all*opcodes tests are very similar in how they work.
In preparation for adding more tests along these lines, unify the
common bits into a framework that others can include and build off
of easily.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
From: Robin Getz <robin.getz@analog.com>
Overflow with shift operations happens independently of saturation, but
we have the logic merged. Extend the lshift function so that callers
can tell it when to handle each independently, and then do so when it's
needed.
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This isn't entirely correct in that it assumes the signal numbering of
the target and host match, but seeing as we already make that assumption
in a few places, this patch doesn't make the situation any worse.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
To make it easier to support ebiu banks at other addresses, move the base to
a runtime parameter rather than structure. Future work will make this more
dynamic, but I'm waiting for more details first.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The 32bit allopcodes test had quite a bit of optimization added to it
so that it ran in a reasonable amount of time out of uncached memory.
Port those changes over to the 16bit test so the two share common code.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
AIX 7.1 defines st_pad[123] to st_[amc]tim.tv_pad, respectively,
breaking declaration of st_pad[123] members in struct solaris_stat.
Undefine them as this is no less terrible than other solutions (like
renaming the fields and losing the binding to Solaris' names).
From: Michael Haubenwallner <haubi@s01en24.gentoo.org>
We had some workarounds for old linux/mii.h headers, but it breaks with
newer ones. So tweak the checks a bit to work with newer ones. We'll
worry about older systems once someone complains.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Trying to run `headers` in an out-of-tree build fails atm due to the
relative srcdir paths being used in a location other than where they
were setup to be used from. Get abs_srcdir from configure and use
that instead where applicable.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The current erc32 configure script only searches for -ltermcap to provide
any termcap funcs (which readlines needs). When building against a local
readline (which is static), we hit link failures like so:
gcc ...-I/-D flags... -o sis \
sis.o exec.o erc32.o func.o help.o float.o \
../../bfd/libbfd.a ../../opcodes/libopcodes.a \
../../libiberty/libiberty.a -lz -lnsl \
../../readline/libreadline.a -lm
../../readline/libreadline.a(display.o): In function 'cr':
.../readline/display.c:2486: undefined reference to 'tputs'
collect2: ld returned 1 exit status
make[2]: *** [sis] Error 1
Use AC_SEARCH_LIBS from gdb's configure.ac as suggested by Joel Brobecker
to check for additional termcap providers.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The cr16 libgloss port does not define these syscall numbers, so trying
to use them results in build failures [1]. The cr16 code already uses
ifdefs around a bunch of syscalls, so extend that style to cover the
ones that are currently missing. Now we can at least compile.
[1] http://sourceware.org/ml/gdb-patches/2011-06/msg00118.html
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Building the sim on a sparc-solaris 2.8 machine fails when configured
with no extra sim hardware:
> for hw in ; do \
> echo "extern const struct hw_descriptor
> dv_${hw}_descriptor[];" ; \
> done >> tmp-hw.h
> echo 'const char version[] = "'"`sed q
> /[...]/../../gdb/version.in`"'";'
> >> version.c-tmp
> /bin/sh: -c: line 1: syntax error near unexpected token `;'
> /bin/sh: -c: line 1: `for hw in ; do \'
> make[3]: *** [hw-config.h] Error 2
The same thing happens with the version of bash that we got from
Sun as well (which is very old: 2.03.0(1)-release).
The problems comes from the fact that both shells are buggy, and
reject the following script:
for hw in ; do
[...]
done
The above is what sim/common/Makefile.in tries to execute when
generating hw-config.h.
In order to allow users to build out of the box on these machines,
this patch works around this bug. It does rely on the fact that
none of the tokens in SIM_HW contain whitespaces.
sim/common/ChangeLog:
* Make-common.in (hw-config.h): Work around bug in Solaris 2.8
system bourne shell.
Parsing target addresses is hard if not generally useless, so use the new
cb_get_string function to lookup the associated strings as well. Now the
trace output is quickly useful instead of just marginally so.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>