target-xtensa: add extui unit test

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: add fallthrough markers

Explicitly mark cases where we are deliberately falling through to the
following code.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: avoid double-stopping at breakpoints

env->exception_taken is set every time an exception is taken. It is used
to allow single-stepping to stop at the first exception handler
instruction. This however must exclude debug exceptions, as otherwise
first step from the instruction where breakpoint was hit stops at that
same instruction.
Also don't check env->exception_taken directly from the
gen_intermediate_code_internal, instead allocate and use TB flag
XTENSA_TBFLAG_EXCEPTION.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
tests/tcg/xtensa: Fix out-of-tree build

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: don't generate dead code to access invalid SRs

This fixes the following test failure caused by access to undefined SR:

    qemu-system-xtensa -M sim -cpu dc232b -nographic -semihosting  -kernel ./test_sr.tst
    QEMU 1.4.50 monitor - type 'help' for more information
    (qemu) QEMU 1.4.50 monitor - type 'help' for more information
    (qemu) qemu-system-xtensa: tcg/tcg.c:1673: temp_save: Assertion `s->temps[temp].val_type == 2 || s->temps[temp].fixed_reg' failed.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: check register window inline

This lowers time spent in helper_window_check as reported by perf top
from ~8% to ~0.15% accelerating register-intensive tests by ~20%.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: implement RER/WER instructions

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: add static vectors selection

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: hack-fix gdbstub registers size

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: add test_mmuhifi_c3 core

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
WIP: target-xtensa: add MX interrupt distributor

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: improve spin locking performance

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: WIP: support icount

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: add MX support to sim machine

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: add SMP tests

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: refactor CCOUNT/CCOMPARE

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
SMP WIP

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: add SMP scheduling timer to MX

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
gdbstub: fix sThreadInfo handler

After the commit 182735e cpu: Make first_cpu and next_cpu CPUState
we can no longer blindly use cpu->next_cpu->env_ptr to get CPUArchState
of the next CPU, as the next_cpu is NULL in the last CPU.

This fixes segfault caused by gdb command 'info threads'.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: record and dump execution trace

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

Conflicts:

	target-xtensa/cpu.h

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>