running TCG tests for xtensaeb

2021-10-01 Thread Max Filippov
Hi Alex, I've tried to use make check-tcg CORE=test_kc705_be CROSS_CC_GUEST=xtensa-test_kc705_be-elf-gcc to run TCG tests for a big-endian xtensa core. I thought the following change would be sufficient to do it: ---8<--- diff --git a/tests/tcg/xtensa/Makefile.softmmu-target

Re: [PATCH v3 40/41] target/xtensa: Make xtensa_cpu_tlb_fill sysemu only

2021-10-01 Thread Max Filippov
On Fri, Oct 1, 2021 at 10:15 AM Richard Henderson wrote: > > The fallback code in raise_sigsegv is sufficient for xtensa. > Remove the code from cpu_loop that raised SIGSEGV. > > Cc: Max Filippov > Signed-off-by: Richard Henderson > --- > target/xtensa/cpu.h

Re: [PATCH v2 49/53] target/xtensa: convert to use format_tlb callback

2021-09-15 Thread Max Filippov
On Tue, Sep 14, 2021 at 7:35 AM Daniel P. Berrangé wrote: > > Change the "info tlb" implementation to use the format_tlb callback. > > Signed-off-by: Daniel P. Berrangé > --- > target/xtensa/cpu.h| 2 +- > target/xtensa/mmu_helper.c | 126 + >

Re: [PATCH v2 27/53] target/xtensa: convert to use format_state instead of dump_state

2021-09-15 Thread Max Filippov
On Wed, Sep 15, 2021 at 12:32 AM Philippe Mathieu-Daudé wrote: > On 9/14/21 4:20 PM, Daniel P. Berrangé wrote: > > if ((flags & CPU_DUMP_FPU) && > > xtensa_option_enabled(env->config, XTENSA_OPTION_FP_COPROCESSOR)) { > > -qemu_fprintf(f, "\n"); > > +

Re: [PATCH v2 19/55] target/xtensa: Implement do_unaligned_access for user-only

2021-08-02 Thread Max Filippov
On Mon, Aug 2, 2021 at 9:15 PM Richard Henderson wrote: > > Cc: Max Filippov > Signed-off-by: Richard Henderson > --- > target/xtensa/cpu.c| 2 +- > target/xtensa/helper.c | 30 +++--- > 2 files changed, 16 insertions(+), 16 deletions(-) A

Re: [PATCH] target/xtensa/xtensa-semi: Fix compilation problem on Haiku

2021-07-06 Thread Max Filippov
; 1 file changed, 39 insertions(+), 45 deletions(-) Acked-by: Max Filippov -- Thanks. -- Max

Re: [PATCH 26/26] target/xtensa: Use translator_use_goto_tb

2021-06-21 Thread Max Filippov
On Sun, Jun 20, 2021 at 6:34 PM Richard Henderson wrote: > > Cc: Max Filippov > Signed-off-by: Richard Henderson > --- > target/xtensa/translate.c | 6 +- > 1 file changed, 1 insertion(+), 5 deletions(-) Reviewed-by: Max Filippov -- Thanks. -- Max

Re: [PATCH 01/26] accel/tcg: Introduce translator_use_goto_tb

2021-06-21 Thread Max Filippov
insertions(+) Reviewed-by: Max Filippov -- Thanks. -- Max

Re: [PATCH 01/21] linux-user: Add infrastructure for a signal trampoline page

2021-06-16 Thread Max Filippov
inux-user/qemu.h| 7 +++ > linux-user/elfload.c | 17 + > linux-user/signal.c | 3 +++ > 3 files changed, 27 insertions(+) Reviewed-by: Max Filippov -- Thanks. -- Max

Re: [PATCH 20/21] linux-user/xtensa: Implement setup_sigtramp

2021-06-16 Thread Max Filippov
On Tue, Jun 15, 2021 at 6:12 PM Richard Henderson wrote: > > Create and record the rt signal trampoline. > Use it when the guest does not use SA_RESTORER. > > Cc: Max Filippov > Signed-off-by: Richard Henderson > --- > linux-user/xtensa/target_signal.h | 2 ++ >

[PULL 0/3] target/xtensa updates

2021-05-21 Thread Max Filippov
updates for v6.1: - don't generate extra EXCP_DEBUG on exception - fix l32ex access ring - clean up unaligned access Max Filippov (3): target/xtensa: don't generate extra EXCP_DEBUG on exception target/xtensa: fix access

[PATCH v2] target/xtensa: fix access ring in l32ex

2021-05-19 Thread Max Filippov
in an exception when the correct implementation would've succeeded. In no case it would allow memory access that would've raised an exception in the correct implementation. Cc: qemu-sta...@nongnu.org Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Max Filippov --- Changes v1->v2: - add correctness/secur

[PATCH v4] target/xtensa: clean up unaligned access

2021-05-19 Thread Max Filippov
and alignment requirements in single parameter. Drop condition from xtensa_cpu_do_unaligned_access and replace it with assertion. Add a test. Suggested-by: Philippe Mathieu-Daudé Suggested-by: Richard Henderson Signed-off-by: Max Filippov --- Changes v3->v4: - do additional clea

[PATCH] target/xtensa: fix access ring in l32ex

2021-05-19 Thread Max Filippov
l32ex does memory access as all regular load/store operations at CRING level. Fix apparent pasto from l32e that caused it to use RING instead. Cc: qemu-sta...@nongnu.org Signed-off-by: Max Filippov --- target/xtensa/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH v3] target/xtensa: clean up unaligned access

