Age | Commit message (Collapse) | Author | Files | Lines |
|
Replace various custom ad-hoc fcntl/O_NONBLOCK implementations with
the gnulib nonblocking module. This makes our code much tidier and
portable to other systems (e.g. Windows).
|
|
The common igen code provides the same misc APIs as the ppc version,
so delete the ppc code and pull in the common one. There is one
minor difference: the ppc code has a unique dumpf function. The
common code switched to lf_printf for the same functionality, but
since that requires changes throughout the igen codebase, delay that
cleanup for now so we can merge the rest.
|
|
Switch to an ERROR macro and tweak the error signature to match the
common igen version in preparation for merging the two implementations.
|
|
The ppc igen error helper allows arbitrary printf calls, so extend
the common one to do the same.
|
|
We want to avoid conflicts with the common igen enums. This should
get migrated over to the common parsing logic, but for now, switch
the name to avoid redefinition.
|
|
Copy some improvements from the ppc igen code.
|
|
Now that both igen implementations are in the top-level, we can unify
the filter_filename implementation between them since they're the same
(literally the same code).
|
|
The lbasename function from libiberty provides the same API as this
custom function. The common/ code already made the switch, so make
the same change to the ppc code to avoid target duplication.
|
|
This simplifies the build a bit (especially for deps in port subdirs),
and avoids recursive make. This in turn speeds up the build, and lets
us reuse existing build-time vs host-time logic from Makefile.am.
|
|
This header is only used by the igen tool, and none of the igen code
depends on the configure-time checks. Delete the logic to simplify
to prepare for moving it to the local.mk code.
|
|
Switch this from a build-time generation to a static include. This
makes the build rules a bit simpler, especially as we move them to
Automake from hand-written makefiles.
|
|
|
|
This is never set anywhere, so it's always empty. Scrub it.
|
|
This code sets up the cc variable based on the comparison of other
registers, but it does so incrementally with bit operations, and it
never initializes the cc variable. Initialize it to 0 which the
cmpba insn is already doing.
|
|
Move it into read-only data sections to avoid constructing them on the
stack at runtime.
|
|
|
|
The "flag" argument isn't set/used in this insn, so drop it.
This fixes an unused variable warning in the generated sim.
|
|
I noticed a typo in a sim constant. This patch fixes it.
permenant -> permanent
|
|
The PRU architecture documentation [1] was used for the initial GNU
simulator implementation. But recently [2] TI confirmed the carry
behaviour was wrongly documented. In reality, the PRU carry behaves
like the carry in ARM processors.
This patch fixes simulator to align with latest recommendations from TI.
The new carry.s test was also validated to pass on real hardware -
a BeaglePlay board [3]. That test is a bit long because TI still
has not released official updates for the PRU documents. And I wanted
to ensure simulator handles all edge cases exactly as the real hardware
does.
[1] https://www.ti.com/lit/pdf/spruij2
[2] https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1244359/sk-am64b-am64x-pru-assembler-how-works-this-bloody-carry
[3] https://www.beagleboard.org/boards/beagleplay
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
|
|
Since newlib allows people to opt-in to extra errno names, pull them
into our table too. The values don't conflict with each other -- the
newlib names & values are distinct from newlib's Linux compatibility.
|
|
|
|
Since this function never returns, mark it as such to fix some unused
variable warnings in error code paths.
For example, cris triggers:
sim/cris/semcrisv10f-switch.c:3558:11: error:
variable 'tmp_newval' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
Even though it has an "else" path that calls this error function.
|
|
Integrate some changes from upstream cgen that tightened up the
generated output. Shouldn't be any functional changes here.
|
|
Since these insns don't do anything and are effectively ignored,
return early to avoid doing any common processing at the end as
that requires initializing variables like "res" with something.
|
|
The plds Dz,MACL insn stores the Dz bit into MACL. The current code
was storing the "res" variable into Dz and then into MACL, but not
setting "res" to anything. Delete that logic and make it match the
existing plds Dz,MACH insn.
|
|
The -Wshadow=local is too new for some compilers, so move it to a var
that we test at configure time.
|
|
Rename the var to avoid shadowing & clobbering the higher context.
|
|
Inline the one usage of sd in these macros to avoid possible shadowing.
|
|
Use a local name in the macro to avoid shadowing wherever it's used.
|
|
Delete redundant decls when the existing scope has the same var and
type available for use.
|
|
Delete redundant decls when the existing scope has the same var and
type available for use.
|
|
These decoders declare a lot of common variables for use by substeps,
and then shadows a few because of how the opc generator is implemented.
Easiest way around it is to rename the per-substep vars as needed as
anything more would require substantial changes to the opc logic.
|
|
Delete redundant decls.
|
|
Delete conflicting decls when the existing scope has vars of the same
name & type for this exact use.
|
|
Delete redundant decls, and rename conflicting vars.
|
|
Rename shadowed vars with different types to avoid confusion.
|
|
The mloop files include CGEN generated switch files which have some
nested assignments that expand into repeated shadowed variables.
Fixing this looks fairly non-trivial as it appears to be interplay
between the common CGEN code and how this particular set of cris
insns are defined. Disable the warning instead.
In file included from sim/cris/mloop.in:286:
sim/cris/semcrisv10f-switch.c: In function ‘crisv10f_engine_run_full’:
sim/cris/semcrisv10f-switch.c:12383:8: error: declaration of ‘opval’ shadows a previous local [-Werror=shadow=local]
12383 | SI opval = tmp_addr;
| ^~~~~
sim/cris/semcrisv10f-switch.c:12371:9: note: shadowed declaration is here
12371 | USI opval = ({ SI tmp_addr;
| ^~~~~
And the code looks like:
USI opval = ({
...
{
SI opval = tmp_addr;
...
}
...
});
Since the CGEN code treats "opval" as an internal variable that the cpu
definitions don't have direct access to, the likelihood of this being a
real bug is low, so leave it be. The warning is suppressed for more code
that is hand written (e.g. the mloop logic), but disabling for the entire
file is the easiest way to suppress while keeping it on everywhere else in
the sim.
|
|
Delete redundant local decls.
|
|
Rename shadowed vars with different types, and delete redundant decls.
|
|
Rename the shadowed var to avoid confusion with the function argument
as to which address this code is using.
|
|
Remove duplicate nested variable declarations, rename some to avoid
confusion when the type is different or the original value should be
retained, and fix some weirdness with nested enums in structs.
|
|
These functions have local vars named "val" of type float, and
then create nested vars named "val" of type double. This is a
bit confusing and causes build time warnings.
|
|
Use latest cgen to regenerate the decode tables which has some shadow
warning fixes with "val" variables.
|
|
Bug: https://sourceware.org/PR31181
|
|
We weren't using the enable_p flag to see whether the option should
be enabled or disabled, and we weren't breaking out when done parsing.
|
|
Older versions of gcc support this warning flag. We're already clean.
|
|
|
|
This emits #line 2 for the first line in the output when it should be 1.
|
|
This will make compiler diagnostics much better with generated code
so people can understand the original source file.
|
|
The generated mloop files can trigger compile time warnings. It can
be difficult to see/understand where the original code is coming from
as all the diagnostics point to the generated output. Using #line
pragmas, we can point people to the original source files.
Unfortunately, this code is written in POSIX shell, and that lacks
support for line number tracking. The $LINENO variable, even when
available, can just be plain wrong. For example, when using dash
and subshells, $LINENO can end up having negative values. Add a
wrapper script that will uses awk to rewrite the $LINENO variable
to the right value to avoid all that.
Basically lineno.sh takes an input script, rewrites all uses of
$LINENO into the actual line number (and $0 into the original file
name), and then executes the temporary script.
This commit doesn't actually add #line pragmas to any files. That
comes next.
|