Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
It caught some legitimate bugs, so clearly it's helpful.
|
|
These generate conditional insns where it tests, then fallsthru.
|
|
Replace some fall through comments with the attribute.
|
|
Seems like this code was meant to fallthru.
|
|
|
|
Replace some fall through comments with the attribute.
|
|
Replace some fall through comments with the attribute.
|
|
Seems like these cases were meant to fallthru.
|
|
Seems like these decodes were intended to fallthru.
|
|
Seems like these register operations intended on falling thru.
|
|
Replace some fall through comments with the attribute.
|
|
Add the attribute where it seems to make sense.
|
|
Replace some fall through comments with the attribute.
|
|
Add the attribute to places where we want to fall thru.
|
|
Replace some fall through comments with the attribute.
|
|
Replace some fall through comments with the attribute.
|
|
Replace some fall through comments with the attribute, and add some
default abort calls when the compiler can't figure out that the set
of values were already fully enumerated in the switch statement.
|
|
Replace some fall through comments with the attribute.
|