2021-05-18 Thread Max Filippov
Hi Richard, On Tue, May 18, 2021 at 1:11 PM Richard Henderson wrote: > On 5/17/21 3:52 PM, Max Filippov wrote: > > @@ -1784,10 +1770,11 @@ static void translate_l32e(DisasContext *dc, const > > OpcodeArg arg[], > > const uint32_t par[]) >

[PATCH v3] target/xtensa: clean up unaligned access

2021-05-17 Thread Max Filippov
. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Max Filippov --- Changes v2->v3: - drop assertion for !XTENSA_OPTION_HW_ALIGNMENT from xtensa_cpu_do_unaligned_access to correctly handle acquire/release intsructions; - add tests for acquire/release instructions. Changes v1->v2: - cor

[PATCH v2] target/xtensa: clean up unaligned access

2021-05-17 Thread Max Filippov
. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Max Filippov --- Changes v1->v2: - correctly handle case of !XCHAL_UNALIGNED_*_EXCEPTION in the test target/xtensa/helper.c | 14 +-- target/xtensa/translate.c | 108 tests/tcg/xtensa/test_load_store.S |

[PATCH] target/xtensa: clean up unaligned access

2021-05-17 Thread Max Filippov
. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Max Filippov --- target/xtensa/helper.c | 14 +-- target/xtensa/translate.c | 108 ++-- tests/tcg/xtensa/test_load_store.S | 156 + 3 files changed, 217 insertions(+), 61 deletions

Re: [Qemu-devel] [PATCH 7/7] target/xtensa: move non-HELPER functions to helper.c

2021-05-17 Thread Max Filippov
On Mon, May 17, 2021 at 9:54 AM Philippe Mathieu-Daudé wrote: > > On 5/17/21 5:35 PM, Max Filippov wrote: > > On Mon, May 17, 2021 at 8:25 AM Max Filippov wrote: > >> > >> On Mon, May 17, 2021 at 6:10 AM Philippe Mathieu-Daudé > >> wrote: > >&g

Re: [Qemu-devel] [PATCH 7/7] target/xtensa: move non-HELPER functions to helper.c

2021-05-17 Thread Max Filippov
On Mon, May 17, 2021 at 8:25 AM Max Filippov wrote: > > On Mon, May 17, 2021 at 6:10 AM Philippe Mathieu-Daudé > wrote: > > > > On 5/17/21 2:11 PM, Max Filippov wrote: > > > On Mon, May 17, 2021 at 4:50 AM Max Filippov wrote: > > >> > > >>

Re: [Qemu-devel] [PATCH 7/7] target/xtensa: move non-HELPER functions to helper.c

2021-05-17 Thread Max Filippov
On Mon, May 17, 2021 at 6:10 AM Philippe Mathieu-Daudé wrote: > > On 5/17/21 2:11 PM, Max Filippov wrote: > > On Mon, May 17, 2021 at 4:50 AM Max Filippov wrote: > >> > >> Hi Philippe, > >> > >> On Sun, May 16, 2021 at 10:05 PM Philip

Re: [Qemu-devel] [PATCH 7/7] target/xtensa: move non-HELPER functions to helper.c

2021-05-17 Thread Max Filippov
On Mon, May 17, 2021 at 4:50 AM Max Filippov wrote: > > Hi Philippe, > > On Sun, May 16, 2021 at 10:05 PM Philippe Mathieu-Daudé > wrote: > > > > Hi Max, > > > > On Mon, Jan 14, 2019 at 8:52 AM Max Filippov wrote: > > > > > > Move re

Re: [Qemu-devel] [PATCH 7/7] target/xtensa: move non-HELPER functions to helper.c

2021-05-17 Thread Max Filippov
Hi Philippe, On Sun, May 16, 2021 at 10:05 PM Philippe Mathieu-Daudé wrote: > > Hi Max, > > On Mon, Jan 14, 2019 at 8:52 AM Max Filippov wrote: > > > > Move remaining non-HELPER functions from op_helper.c to helper.c. > > No functional changes. >

[PATCH] target/xtensa: don't generate extra EXCP_DEBUG on exception

2021-04-15 Thread Max Filippov
ecise single-stepping after an exception") ba3c35d9c402 ("tcg/cpu-exec: precise single-stepping after an interrupt") Drop exception state tracking/extra EXCP_DEBUG generation code. Signed-off-by: Max Filippov --- This patch depends on the "target/xtensa: Make sure that tb->size

Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-15 Thread Max Filippov
On Thu, Apr 15, 2021 at 8:03 AM Peter Maydell wrote: > > On Thu, 15 Apr 2021 at 02:24, Max Filippov wrote: > > I see a few places where target/xtensa may do that. E.g. it does that on > > entry > > to an exception handler to allow for debugging its first instruct

