aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2023-12-21sim: add ATTRIBUTE_FALLTHROUGH for local codeMike Frysinger2-0/+6
We'll replace various /* fall through */ comments so compilers can actually understand what the code is doing.
2023-12-21sim: signal: mark signal callback funcs as noreturn since they don't returnMike Frysinger11-11/+15
All funcs already call other funcs that don't return. The mips port is the only exception because its generic exception handler can return in the case of normal exceptions. So while the exceptions its signal handler triggers doesn't return, we can't express that conditional logic. So add some useless abort calls to make the compiler happy.
2023-12-21sim: sh: add missing breaks to bit processingMike Frysinger1-0/+6
Doesn't seem like we want to cascade in this section when bit processing.
2023-12-21sim: rx: mark abort func as noreturn since it doesn'tMike Frysinger1-1/+1
2023-12-21sim: rx: add missing break to memory writeMike Frysinger1-0/+1
It doesn't seem like we want to keep executing the next block of code after processing the request.
2023-12-21sim: iq2000: add fallback for exit syscallMike Frysinger1-0/+3
Make sure this syscall always exits regardless of the exit code.
2023-12-21sim: cr16: add missing break statementMike Frysinger1-0/+1
Doesn't seem to make sense for this to fall through (although I'm not an expert in this ISA).
2023-12-21sim: arm: add missing breaks to SWI processingMike Frysinger1-0/+2
Seems unlikely we want the remove syscall to fallthrough into the rename syscall since we can't rename files that have been removed.
2023-12-21sim: common: mark engine restart as noreturnMike Frysinger1-1/+1
This helps the compiler with optimization and fixes fallthru warnings.
2023-12-21sim: ppc: phb: add missing break to address decoderMike Frysinger1-0/+1
I don't know what this emulation does exactly, but it missing a break statement seems kind of obvious based on the 32-bit case above it.
2023-12-21sim: ppc: mark halt & restart funcs as noreturnMike Frysinger3-6/+6
This helps the compiler with optimization and fixes fallthru warnings.
2023-12-21sim: warnings: enable -Wduplicated-condMike Frysinger2-0/+2
2023-12-21sim: mn10300: fix LAST_TIMER_REG typoMike Frysinger1-1/+1
The compiler pointed out that we're testing LAST_TIMER_REG and LAST_COUNTER which are the same value ... and that's because we set LAST_TIMER_REG to the wrong register. Fix the typo.
2023-12-21sim: bfin: clean up astat reg name decode a littleMike Frysinger1-12/+14
The compiler pointed out we checked AZ twice. Sort by name to avoid that in the future, and to make it clearer that we have coverage of all the bits. And add the bits we were missing. The order here doesn't matter as it's just turning a pointer into a human readable string when store tracing is enabled.
2023-12-20sim: common: delete unused scache in some mloop pathsMike Frysinger1-4/+0
The scache vars aren't used by ports in the pbb & fast codepaths, nor are they documented as inputs to the callbacks, so delete them to avoid unused variable compiler warnings.
2023-12-20sim: cgen: unify the genmloop logic a bitMike Frysinger8-72/+64
Pull out the common parts of the genmloop invocation into the common code. This will make it easier to add more, and make the per-port differences a little more obvious.
2023-12-19sim: frv: enable warnings in memory.cMike Frysinger3-3/+1
Fix one minor pointer-sign warning to enable warnings in general for this file. Reading the data as signed and then returning it as unsigned should be functionally the same in this case.
2023-12-19sim: common: delete unused argbuf in generated mloop codeMike Frysinger1-2/+0
This function only uses prev_abuf, not abuf, and doesn't inline code from the various ports on the fly, so abuf will never be used.
2023-12-19sim: v850: fix -Wunused-variable warningsMike Frysinger1-1/+0
2023-12-19sim: sh: fix -Wunused-variable warningsMike Frysinger1-3/+1
2023-12-19sim: moxie: fix -Wunused-variable warningsMike Frysinger1-8/+1
2023-12-19sim: msp430: fix -Wunused-variable warningsMike Frysinger1-5/+2
2023-12-19sim: mn10300: fix -Wunused-variable warningsMike Frysinger2-9/+0
2023-12-19sim: mips: fix -Wunused-variable warningsMike Frysinger5-21/+12
2023-12-19sim: microblaze: fix -Wunused-variable warningsMike Frysinger1-6/+0
2023-12-19sim: mcore: fix -Wunused-variable warningsMike Frysinger1-4/+3
2023-12-19sim: m32r: fix -Wunused-variable warningsMike Frysinger1-2/+0
2023-12-19sim: lm32: fix -Wunused-variable warningsMike Frysinger4-15/+1
2023-12-19sim: iq2000: fix -Wunused-variable warningsMike Frysinger2-2/+0
2023-12-19sim: h8300: fix -Wunused-variable warningsMike Frysinger1-7/+0
2023-12-19sim: ft32: fix -Wunused-variable warningsMike Frysinger1-6/+0
2023-12-19sim: frv: fix -Wunused-variable warningsMike Frysinger6-19/+3
2023-12-19sim: erc32: fix -Wunused-variable warningsMike Frysinger3-5/+4
2023-12-19sim: cris: fix -Wunused-variable warningsMike Frysinger3-6/+0
2023-12-19sim: cr16: fix -Wunused-variable warningsMike Frysinger1-3/+2
2023-12-19sim: bpf: fix -Wunused-variable warningsMike Frysinger1-2/+0
2023-12-19sim: bfin: fix -Wunused-variable warningsMike Frysinger1-1/+0
2023-12-19sim: aarch64: fix -Wunused-variable warningsMike Frysinger1-1/+0
2023-12-19sim: common: fix -Wunused-variable warningsMike Frysinger6-14/+10
2023-12-19cpu: cris: drop some unused varsMike Frysinger2-5/+5
These fix unused variable warnings in the generated sim.
2023-12-18Yet another fix for mcore-sim (rotli)Jeff Law2-1/+32
This came up testing the CRC optimization work from Mariam@RAU. Basically to optimize some CRC loops into table lookups or carryless multiplies, we may need to do a bit reflection, which on the mcore processor is done using a rotate instruction. Unfortunately the simulator implementation of rotates has the exact same problem as we saw with right shifts. The input value may have been sign extended from 32 to 64 bits. When we rotate the extended value, we get those sign extension bits and thus the wrong result. The fix is the same. Rather than using a "long", use a uint32_t for the type of the temporary. This fixes a handful of tests in the GCC testsuite:
2023-12-17sim: warnings: add more flagsMike Frysinger2-0/+6
We already build cleanly with these.
2023-12-16sim: cr16: clean up unused insn operandsMike Frysinger1-4/+2
The push/pop insns only have 2 operands, so delete unused "c". The pushret/popret insns use 2 operands, but they don't implement the logic directly, they call the push/pop implementations. So delete the unused "a" & "b".
2023-12-15sim: sh: adjust some dsp insn masksMike Frysinger1-3/+3
The pmuls encoding is incorrect -- it looks like a copy & paste error from the padd pmuls variant. The SuperH software manual covers this. On the flip side, the manual lists pwsb & pwad as insns that exist, but no description of what they do, what the insn name means, or the actual encoding. Our sim implementation stubs them both out as nops. Let's mark the fields to avoid unused variable warnings.
2023-12-15sim: sh: tidy up gencode slightlyMike Frysinger1-68/+72
Mark a few things static/const, and clean up trailing whitespace.
2023-12-15sim: bfin: fix typo in bf52x portsMike Frysinger1-6/+6
These should be using the BF52x set of ports, not BF51x.
2023-12-15sim: warnings: enable -Wunused-but-set-variableMike Frysinger2-2/+2
2023-12-15sim: mn10300: fix incorrect implementation of a few insnsMike Frysinger1-7/+7
Fix a few problems caught by compiler warnings: * Some of the asr & lsr insns were setting up the c state flag, but then forgetting to set it in the PSW. Add it like the other asr & lsr variants. * Some of the dmulh insns were multiplying one of the source regs against itself instead of against the other source reg. * The sat16_cmp parallel insn was using the wrong register in the compare -- the reg1 src/dst pair are used in the sat16 op, and the reg2 src/dst pair are used in the add op.
2023-12-14sim: m32r: fix mloop.in variant stamp depsMike Frysinger2-4/+4
The migration to local.mk in commit 0a129eb19a773d930d60b084209570f663db2053 accidentally listed the deps for all mloop steps as mloop.in instead of the various variants that m32r uses. Reported-by: Simon Marchi <simon.marchi@polymtl.ca>
2023-12-14sim: m32r: use @cpu@_fill_argbuf_tp to set trace & profile stateMike Frysinger2-16/+8
The mloop.in code does this, but these variants do not. Use it to avoid unused function warnings. The fast_p logic in these files also looks off, but that'll require a bit more work to fixup. CC m32r/mloopx.o m32r/mloopx.c:37:1: error: ‘m32rxf_fill_argbuf_tp’ defined but not used [-Werror=unused-function] 37 | m32rxf_fill_argbuf_tp (const SIM_CPU *cpu, ARGBUF *abuf, | ^~~~~~~~~~~~~~~~~~~~~ CC m32r/mloop2.o m32r/mloop2.c:37:1: error: ‘m32r2f_fill_argbuf_tp’ defined but not used [-Werror=unused-function] 37 | m32r2f_fill_argbuf_tp (const SIM_CPU *cpu, ARGBUF *abuf, | ^~~~~~~~~~~~~~~~~~~~~ Reported-by: Simon Marchi <simon.marchi@polymtl.ca> Tested-By: Simon Marchi <simon.marchi@polymtl.ca>