aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2022-11-12sim: pru: Fix behaviour when loop count is zeroDimitar Dimitrov2-2/+43
If the counter for LOOP instruction is provided by a register with value zero, then the instruction must cause a PC jump directly to the loop end. But in that particular case simulator must not initialize its internal loop variables, because loop body will not be executed. Instead, simulator must obtain the loop's end address directly from the LOOP instruction. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2022-11-11sim: igen: cleanup archaic pointer-to-long printf castsMike Frysinger4-53/+49
Use proper %p to printf a pointer instead of casting it to long and using 0x%lx. It's cleaner, more correct, and doesn't break on LLP64.
2022-11-11sim: v850: rename v850.dc to align with other portsMike Frysinger3-2/+2
Other arches use the .dc extension for the instruction decode table.
2022-11-11sim: igen: fix hang when decoding boolean rule constantsMike Frysinger1-0/+2
The parser for boolean rules fails to skip over the , separator in the options which makes it hang forever. No dc files in the tree use boolean rules atm which is why no one noticed.
2022-11-11sim: igen: mark error func as noreturn since it exitsMike Frysinger1-1/+1
2022-11-11sim: igen: mark output funcs with printf attributeMike Frysinger2-7/+4
... and fix the legitimate bug that it catches.
2022-11-11sim: igen: constify various func argumentsMike Frysinger31-265/+380
2022-11-11sim: ppc: rename ppc-instructions to powerpc.igenMike Frysinger4-6/+6
To make it clear this is an input to the igen tool, rename it with an igen extension. This matches the other files in the ppc dir (altivec & e500 igen files), and the other igen ports (mips, mn10300, v850).
2022-11-10sim: ppc: drop old makefile fragmentMike Frysinger1-3/+0
Support for these files was dropped almost 30 years ago, but the ppc arch was missed. Clean that up now too.
2022-11-10sim: ppc: drop support for dgen -L optionMike Frysinger1-5/+1
Nothing passes this to dgen, and even if it did, nothing would happen because the generated spreg.[ch] files don't include any references back to the original data table. So drop it to simplify.
2022-11-10sim: ppc: collapse is_readonly & length switch tables heavilyMike Frysinger1-7/+15
Since we know we'll return 0 by default, we don't have to output case statements for readonly or length fields whose values are also zero. This is the most common case by far and thus generates a much smaller switch table in the end.
2022-11-10sim: ppc: collapse is_valid switch table moreMike Frysinger1-1/+4
Instead of writing: case 1: return 1; case 2: return 1; ...etc... Output a single return so we get: case 1: case 2: case ... return 1; This saves ~100 lines of code. Hopefully the compiler was already smart enough to optimize to the same code, but if not, this probably helps there too :).
2022-11-10sim: ppc: pull default switch return outMike Frysinger1-2/+1
This saves a single line for the same result. By itself, it's not interesting, but we can further optimize the generated output and completely omit the switch table in some cases. Which we'll do in follow up commits.
2022-11-10sim: ppc: constify spreg tableMike Frysinger1-2/+2
This internal table is only ever read, so constify it.
2022-11-10sim: igen: add missing newline to various error messagesMike Frysinger5-6/+6
The error() function expects a trailing newline in its message. Most callers do this already, so adding it to the few that don't.
2022-11-10sim: restore lstat & mkdir func checksMike Frysinger3-2/+16
When merging ppc configure checks into the top-level, these 2 funcs were accidentally dropped (probably due to incorrect resolution of conflicts). Restore them since the ppc code utilizes them both.
2022-11-10sim: ppc: drop obsolete USE_WIN32API checkMike Frysinger4-27/+0
This controls only one thing: how to call mkdir(). The gnulib code already has a mkdir module that provides this exact logic for us, so punt the code entirely.
2022-11-09sim: ppc: add missing parens with e500 macroMike Frysinger1-16/+16
This macro expansion was missing a set of outer-most parenthesis which some compilers would complain about depending on how the macro is used. This is just standard good macro hygiene too.
2022-11-09sim: ppc: drop useless linking of helper toolsMike Frysinger1-1/+1
We've never run these helper programs directly. The igen program includes the relevant source files directly and runs the code that way. So stop wasting developer CPU time linking programs that are never run. We leave the rules in place for people who need to test and debug the specific bits of code every now & then.
2022-11-08sim: mips: call Unpredictable instead of setting bogus values [PR sim/29276]Mike Frysinger1-2/+2
The intention of this code seems to be to indicate that this insn should not be used and produces undefined behavior, so instead of setting registers to bogus values, call Unpredictable. This fixes build warnings due to 32-bit/64-bit type conversions, and outputs a log message for users at runtime instead of silent corruption. Bug: https://sourceware.org/PR29276
2022-11-07sim: riscv: add missing AC_MSG_RESULT callMike Frysinger2-0/+3
Previous commit in here forgot to include this.
2022-11-07sim: v850: drop subdir configure logicMike Frysinger7-2962/+27
We've been using this only to set the default word size to 32. We can easily move this into the makefile via a -D compiler flag and clean up the build logic quite a bit.
2022-11-07sim: mn10300: drop subdir configure logicMike Frysinger7-2969/+34
We've been using this only to set the default word size to 32. We can easily move this into the makefile via a -D compiler flag and clean up the build logic quite a bit.
2022-11-07sim: or1k: drop subdir configure logicMike Frysinger7-2966/+32
We've been using this only to set the default word size to 32. We can easily move this into the makefile via a -D compiler flag and clean up the build logic quite a bit.
2022-11-07sim: bpf: drop subdir configure logicMike Frysinger7-2979/+44
We've been using this only to set the default word size to 64. We can easily move this into the makefile via a -D compiler flag and clean up the build logic quite a bit.
2022-11-07sim: riscv: drop subdir configure logicMike Frysinger8-3138/+65
We've been using this only to set the default word size to 32-vs-64 based on the $target. We can easily merge this with the top-level configure script to clean things up a bit.
2022-11-07sim: .gdbinit: generate for all arch subdirsMike Frysinger3-143/+180
This was being skipped for ports that had a recursive configure, but we want it for them too.
2022-11-07sim: build: add a proper var for enabled archesMike Frysinger4-63/+98
The install code was using $SUBDIRS to track all enabled arches. This works, but isn't great if we want to add a subdir that isn't an arch port, or as we merge the subdirs into the top-level. Create a new var explicitly to track the list of enabled arches instead.
2022-11-06sim: build: respect AM_MAKEFLAGS when entering subdirsMike Frysinger7-14/+14
This doesn't matter right now, but it will as we add more flags to the recursive make step to pass state down.
2022-11-06sim: build: stop passing down SIM_PRIMARY_TARGETMike Frysinger2-2/+2
This was needed when the install step was run in subdirs, but now that we process that entirely in the top-level, we don't need to pass this down, so drop it.
2022-11-05sim: fix readline linkageMike Frysinger2-2/+2
Now that we link programs in the top dir instead of the arch subdir, update the readline library path to be relative to the top dir.
2022-11-05sim: use libtool to install programsMike Frysinger3-4/+6
Now that we use libtool to link, we have to use it to install instead of keeping the manual logic so we don't install wrapper shell scripts.
2022-11-05sim: bfin: move linux-fixed-code.h to top-levelMike Frysinger3-17/+36
2022-11-05sim: run: move linking into top-levelMike Frysinger40-126/+1445
Automake will run each subdir individually before moving on to the next one. This means that the linking phase, a single threaded process, will not run in parallel with anything else. When we have to link ~32 ports, that's 32 link steps that don't take advantage of parallel systems. On my really old 4-core system, this cuts a multi-target build from ~60 sec to ~30 sec. We eventually want to move all compile+link steps to this common dir anyways, so might as well move linking now for a nice speedup. We use noinst_PROGRAMS instead of bin_PROGRAMS because we're taking care of the install ourselves rather than letting automake process it.
2022-11-05sim: build: add uninstall supportMike Frysinger5-28/+52
This never worked before, but adding it to the common top-level dir is pretty easy to do now that we're unified.
2022-11-05sim: build: move install steps to the top-levelMike Frysinger8-103/+107
We still have to maintain custom install rules due to how we rename arch-specific files with an arch prefix in their name, but we can at least unify the logic in the common dir.
2022-11-05sim: cris: move rvdummy linking to top-levelMike Frysinger3-56/+77
This is only used by `make check`, so we can move it out of the default build too.
2022-11-05sim: build: add SIM_HW_CFLAGS to top-level build tooMike Frysinger2-3/+6
This matches what we do with targets already.
2022-11-05sim: drop unused SIM_HARDWARE variableMike Frysinger1-2/+1
This hasn't been used since the refactor way back in commit f872d0d643968c1101bb8c07b252edd54f626da2 ("Only enable H/W on some mips targets."), so punt it.
2022-11-05sim: adjust sim_hw options styleMike Frysinger4-8/+12
We use uppercase for other variables, and are already turning it to uppercase in the arch-subdir.mk, so convert it in the configure step.
2022-11-05sim: ppc: drop unused /dev/zero logicMike Frysinger4-84/+1
Nothing in the tree checks this option, or has checked for decades. The pre-cvs-import ChangeLog suggests this was added & removed back then, but can't be sure as that history doesn't exist in the VCS.
2022-11-05sim: ppc: delete unused host bitsize settingsMike Frysinger4-32/+2
Nothing checks this define anywhere, so drop all the logic. We don't want this to be a configure option in the first place as all such usage should be automatic & following proper types.
2022-11-05sim: ppc: inline the sim-packages optionMike Frysinger4-63/+12
This has only ever had a single option that's enabled by default. The objects it adds are pretty small and don't add overhead at runtime if it isn't used, so just enable it all the time to make the build code simpler.
2022-11-04sim: rx: drop unused $arch settingMike Frysinger1-2/+0
This is only needed for CGEN ports which RX isn't, so drop it.
2022-11-04sim: build: remove various obsolete generation dep variablesMike Frysinger13-239/+4
These manual settings were necessary when we weren't doing automatic header dependency tracking. That was changed a while ago, and we use automake now to do it all for us. As a result, many of these vars aren't even referenced anymore. Further, some of the source file generation (e.g. .c files, or igen, or cgen outputs) were moved to the common automake build, and it takes care of dependency tracking for us with the object files.
2022-11-04sim: don't hardcode -ldl for SDL supportMike Frysinger4-11/+17
Since we use AC_SEARCH_LIBS to find dlopen, we don't need to hardcode -ldl when using SDL ourselves.
2022-11-04sim: drop -lm from SIM_EXTRA_LIBSMike Frysinger7-9/+2
We have configure tests for this in the top-level configure script to link this when necessary, so we don't need to explicitly list it for specific ports.
2022-11-04sim: build: change AC_CHECK_LIB to AC_SEARCH_LIBSMike Frysinger3-107/+150
With more C libraries moving functions entirely into the main -lc, change the AC_CHECK_LIB calls to AC_SEARCH_LIBS so we look in there first and avoid extra linkage when possible.
2022-11-04sim: build: drop duplicate $(LIBS) usageMike Frysinger1-2/+1
COMMON_LIBS is set to $(LIBS), and CONFIG_LIBS is set to that plus @LIBS@. This leds to the values being used twice. Inline the CONFIG_LIBS variable without @LIBS@ since it's used only once.
2022-11-04sim: build: switch to bfd & opcodes libtool linker scriptsMike Frysinger9-431/+18
Now that we use libtool to link, we don't need to duplicate all the libs that bfd itself uses. This simplifies the configure & Makefile.