Re: [PATCH v4 3/4] target/xtensa: Make sure that tb->size != 0

2021-04-15 Thread Max Filippov
> 1 file changed, 3 insertions(+) Tested-by: Max Filippov Acked-by: Max Filippov -- Thanks. -- Max

Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-14 Thread Max Filippov
On Wed, Apr 14, 2021 at 12:43 PM Richard Henderson wrote: > > On 4/14/21 11:03 AM, Max Filippov wrote: > > On Wed, Apr 14, 2021 at 9:51 AM Ilya Leoshkevich wrote: > >> On Wed, 2021-04-14 at 16:48 +0200, David Hildenbrand wrote: > >>> Did you double-check the xten

Re: [PATCH v3 3/3] accel/tcg: Assert that tb->size != 0 after translation

2021-04-14 Thread Max Filippov
On Wed, Apr 14, 2021 at 9:51 AM Ilya Leoshkevich wrote: > On Wed, 2021-04-14 at 16:48 +0200, David Hildenbrand wrote: > > Did you double-check the xtensa issue? > > Oh, I'm sorry, I completely forgot about that one. I just ran the > test locally, and apparently it fails because of this new

[PULL 0/2] target/xtensa fixes for v6.0

2021-04-03 Thread Max Filippov
up all available xtensa core definitions; - don't modify Makefile.objs in import_core.sh; - add sed rule to import_core.sh to make xtensa_modules variable static. Max Filippov (2): target/xtensa: fix meson.build rule for xtensa

[PATCH] target/xtensa: fix meson.build rule for xtensa cores

2021-04-02 Thread Max Filippov
import_core.sh tries to change Makefile.objs when importing new xtensa core, but that file no longer exists. Rewrite meson.build rule to pick up all source files that match core-*.c pattern and drop commands that change Makefile.objs. Cc: qemu-sta...@nongnu.org # v5.2.0 Signed-off-by: Max

Re: [PATCH] target/xtensa: fix core import to meson.build

2021-03-30 Thread Max Filippov
On Tue, Mar 30, 2021 at 1:32 PM Richard Henderson wrote: > On 3/30/21 1:30 AM, Max Filippov wrote: > > -grep -q core-${NAME}.o "$BASE"/Makefile.objs || \ > > -echo "obj-y += core-${NAME}.o" >> "$BASE"/Makefile.objs > > +grep

[PATCH] target/xtensa: fix core import to meson.build

2021-03-30 Thread Max Filippov
import_core.sh was not updated to change meson.build when new xtensa core is imported. Fix that. Cc: qemu-sta...@nongnu.org # v5.2.0 Signed-off-by: Max Filippov --- target/xtensa/import_core.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/xtensa/import_core.sh

[PATCH] target/xtensa: make xtensa_modules static on import

2021-03-30 Thread Max Filippov
xtensa_modules variable defined in each xtensa-modules.c.inc is only used locally by the including file. Make it static. Signed-off-by: Max Filippov --- target/xtensa/import_core.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/target/xtensa/import_core.sh b/target/xtensa/import_core.sh

Re: [PATCH] [NFC] Mark locally used symbols as static.

2021-03-22 Thread Max Filippov
es.c.inc | 2 +- > .../xtensa-modules.c.inc | 2 +- > .../core-test_kc705_be/xtensa-modules.c.inc | 2 +- > .../core-test_mmuhifi_c3/xtensa-modules.c.inc | 2 +- > 21 files changed, 125 insertions(+), 127 deletions(-) For the xtensa part: Acked-by: Ma

Re: [PATCH 4/8] target/xtensa: Replaced malloc/free with GLib's variants

2021-03-14 Thread Max Filippov
; > -intisa->interface_lookup_table = 0; > -} > +g_free(intisa->interface_lookup_table); > +intisa->interface_lookup_table = 0; Ditto. > > -if (intisa->funcUnit_lookup_table) { > -free(intisa->funcUnit_lookup_table); > -intisa->funcUnit_lookup_table = 0; > -} > +g_free(intisa->funcUnit_lookup_table); > +intisa->funcUnit_lookup_table = 0; Ditto. With the above changes: Acked-by: Max Filippov -- Thanks. -- Max

Re: [PATCH 3/4] hw/xtensa/xtfpga: Get pflash MemoryRegion with sysbus_mmio_get_region()

2021-03-08 Thread Max Filippov
fi01_get_memory() helper. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/xtensa/xtfpga.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Acked-by: Max Filippov -- Thanks. -- Max

Re: [PATCH 1/6] target/xtensa: fix uninitialized variable warning

2020-11-03 Thread Max Filippov
> > Add a default value for 'rf' to prevented the warning. I don't see it doing default build with gcc 8.3. But then I don't see -Wmaybe-uninitialized in the compiler command line either. > Reported-by: Euler Robot > Signed-off-by: Chen Qun > --- > Cc: Max Filippov > ---

[PATCH] target/xtensa: enable all coprocessors for linux-user

2020-08-29 Thread Max Filippov
Linux userspace always sees coprocessors as enabled. CPENABLE register and coprocessor exceptions are used internally by the kernel to manage lazy coprocessor context switch. None of it is needed for linux-user. Always enable all coprocessors for user emulation. Signed-off-by: Max Filippov

Re: [PULL v2 00/24] target/xtensa updates for 5.2

2020-08-24 Thread Max Filippov
On Mon, Aug 24, 2020 at 2:33 PM Peter Maydell wrote: > On Sat, 22 Aug 2020 at 20:48, Max Filippov wrote: > > On Sat, Aug 22, 2020 at 3:20 AM Philippe Mathieu-Daudé > > wrote: > > > > > > Where does that come from? > > > > Generated by xtensa process

Re: [PULL v2 00/24] target/xtensa updates for 5.2

2020-08-22 Thread Max Filippov
On Sat, Aug 22, 2020 at 3:20 AM Philippe Mathieu-Daudé wrote: > On 8/21/20 10:50 PM, Max Filippov wrote: > > please pull the following batch of updates for target/xtensa. > > 3.12MiB of generated data... > > Where does that come from? Generated by xtensa processor gene

[PULL v2 00/24] target/xtensa updates for 5.2

2020-08-21 Thread Max Filippov
FPU. ---- Max Filippov (24): target/xtensa: make opcode properties more dynamic target/xtensa: implement NMI support softfloat: make NO_SIGNALING_NANS runtime property softfloat: pass float_status pointer to pick

Re: [PULL 00/24] target/xtensa updates for 5.2

2020-08-21 Thread Max Filippov
On Fri, Aug 21, 2020 at 9:24 AM Peter Maydell wrote: > On Thu, 13 Aug 2020 at 00:24, Max Filippov wrote: > > please pull the following batch of updates for target/xtensa. > > Hi; this conflicts with the meson buildsystem merge, I'm > afraid -- can you rebase and res

[PULL 00/24] target/xtensa updates for 5.2

2020-08-12 Thread Max Filippov
implementation; - update FPU tests to support both FPU2000 and DFPU; - add example cores with FPU2000 and DFPU. Max Filippov (24): target/xtensa: make opcode properties more dynamic target/xtensa: implement NMI support

Re: [PATCH v2 2/3] linux-user: Add missing termbits types and values definitions

2020-07-23 Thread Max Filippov
On Thu, Jul 23, 2020 at 2:25 PM Max Filippov wrote: > > On Thu, Jul 23, 2020 at 2:04 PM Filip Bozuta wrote: > > > > This patch introduces missing target types ('target_flag_t', 'target_cc_t', > > 'target_speed_t') in a few 'termibts.h' header files. Also, two missing &

Re: [PATCH v2 2/3] linux-user: Add missing termbits types and values definitions

2020-07-23 Thread Max Filippov
On Thu, Jul 23, 2020 at 2:04 PM Filip Bozuta wrote: > > This patch introduces missing target types ('target_flag_t', 'target_cc_t', > 'target_speed_t') in a few 'termibts.h' header files. Also, two missing > values ('TARGET_IUTF8' and 'TARGET_EXTPROC') were also added. These values > were also

[PATCH v4 17/22] tests/tcg/xtensa: update test_lsc for DFPU

2020-07-11 Thread Max Filippov
DFPU doesn't have pre-increment FP load/store opcodes, it has post-increment opcodes instead. Test increment opcodes present in the current config. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_lsc.S | 47 +++-- 1 file changed, 34 insertions(+), 13

[PATCH v4 19/22] tests/tcg/xtensa: test double precision load/store

2020-07-11 Thread Max Filippov
Add ldi[p]/sdi[p]/ldx[p]/sdx[p] opcode tests to test_lsc. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_lsc.S | 123 1 file changed, 123 insertions(+) diff --git a/tests/tcg/xtensa/test_lsc.S b/tests/tcg/xtensa/test_lsc.S index 9d59c1815a9e

[PATCH v4 18/22] tests/tcg/xtensa: add fp0 div and sqrt tests

2020-07-11 Thread Max Filippov
Test exact division/sqrt DFPU sequences. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_fp0_div.S | 82 tests/tcg/xtensa/test_fp0_sqrt.S | 76 + 2 files changed, 158 insertions(+) create mode 100644 tests/tcg/xtensa

[PATCH v4 15/22] tests/tcg/xtensa: update test_fp0_conv for DFPU

2020-07-11 Thread Max Filippov
DFPU conversion opcodes update FSR flags. Add FSR parameters and expected FSR register values for the conversion tests. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_fp0_conv.S | 299 --- 1 file changed, 155 insertions(+), 144 deletions(-) diff --git a/tests

[PATCH v4 13/22] tests/tcg/xtensa: update test_fp0_arith for DFPU

2020-07-11 Thread Max Filippov
DFPU arithmetic opcodes update FSR flags. Add FSR parameters and expected FSR register values for the arithmetic tests. Signed-off-by: Max Filippov --- tests/tcg/xtensa/fpu.h| 142 tests/tcg/xtensa/test_fp0_arith.S | 178 ++ 2

[PATCH v4 16/22] tests/tcg/xtensa: update test_fp1 for DFPU

2020-07-11 Thread Max Filippov
DFPU sets Invalid flag in FSR when at least one argument of FP comparison opcodes is NaN, SNaN for most opcodes, any NaN for olt/ole. Add checks for FSR and expected FSR values. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_fp1.S | 62 - 1 file

[PATCH v4 14/22] tests/tcg/xtensa: expand madd tests

2020-07-11 Thread Max Filippov
Test that madd doesn't do rounding after multiplication. Test NaN propagation rules for FPU2000 and DFPU madd opcode. Signed-off-by: Max Filippov --- Changes v2->v3: - add more infzero tests for FPU2000 and DFPU tests/tcg/xtensa/test_fp0_arith.S | 104 ++ 1 f

[PATCH v4 10/22] target/xtensa: add DFPU registers and opcodes

2020-07-11 Thread Max Filippov
precision opcodes. Add 64-bit register file. Add 64-bit values dumping to the xtensa_cpu_dump_state. Signed-off-by: Max Filippov --- Changes v3->v4: - split into two patches - add single-precision helpers that call set_use_first_nan - call fpu2k helpers or the new helper depending on whether D

[PATCH v4 12/22] tests/tcg/xtensa: fix test execution on ISS

2020-07-11 Thread Max Filippov
Space for test results may be allocated in IRAM which is only word-accessible. Use full 32-bit words to access test results. Signed-off-by: Max Filippov --- tests/tcg/xtensa/macros.inc | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/tcg/xtensa/macros.inc b

[PATCH v4 20/22] tests/tcg/xtensa: add DFP0 arithmetic tests

2020-07-11 Thread Max Filippov
Add test for basic double precision opcode properties. Signed-off-by: Max Filippov --- Changes v2->v3: - add more infzero tests for DFPU - fix test names in test_dfp0_arith.S tests/tcg/xtensa/test_dfp0_arith.S | 162 + 1 file changed, 162 insertions(+) create m

[PATCH v4 08/22] target/xtensa: don't access BR regfile directly

2020-07-11 Thread Max Filippov
BR registers used in FPU comparison opcodes are available as opcode arguments for translators. Use them. This simplifies comparison helpers interface and makes them usable in FLIX bundles. Reviewed-by: Richard Henderson Signed-off-by: Max Filippov --- target/xtensa/fpu_helper.c | 42

[PATCH v4 09/22] target/xtensa: add DFPU option

2020-07-11 Thread Max Filippov
accumulates inValid, division by Zero, Overflow, Underflow and Inexact result flags of operations; - QNaNs and SNaNs are handled properly; - NaN propagation rules are different. Signed-off-by: Max Filippov --- Changes v3->v4: - new patch split from the next one target/xtensa/cpu.h |

[PATCH v4 11/22] target/xtensa: implement FPU division and square root

2020-07-11 Thread Max Filippov
, most of them as nops, but the results of div/sqrt sequences is preserved. Signed-off-by: Max Filippov --- target/xtensa/fpu_helper.c | 24 + target/xtensa/helper.h | 4 ++ target/xtensa/translate.c | 104 + 3 files changed, 132 insertions

[PATCH v4 07/22] target/xtensa: move FSR/FCR register accessors

2020-07-11 Thread Max Filippov
Move FSR/FCR register accessors from core opcodes to FPU2000 opcodes as they are FPU2000-specific. Reviewed-by: Richard Henderson Signed-off-by: Max Filippov --- target/xtensa/translate.c | 64 +++ 1 file changed, 32 insertions(+), 32 deletions(-) diff

[PATCH v4 05/22] target/xtensa: support copying registers up to 64 bits wide

2020-07-11 Thread Max Filippov
FLIX dependency breaking code assumes that all registers are 32 bit wide. This may not always be correct. Extract actual register width from the associated register file and use it to create temporaries of correct width and generate correct data movement instructions. Signed-off-by: Max Filippov

[PATCH v4 06/22] target/xtensa: rename FPU2000 translators and helpers

2020-07-11 Thread Max Filippov
Add _s suffix to all FPU2000 opcode translators and helpers that also have double-precision variant to unify naming and allow adding DFPU implementations. Add _fpu2k_ to the names of helpers that will have different implementation for the DFPU . Reviewed-by: Richard Henderson Signed-off-by: Max

[PATCH v4 04/22] target/xtensa: add geometry to xtensa_get_regfile_by_name

2020-07-11 Thread Max Filippov
Register file name may not uniquely identify a register file in the set of configurations. E.g. floating point registers may have different size in different configurations. Use register file geometry as additional identifier. Signed-off-by: Max Filippov --- target/xtensa/cpu.h | 2

[PATCH v4 02/22] softfloat: pass float_status pointer to pickNaN

2020-07-11 Thread Max Filippov
y: Richard Henderson Signed-off-by: Max Filippov --- fpu/softfloat-specialize.inc.c | 30 -- fpu/softfloat.c | 2 +- include/fpu/softfloat-helpers.h | 5 + include/fpu/softfloat-types.h | 1 + 4 files changed, 31 insertions(+), 7 deletions(-) diff -

[PATCH v4 01/22] softfloat: make NO_SIGNALING_NANS runtime property

2020-07-11 Thread Max Filippov
implementations coexist. Cc: Peter Maydell Cc: "Alex Bennée" Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Max Filippov --- Changes v1->v2: - use inline function for no_signaling_nans property to allow for con

[PATCH v4 00/22] target/xtensa: implement double precision FPU

2020-07-11 Thread Max Filippov
istent with other core names Changes v1->v2: - use inline function for no_signaling_nans property to allow for constant folding on architectures that have this property fixed. Max Filippov (22): softfloat: make NO_SIGNALING_NANS runtime property softfloat: pass float_status pointer t

[PATCH v4 03/22] softfloat: add xtensa specialization for pickNaNMulAdd

2020-07-11 Thread Max Filippov
flag is always set when (a * b) produces NaN. Cc: Peter Maydell Cc: "Alex Bennée" Cc: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Max Filippov --- Changes v2->v3: - handle infzero case in pickNaNMulAdd properly and reword commit message fpu/softfloat-speciali

Re: [PATCH 09/21] target/xtensa: add DFP option, registers and opcodes

2020-07-08 Thread Max Filippov
On Wed, Jul 8, 2020 at 5:19 PM Richard Henderson wrote: > Do I read that right, [...] > means that if DFP is present, float64 has use_first_nan, but float32 does > not?!? That's correct. And float64 madd.d/msub.d again don't have it. > What in the world is going on? My thoughts exactly. What

[PATCH v3 18/21] tests/tcg/xtensa: test double precision load/store

2020-07-08 Thread Max Filippov
Add ldi[p]/sdi[p]/ldx[p]/sdx[p] opcode tests to test_lsc. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_lsc.S | 123 1 file changed, 123 insertions(+) diff --git a/tests/tcg/xtensa/test_lsc.S b/tests/tcg/xtensa/test_lsc.S index 9d59c1815a9e

[PATCH v3 12/21] tests/tcg/xtensa: update test_fp0_arith for DFPU

2020-07-08 Thread Max Filippov
DFPU arithmetic opcodes update FSR flags. Add FSR parameters and expected FSR register values for the arithmetic tests. Signed-off-by: Max Filippov --- tests/tcg/xtensa/fpu.h| 142 tests/tcg/xtensa/test_fp0_arith.S | 178 ++ 2

[PATCH v3 11/21] tests/tcg/xtensa: fix test execution on ISS

2020-07-08 Thread Max Filippov
Space for test results may be allocated in IRAM which is only word-accessible. Use full 32-bit words to access test results. Signed-off-by: Max Filippov --- tests/tcg/xtensa/macros.inc | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/tcg/xtensa/macros.inc b

[PATCH v3 04/21] target/xtensa: add geometry to xtensa_get_regfile_by_name

2020-07-08 Thread Max Filippov
Register file name may not uniquely identify a register file in the set of configurations. E.g. floating point registers may have different size in different configurations. Use register file geometry as additional identifier. Signed-off-by: Max Filippov --- target/xtensa/cpu.h | 2

[PATCH v3 03/21] softfloat: add xtensa specialization for pickNaNMulAdd

2020-07-08 Thread Max Filippov
flag is always set when (a * b) produces NaN. Cc: Peter Maydell Cc: "Alex Bennée" Cc: Richard Henderson Signed-off-by: Max Filippov --- Changes v2->v3: - handle infzero case in pickNaNMulAdd properly and reword commit message fpu/softfloat-specialize.inc.c | 26

[PATCH v3 02/21] softfloat: pass float_status pointer to pickNaN

2020-07-08 Thread Max Filippov
Pass float_status structure pointer to the pickNaN so that machine-specific settings are available to NaN selection code. Add use_first_nan property to float_status and use it in Xtensa-specific pickNaN. Cc: Peter Maydell Cc: "Alex Bennée" Reviewed-by: Alex Bennée Signed-off-by: Ma

[PATCH v3 01/21] softfloat: make NO_SIGNALING_NANS runtime property

2020-07-08 Thread Max Filippov
implementations coexist. Cc: Peter Maydell Cc: "Alex Bennée" Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Max Filippov --- Changes v1->v2: - use inline function for no_signaling_nans property to allow for constant folding on architectures that have

[PATCH v3 16/21] tests/tcg/xtensa: update test_lsc for DFPU

2020-07-08 Thread Max Filippov
DFPU doesn't have pre-increment FP load/store opcodes, it has post-increment opcodes instead. Test increment opcodes present in the current config. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_lsc.S | 47 +++-- 1 file changed, 34 insertions(+), 13

[PATCH v3 15/21] tests/tcg/xtensa: update test_fp1 for DFPU

2020-07-08 Thread Max Filippov
DFPU sets Invalid flag in FSR when at least one argument of FP comparison opcodes is NaN, SNaN for most opcodes, any NaN for olt/ole. Add checks for FSR and expected FSR values. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_fp1.S | 62 - 1 file

[PATCH v3 19/21] tests/tcg/xtensa: add DFP0 arithmetic tests

2020-07-08 Thread Max Filippov
Add test for basic double precision opcode properties. Signed-off-by: Max Filippov --- Changes v2->v3: - add more infzero tests for DFPU - fix test names in test_dfp0_arith.S tests/tcg/xtensa/test_dfp0_arith.S | 162 + 1 file changed, 162 insertions(+) create m

[PATCH v3 14/21] tests/tcg/xtensa: update test_fp0_conv for DFPU

2020-07-08 Thread Max Filippov
DFPU conversion opcodes update FSR flags. Add FSR parameters and expected FSR register values for the conversion tests. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_fp0_conv.S | 299 --- 1 file changed, 155 insertions(+), 144 deletions(-) diff --git a/tests

[PATCH v3 09/21] target/xtensa: add DFP option, registers and opcodes

2020-07-08 Thread Max Filippov
precision opcodes. Add 64-bit register file. Add 64-bit values dumping to the xtensa_cpu_dump_state. Signed-off-by: Max Filippov --- target/xtensa/cpu.c |4 + target/xtensa/cpu.h |4 + target/xtensa/fpu_helper.c | 252 +++- target/xtensa/helper.h | 29

[PATCH v3 06/21] target/xtensa: rename FPU2000 translators and helpers

2020-07-08 Thread Max Filippov
Add _s suffix to all FPU2000 opcode translators and helpers that also have double-precision variant to unify naming and allow adding DFPU implementations. Add _fpu2k_ to the name of wur_fcr helper to make space for the DFPU wur_fcr helper. Reviewed-by: Richard Henderson Signed-off-by: Max

[PATCH v3 17/21] tests/tcg/xtensa: add fp0 div and sqrt tests

2020-07-08 Thread Max Filippov
Test exact division/sqrt DFPU sequences. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_fp0_div.S | 82 tests/tcg/xtensa/test_fp0_sqrt.S | 76 + 2 files changed, 158 insertions(+) create mode 100644 tests/tcg/xtensa

[PATCH v3 10/21] target/xtensa: implement FPU division and square root

2020-07-08 Thread Max Filippov
, most of them as nops, but the results of div/sqrt sequences is preserved. Signed-off-by: Max Filippov --- target/xtensa/fpu_helper.c | 24 + target/xtensa/helper.h | 4 ++ target/xtensa/translate.c | 104 + 3 files changed, 132 insertions

[PATCH v3 13/21] tests/tcg/xtensa: expand madd tests

2020-07-08 Thread Max Filippov
Test that madd doesn't do rounding after multiplication. Test NaN propagation rules for FPU2000 and DFPU madd opcode. Signed-off-by: Max Filippov --- Changes v2->v3: - add more infzero tests for FPU2000 and DFPU tests/tcg/xtensa/test_fp0_arith.S | 104 ++ 1 f

[PATCH v3 08/21] target/xtensa: don't access BR regfile directly

2020-07-08 Thread Max Filippov
BR registers used in FPU comparison opcodes are available as opcode arguments for translators. Use them. This simplifies comparison helpers interface and makes them usable in FLIX bundles. Reviewed-by: Richard Henderson Signed-off-by: Max Filippov --- target/xtensa/fpu_helper.c | 42

[PATCH v3 07/21] target/xtensa: move FSR/FCR register accessors

2020-07-08 Thread Max Filippov
Move FSR/FCR register accessors from core opcodes to FPU2000 opcodes as they are FPU2000-specific. Reviewed-by: Richard Henderson Signed-off-by: Max Filippov --- target/xtensa/translate.c | 64 +++ 1 file changed, 32 insertions(+), 32 deletions(-) diff

[PATCH v3 05/21] target/xtensa: support copying registers up to 64 bits wide

2020-07-08 Thread Max Filippov
FLIX dependency breaking code assumes that all registers are 32 bit wide. This may not always be correct. Extract actual register width from the associated register file and use it to create temporaries of correct width and generate correct data movement instructions. Signed-off-by: Max Filippov

[PATCH 00/21] target/xtensa: implement double precision FPU

2020-07-08 Thread Max Filippov
>v2: - use inline function for no_signaling_nans property to allow for constant folding on architectures that have this property fixed. Max Filippov (21): softfloat: make NO_SIGNALING_NANS runtime property softfloat: pass float_status pointer to pickNaN softfloat: add xtensa speciali

Re: [PATCH 03/21] softfloat: add xtensa specialization for pickNaNMulAdd

2020-07-08 Thread Max Filippov
On Wed, Jul 8, 2020 at 9:07 AM Richard Henderson wrote: > > On 7/6/20 4:47 PM, Max Filippov wrote: > > pickNaNMulAdd logic on Xtensa is the same as pickNaN when applied to > > the expression (a * b) + c. So with two pickNaN variants there must be > > two pickNaNMulAdd va

Re: [PATCH 09/21] target/xtensa: add DFP option, registers and opcodes

2020-07-08 Thread Max Filippov
On Wed, Jul 8, 2020 at 9:25 AM Richard Henderson wrote: > > On 7/6/20 4:47 PM, Max Filippov wrote: > > +float64 HELPER(add_d)(CPUXtensaState *env, float64 a, float64 b) > > +{ > > +set_use_first_nan(true, >fp_status); > > +return float64_add(a, b, >f

Re: [PATCH 05/21] target/xtensa: support copying registers up to 64 bits wide

2020-07-08 Thread Max Filippov
On Wed, Jul 8, 2020 at 9:14 AM Richard Henderson wrote: > > On 7/6/20 4:47 PM, Max Filippov wrote: > > +if (arg_copy[i].arg->num_bits <= 32) { > > +temp = tcg_temp_local_new_i32(); > > +tcg_gen

[PATCH] tests/docker: update toolchain set in debian-xtensa-cross

2020-07-08 Thread Max Filippov
Switch to the prebuilt xtensa toolchains release 2020.07. Drop csp toolchain as the csp core is not a part of QEMU. Add de233_fpu and dsp3400 toolchains to enable DFPU and FPU2000 tests. Signed-off-by: Max Filippov --- tests/docker/dockerfiles/debian-xtensa-cross.docker | 6 +++--- 1 file

Re: [PATCH 00/21] target/xtensa: implement double precision FPU

2020-07-07 Thread Max Filippov
On Tue, Jul 7, 2020 at 12:21 PM Alex Bennée wrote: > Well it ran some xtensa tests thanks to the docker cross compiler > support. Do you know what toolchains we need? > > Currently we have the following: > > ENV CPU_LIST csp dc232b dc233c > ENV TOOLCHAIN_RELEASE 2018.02 > > RUN for cpu in

Re: [PATCH] load_elf: Remove unused address variables from callers

2020-07-07 Thread Max Filippov
NULL to ignore these values. Remove such unused variables and > pass NULL instead from callers that don't need these. > > Signed-off-by: BALATON Zoltan > --- [...] > hw/xtensa/sim.c| 3 +-- > hw/xtensa/xtfpga.c | 3 +-- For Xtensa parts: Acked-by: Max Filippov -- Thanks. -- Max

[PATCH v2 01/21] softfloat: make NO_SIGNALING_NANS runtime property

2020-07-07 Thread Max Filippov
implementations coexist. Cc: Peter Maydell Cc: "Alex Bennée" Signed-off-by: Max Filippov --- Changes v1->v2: - use inline function for no_signaling_nans property to allow for constant folding on architectures that have this property fixed. fpu/softfloat-specialize

Re: [PATCH 00/21] target/xtensa: implement double precision FPU

2020-07-07 Thread Max Filippov
On Tue, Jul 7, 2020 at 4:31 AM Alex Bennée wrote: > I've only looked at the softfloat bits as I'm not familiar with xtensa Thanks for taking a look! > at all. However you can have a vague: > > Tested-by: Alex Bennée > > for the series - congratulations you pass your own tests ;-) Unless

[PATCH 19/21] tests/tcg/xtensa: add DFP0 arith tests

2020-07-06 Thread Max Filippov
Add test for basic double precision opcode properties. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_dfp0_arith.S | 153 + 1 file changed, 153 insertions(+) create mode 100644 tests/tcg/xtensa/test_dfp0_arith.S diff --git a/tests/tcg/xtensa

[PATCH 18/21] tests/tcg/xtensa: test double precision load/store

2020-07-06 Thread Max Filippov
Add ldi[p]/sdi[p]/ldx[p]/sdx[p] opcode tests to test_lsc. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_lsc.S | 123 1 file changed, 123 insertions(+) diff --git a/tests/tcg/xtensa/test_lsc.S b/tests/tcg/xtensa/test_lsc.S index 9d59c1815a9e

[PATCH 15/21] tests/tcg/xtensa: update test_fp1 for DFPU

2020-07-06 Thread Max Filippov
DFPU sets Invalid flag in FSR when at least one argument of FP comparison opcodes is NaN, SNaN for most opcodes, any NaN for olt/ole. Add checks for FSR and expected FSR values. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_fp1.S | 62 - 1 file

[PATCH 17/21] tests/tcg/xtensa: add fp0 div and sqrt tests

2020-07-06 Thread Max Filippov
Test exact division/sqrt DFPU sequences. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_fp0_div.S | 82 tests/tcg/xtensa/test_fp0_sqrt.S | 76 + 2 files changed, 158 insertions(+) create mode 100644 tests/tcg/xtensa

[PATCH 11/21] tests/tcg/xtensa: fix test execution on ISS

2020-07-06 Thread Max Filippov
Space for test results may be allocated in IRAM which is only word-accessible. Use full 32-bit words to access test results. Signed-off-by: Max Filippov --- tests/tcg/xtensa/macros.inc | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/tcg/xtensa/macros.inc b

<    1   2   3   4   5   6   7   8   9   10   >