qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/15] tests/tcg: Add TriCore tests
@ 2021-03-05 17:00 Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 01/15] tests/tcg: Add docker_as and docker_ld cmds Bastian Koppelmann
                   ` (17 more replies)
  0 siblings, 18 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

Hi Alex,

after a long while and thanks to Thomas reminder, I finally came back to this
series. I addressed most of your comments except for the timeout --foreground
problem (see https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00921.html). 
I just couldn't figure out why QEMU hangs when run from the Makefile.

You can find the full tree here:
https://github.com/bkoppelmann/qemu/tree/tricore-tcg-tests2

Cheers,
Bastian

Bastian Koppelmann (15):
  tests/tcg: Add docker_as and docker_ld cmds
  tests/tcg: Run timeout cmds using --foreground
  hw/tricore: Add testdevice for tests in tests/tcg/
  tests/tcg/tricore: Add build infrastructure
  configure: Emit HOST_CC to config-host.mak
  tests/tcg/tricore: Add macros to create tests and first test 'abs'
  tests/tcg/tricore: Add bmerge test
  tests/tcg/tricore: Add clz test
  tests/tcg/tricore: Add dvstep test
  tests/tcg/tricore: Add fadd test
  tests/tcg/tricore: Add fmul test
  tests/tcg/tricore: Add ftoi test
  tests/tcg/tricore: Add madd test
  tests/tcg/tricore: Add msub test
  tests/tcg/tricore: Add muls test

 MAINTAINERS                                   |   1 +
 configure                                     |   1 +
 hw/tricore/meson.build                        |   1 +
 hw/tricore/tricore_testboard.c                |   8 ++
 hw/tricore/tricore_testdevice.c               |  82 +++++++++++
 include/hw/tricore/tricore_testdevice.h       |  38 ++++++
 tests/tcg/Makefile.qemu                       |  15 ++
 tests/tcg/Makefile.target                     |   5 +-
 tests/tcg/configure.sh                        |  27 +++-
 tests/tcg/tricore/Makefile.softmmu-target     |  26 ++++
 .../tcg/tricore/Makefile.softmmu-target.orig  |  25 ++++
 tests/tcg/tricore/link.ld                     |  60 ++++++++
 tests/tcg/tricore/macros.h                    | 129 ++++++++++++++++++
 tests/tcg/tricore/test_abs.S                  |   7 +
 tests/tcg/tricore/test_bmerge.S               |   8 ++
 tests/tcg/tricore/test_clz.S                  |   9 ++
 tests/tcg/tricore/test_dvstep.S               |  15 ++
 tests/tcg/tricore/test_fadd.S                 |  16 +++
 tests/tcg/tricore/test_fmul.S                 |   8 ++
 tests/tcg/tricore/test_ftoi.S                 |  10 ++
 tests/tcg/tricore/test_madd.S                 |  11 ++
 tests/tcg/tricore/test_msub.S                 |   9 ++
 tests/tcg/tricore/test_muls.S                 |   9 ++
 23 files changed, 517 insertions(+), 3 deletions(-)
 create mode 100644 hw/tricore/tricore_testdevice.c
 create mode 100644 include/hw/tricore/tricore_testdevice.h
 create mode 100644 tests/tcg/tricore/Makefile.softmmu-target
 create mode 100644 tests/tcg/tricore/Makefile.softmmu-target.orig
 create mode 100644 tests/tcg/tricore/link.ld
 create mode 100644 tests/tcg/tricore/macros.h
 create mode 100644 tests/tcg/tricore/test_abs.S
 create mode 100644 tests/tcg/tricore/test_bmerge.S
 create mode 100644 tests/tcg/tricore/test_clz.S
 create mode 100644 tests/tcg/tricore/test_dvstep.S
 create mode 100644 tests/tcg/tricore/test_fadd.S
 create mode 100644 tests/tcg/tricore/test_fmul.S
 create mode 100644 tests/tcg/tricore/test_ftoi.S
 create mode 100644 tests/tcg/tricore/test_madd.S
 create mode 100644 tests/tcg/tricore/test_msub.S
 create mode 100644 tests/tcg/tricore/test_muls.S

-- 
2.30.1



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 01/15] tests/tcg: Add docker_as and docker_ld cmds
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-04-14 13:40   ` Alex Bennée
  2021-04-14 14:58   ` Alex Bennée
  2021-03-05 17:00 ` [PATCH v3 02/15] tests/tcg: Run timeout cmds using --foreground Bastian Koppelmann
                   ` (16 subsequent siblings)
  17 siblings, 2 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

At least for the TriCore target no easily available c compiler exists.
Thus we need to rely on "as" and "ld". This allows us to run them
through the docker image as well as with locally installed tools.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
v2 -> v3:
    - emit CROSS_LD_GUEST/CROSS_AS_GUEST

 tests/tcg/Makefile.qemu | 15 +++++++++++++++
 tests/tcg/configure.sh  | 20 ++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/tests/tcg/Makefile.qemu b/tests/tcg/Makefile.qemu
index a56564660c..fefb50903d 100644
--- a/tests/tcg/Makefile.qemu
+++ b/tests/tcg/Makefile.qemu
@@ -22,6 +22,8 @@ quiet-@ = $(if $(V),,@)
 quiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3)
 
 CROSS_CC_GUEST:=
+CROSS_AS_GUEST:=
+CROSS_LD_GUEST:=
 DOCKER_IMAGE:=
 
 -include tests/tcg/config-$(TARGET).mak
@@ -42,6 +44,7 @@ cross-build-guest-tests:
 	$(call quiet-command, \
 	   (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
 	    $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC="$(CROSS_CC_GUEST)" \
+			AS="$(CROSS_AS_GUEST) LD="$(CROSS_LD_GUEST)" \
 			SRC_PATH="$(SRC_PATH)" BUILD_STATIC=$(CROSS_CC_GUEST_STATIC) \
 			EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
 	"BUILD","$(TARGET) guest-tests with $(CROSS_CC_GUEST)")
@@ -59,11 +62,23 @@ DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc \
 		-i qemu/$(DOCKER_IMAGE) \
 		-s $(SRC_PATH) -- "
 
+DOCKER_AS_CMD="$(DOCKER_SCRIPT) cc \
+		--cc $(DOCKER_CROSS_AS_GUEST) \
+		-i qemu/$(DOCKER_IMAGE) \
+		-s $(SRC_PATH) -- "
+
+DOCKER_LD_CMD="$(DOCKER_SCRIPT) cc \
+		--cc $(DOCKER_CROSS_LD_GUEST) \
+		-i qemu/$(DOCKER_IMAGE) \
+		-s $(SRC_PATH) -- "
+
+
 .PHONY: docker-build-guest-tests
 docker-build-guest-tests: docker-image-$(DOCKER_IMAGE)
 	$(call quiet-command, \
 	  (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
 	   $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC=$(DOCKER_COMPILE_CMD) \
+			AS=$(DOCKER_AS_CMD) LD=$(DOCKER_LD_CMD) \
 			SRC_PATH="$(SRC_PATH)" BUILD_STATIC=y \
 			EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
 	"BUILD","$(TARGET) guest-tests with docker qemu/$(DOCKER_IMAGE)")
diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index 36b8a73a54..4da8c3fa12 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -72,6 +72,12 @@ fi
 : ${cross_cc_x86_64="x86_64-pc-linux-gnu-gcc"}
 : ${cross_cc_cflags_x86_64="-m64"}
 
+# cross as defaults, can be overridden with --cross-as-ARCH
+: ${cross_as_tricore="tricore-as"}
+
+# cross ld defaults, can be overridden with --cross-ld-ARCH
+: ${cross_as_tricore="tricore-ld"}
+
 for target in $target_list; do
   arch=${target%%-*}
   case $arch in
@@ -228,6 +234,18 @@ for target in $target_list; do
     fi
     echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
 
+    eval "target_as=\${cross_as_$i}"
+    if has $target_as; then
+      echo "CROSS_AS_GUEST=$target_as" >> $config_target_mak
+      continue
+    fi
+
+    eval "target_ld=\${cross_ld_$i}"
+    if has $target_ld; then
+      echo "CROSS_LD_GUEST=$target_ld" >> $config_target_mak
+      continue
+    fi
+
     # Test for compiler features for optional tests. We only do this
     # for cross compilers because ensuring the docker containers based
     # compilers is a requirememt for adding a new test that needs a
@@ -261,5 +279,7 @@ for target in $target_list; do
   if test $got_cross_cc = no && test "$container" != no && test -n "$container_image"; then
     echo "DOCKER_IMAGE=$container_image" >> $config_target_mak
     echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak
+    echo "DOCKER_CROSS_AS_GUEST=$container_cross_as" >> $config_target_mak
+    echo "DOCKER_CROSS_LD_GUEST=$container_cross_ld" >> $config_target_mak
   fi
 done
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 02/15] tests/tcg: Run timeout cmds using --foreground
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 01/15] tests/tcg: Add docker_as and docker_ld cmds Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 03/15] hw/tricore: Add testdevice for tests in tests/tcg/ Bastian Koppelmann
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

when trying to run successful short tests from the Makefile timeout would not
terminate. Rather it would wait until the time runs out. Excerpt from the
manpage:

--foreground
    when not running timeout directly from a shell prompt,
    allow COMMAND to read from the TTY and get TTY signals; in this mode, chil‐
    dren of COMMAND will not be timed out

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/Makefile.target | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
index 24d75a5801..34fd0e9f85 100644
--- a/tests/tcg/Makefile.target
+++ b/tests/tcg/Makefile.target
@@ -40,9 +40,10 @@ quiet-command = $(if $(V),$1,$(if $(2),@printf "  %-7s %s\n" $2 $3 && $1, @$1))
 
 # $1 = test name, $2 = cmd, $3 = desc
 ifdef CONFIG_USER_ONLY
-run-test = $(call quiet-command, timeout $(TIMEOUT) $2 > $1.out,"TEST",$3)
+run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2 > $1.out, \
+	"TEST",$3)
 else
-run-test = $(call quiet-command, timeout $(TIMEOUT) $2,"TEST",$3)
+run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2,"TEST",$3)
 endif
 
 # $1 = test name, $2 = reference
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 03/15] hw/tricore: Add testdevice for tests in tests/tcg/
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 01/15] tests/tcg: Add docker_as and docker_ld cmds Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 02/15] tests/tcg: Run timeout cmds using --foreground Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 04/15] tests/tcg/tricore: Add build infrastructure Bastian Koppelmann
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

this device is used to verify the correctness of regression tests by
allowing guests to write their exit status to this device. This is then
used by qemu to exit using the written status.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 hw/tricore/meson.build                  |  1 +
 hw/tricore/tricore_testboard.c          |  8 +++
 hw/tricore/tricore_testdevice.c         | 82 +++++++++++++++++++++++++
 include/hw/tricore/tricore_testdevice.h | 38 ++++++++++++
 4 files changed, 129 insertions(+)
 create mode 100644 hw/tricore/tricore_testdevice.c
 create mode 100644 include/hw/tricore/tricore_testdevice.h

diff --git a/hw/tricore/meson.build b/hw/tricore/meson.build
index 579aa13c78..907a4c8c8f 100644
--- a/hw/tricore/meson.build
+++ b/hw/tricore/meson.build
@@ -1,4 +1,5 @@
 tricore_ss = ss.source_set()
 tricore_ss.add(when: 'CONFIG_TRICORE', if_true: files('tricore_testboard.c'))
+tricore_ss.add(when: 'CONFIG_TRICORE', if_true: files('tricore_testdevice.c'))
 
 hw_arch += {'tricore': tricore_ss}
diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c
index 12ea1490fd..9791986a3e 100644
--- a/hw/tricore/tricore_testboard.c
+++ b/hw/tricore/tricore_testboard.c
@@ -28,6 +28,7 @@
 #include "exec/address-spaces.h"
 #include "elf.h"
 #include "hw/tricore/tricore.h"
+#include "hw/tricore/tricore_testdevice.h"
 #include "qemu/error-report.h"
 
 
@@ -57,6 +58,7 @@ static void tricore_testboard_init(MachineState *machine, int board_id)
 {
     TriCoreCPU *cpu;
     CPUTriCoreState *env;
+    TriCoreTestDeviceState *test_dev;
 
     MemoryRegion *sysmem = get_system_memory();
     MemoryRegion *ext_cram = g_new(MemoryRegion, 1);
@@ -88,6 +90,12 @@ static void tricore_testboard_init(MachineState *machine, int board_id)
     memory_region_add_subregion(sysmem, 0xf0050000, pcp_data);
     memory_region_add_subregion(sysmem, 0xf0060000, pcp_text);
 
+    test_dev = g_new(TriCoreTestDeviceState, 1);
+    object_initialize(test_dev, sizeof(TriCoreTestDeviceState),
+                      TYPE_TRICORE_TESTDEVICE);
+    memory_region_add_subregion(sysmem, 0xf0000000, &test_dev->iomem);
+
+
     tricoretb_binfo.ram_size = machine->ram_size;
     tricoretb_binfo.kernel_filename = machine->kernel_filename;
 
diff --git a/hw/tricore/tricore_testdevice.c b/hw/tricore/tricore_testdevice.c
new file mode 100644
index 0000000000..a1563aa568
--- /dev/null
+++ b/hw/tricore/tricore_testdevice.c
@@ -0,0 +1,82 @@
+/*
+ *  Copyright (c) 2018-2021 Bastian Koppelmann Paderborn University
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qemu/osdep.h"
+#include "hw/sysbus.h"
+#include "hw/qdev-properties.h"
+#include "hw/tricore/tricore_testdevice.h"
+
+static void tricore_testdevice_write(void *opaque, hwaddr offset,
+                                      uint64_t value, unsigned size)
+{
+    exit(value);
+}
+
+static uint64_t tricore_testdevice_read(void *opaque, hwaddr offset,
+                                         unsigned size)
+{
+    return 0xdeadbeef;
+}
+
+static void tricore_testdevice_reset(DeviceState *dev)
+{
+}
+
+static const MemoryRegionOps tricore_testdevice_ops = {
+    .read = tricore_testdevice_read,
+    .write = tricore_testdevice_write,
+    .valid = {
+        .min_access_size = 4,
+        .max_access_size = 4,
+    },
+    .endianness = DEVICE_NATIVE_ENDIAN,
+};
+
+static void tricore_testdevice_init(Object *obj)
+{
+    TriCoreTestDeviceState *s = TRICORE_TESTDEVICE(obj);
+   /* map memory */
+    memory_region_init_io(&s->iomem, OBJECT(s), &tricore_testdevice_ops, s,
+                          "tricore_testdevice", 0x4);
+}
+
+static Property tricore_testdevice_properties[] = {
+    DEFINE_PROP_END_OF_LIST()
+};
+
+static void tricore_testdevice_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    device_class_set_props(dc, tricore_testdevice_properties);
+    dc->reset = tricore_testdevice_reset;
+}
+
+static const TypeInfo tricore_testdevice_info = {
+    .name          = TYPE_TRICORE_TESTDEVICE,
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(TriCoreTestDeviceState),
+    .instance_init = tricore_testdevice_init,
+    .class_init    = tricore_testdevice_class_init,
+};
+
+static void tricore_testdevice_register_types(void)
+{
+    type_register_static(&tricore_testdevice_info);
+}
+
+type_init(tricore_testdevice_register_types)
diff --git a/include/hw/tricore/tricore_testdevice.h b/include/hw/tricore/tricore_testdevice.h
new file mode 100644
index 0000000000..2c56c51bcb
--- /dev/null
+++ b/include/hw/tricore/tricore_testdevice.h
@@ -0,0 +1,38 @@
+/*
+ *  Copyright (c) 2018-2021  Bastian Koppelmann Paderborn University
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef HW_TRICORE_TESTDEV_H
+#define HW_TRICORE_TESTDEV_H
+
+#include "hw/sysbus.h"
+#include "hw/hw.h"
+
+#define TYPE_TRICORE_TESTDEVICE "tricore_testdevice"
+#define TRICORE_TESTDEVICE(obj) \
+    OBJECT_CHECK(TriCoreTestDeviceState, (obj), TYPE_TRICORE_TESTDEVICE)
+
+typedef struct {
+    /* <private> */
+    SysBusDevice parent_obj;
+
+    /* <public> */
+    MemoryRegion iomem;
+
+} TriCoreTestDeviceState;
+
+#endif
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 04/15] tests/tcg/tricore: Add build infrastructure
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (2 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 03/15] hw/tricore: Add testdevice for tests in tests/tcg/ Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 05/15] configure: Emit HOST_CC to config-host.mak Bastian Koppelmann
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

this includes the Makefile and linker script to build all the tests.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
v2 -> v3:
    - dropped HOST_CC definition
    - Add files in test/tcg/tricore to MAINTAINERS

 MAINTAINERS                               |  1 +
 tests/tcg/tricore/Makefile.softmmu-target | 15 ++++++
 tests/tcg/tricore/link.ld                 | 60 +++++++++++++++++++++++
 3 files changed, 76 insertions(+)
 create mode 100644 tests/tcg/tricore/Makefile.softmmu-target
 create mode 100644 tests/tcg/tricore/link.ld

diff --git a/MAINTAINERS b/MAINTAINERS
index 9b2aa18e1f..87cd4dcbb2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -375,6 +375,7 @@ S: Maintained
 F: target/tricore/
 F: hw/tricore/
 F: include/hw/tricore/
+F: tests/tcg/tricore/
 
 Multiarch Linux User Tests
 M: Alex Bennée <alex.bennee@linaro.org>
diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
new file mode 100644
index 0000000000..d64a99b95f
--- /dev/null
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -0,0 +1,15 @@
+TESTS_PATH = $(SRC_PATH)/tests/tcg/tricore
+
+LDFLAGS = -T$(TESTS_PATH)/link.ld
+ASFLAGS =
+
+QEMU_OPTS += -M tricore_testboard -nographic -kernel
+
+%.pS: $(TESTS_PATH)/%.S
+	$(HOST_CC) -E -o $@ $<
+
+%.o: %.pS
+	$(AS) $(ASFLAGS) -o $@ $<
+
+%.tst: %.o
+	$(LD) $(LDFLAGS) $< -o $@
diff --git a/tests/tcg/tricore/link.ld b/tests/tcg/tricore/link.ld
new file mode 100644
index 0000000000..364bcdc00a
--- /dev/null
+++ b/tests/tcg/tricore/link.ld
@@ -0,0 +1,60 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf32-tricore")
+OUTPUT_ARCH(tricore)
+ENTRY(_start)
+
+/* the internal ram description */
+MEMORY
+{
+  text_ram (rx!p): org = 0x80000000, len = 15K
+  data_ram (w!xp): org = 0xd0000000, len = 130K
+}
+/*
+ * Define the sizes of the user and system stacks.
+ */
+__USTACK_SIZE = DEFINED (__USTACK_SIZE) ? __USTACK_SIZE : 1K ;
+/*
+ * Define the start address and the size of the context save area.
+ */
+__CSA_BEGIN =  0xd0000000 ;
+__CSA_SIZE =  8k ;
+__CSA_END = __CSA_BEGIN + __CSA_SIZE ;
+
+SECTIONS
+{
+  .text  :
+  {
+    *(.text)
+    . = ALIGN(8);
+  } > text_ram
+
+  .rodata :
+  {
+    *(.rodata)
+    *(.rodata1)
+  } > data_ram
+
+  .data :
+  {
+    . = ALIGN(8) ;
+    *(.data)
+    *(.data.*)
+    . = ALIGN(8) ;
+    __USTACK = . + __USTACK_SIZE -768;
+
+  } > data_ram
+  /*
+   * Allocate space for BSS sections.
+   */
+  .bss  :
+  {
+    BSS_BASE = . ;
+    *(.bss)
+    *(COMMON)
+    . = ALIGN(8) ;
+  } > data_ram
+  /* Make sure CSA, stack and heap addresses are properly aligned.  */
+  _. = ASSERT ((__CSA_BEGIN & 0x3f) == 0 , "illegal CSA start address") ;
+  _. = ASSERT ((__CSA_SIZE & 0x3f) == 0 , "illegal CSA size") ;
+
+}
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 05/15] configure: Emit HOST_CC to config-host.mak
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (3 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 04/15] tests/tcg/tricore: Add build infrastructure Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 06/15] tests/tcg/tricore: Add macros to create tests and first test 'abs' Bastian Koppelmann
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

this is needed by the tricore-tcg-tests as tricore-gcc is not easily
available. Thus we rely on the HOST_CC to do the preprocessing of the
tricore assembly files.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 34fccaa2ba..a2e6f273f0 100755
--- a/configure
+++ b/configure
@@ -6140,6 +6140,7 @@ echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
 echo "MESON=$meson" >> $config_host_mak
 echo "NINJA=$ninja" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
+echo "HOST_CC=$host_cc" >> $config_host_mak
 if $iasl -h > /dev/null 2>&1; then
   echo "CONFIG_IASL=$iasl" >> $config_host_mak
 fi
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 06/15] tests/tcg/tricore: Add macros to create tests and first test 'abs'
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (4 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 05/15] configure: Emit HOST_CC to config-host.mak Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 07/15] tests/tcg/tricore: Add bmerge test Bastian Koppelmann
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

This kind of tests is inspired by the riscv-tests repository. This adds
macros that makes it easy to create single instruction self containing
tests.

It is achieved by macros that create a test sequence for an
instruction and check for a supplied correct value. If the value is correct the
next instruction is tested. Otherwise we jump to fail handler that writes is
test number as a status code back to qemu that then exits on that status code.
If all tests pass we write back 0 as a status code and exit.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/configure.sh                    |  7 ++-
 tests/tcg/tricore/Makefile.softmmu-target |  2 +
 tests/tcg/tricore/macros.h                | 53 +++++++++++++++++++++++
 tests/tcg/tricore/test_abs.S              |  7 +++
 4 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 tests/tcg/tricore/macros.h
 create mode 100644 tests/tcg/tricore/test_abs.S

diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index 4da8c3fa12..5f244e5c2f 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -102,7 +102,7 @@ for target in $target_list; do
     xtensa|xtensaeb)
       arches=xtensa
       ;;
-    alpha|cris|hexagon|hppa|i386|lm32|microblaze|microblazeel|m68k|openrisc|riscv64|s390x|sh4|sparc64)
+    alpha|cris|hexagon|hppa|i386|lm32|microblaze|microblazeel|m68k|openrisc|riscv64|s390x|sh4|sparc64|tricore)
       arches=$target
       ;;
     *)
@@ -186,6 +186,11 @@ for target in $target_list; do
       container_image=debian-sparc64-cross
       container_cross_cc=sparc64-linux-gnu-gcc
       ;;
+    tricore-softmmu)
+        container_image=debian-tricore-cross
+        container_cross_as=tricore-as
+        container_cross_ld=tricore-ld
+        ;;
     xtensa*-softmmu)
       container_image=debian-xtensa-cross
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index d64a99b95f..3b048e49fa 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -3,6 +3,8 @@ TESTS_PATH = $(SRC_PATH)/tests/tcg/tricore
 LDFLAGS = -T$(TESTS_PATH)/link.ld
 ASFLAGS =
 
+TESTS += test_abs.tst
+
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
 %.pS: $(TESTS_PATH)/%.S
diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
new file mode 100644
index 0000000000..76c133132a
--- /dev/null
+++ b/tests/tcg/tricore/macros.h
@@ -0,0 +1,53 @@
+/* Helpers */
+#define LI(reg, val)           \
+    mov.u reg, lo:val;         \
+    movh DREG_TEMP_LI, up:val; \
+    or reg, reg, DREG_TEMP_LI; \
+
+/* Address definitions */
+#define TESTDEV_ADDR 0xf0000000
+/* Register definitions */
+#define DREG_RS1 %d0
+#define DREG_CALC_RESULT %d1
+#define DREG_TEMP_LI %d10
+#define DREG_TEMP %d11
+#define DREG_TEST_NUM %d14
+#define DREG_CORRECT_RESULT %d15
+
+#define DREG_DEV_ADDR %a15
+
+/* Test case wrappers */
+#define TEST_CASE(num, testreg, correct, code...) \
+test_ ## num:                                     \
+    code;                                         \
+    LI(DREG_CORRECT_RESULT, correct)              \
+    mov DREG_TEST_NUM, num;                       \
+    jne testreg, DREG_CORRECT_RESULT, fail        \
+
+/* Actual test case type
+ * e.g inst %dX, %dY      -> TEST_D_D
+ *     inst %dX, %dY, %dZ -> TEST_D_DD
+ *     inst %eX, %dY, %dZ -> TEST_E_DD
+ */
+#define TEST_D_D(insn, num, result, rs1)      \
+    TEST_CASE(num, DREG_CALC_RESULT, result,  \
+    LI(DREG_RS1, rs1);                        \
+    insn DREG_CALC_RESULT, DREG_RS1;          \
+    )
+
+/* Pass/Fail handling part */
+#define TEST_PASSFAIL                       \
+        j pass;                             \
+fail:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j fail;                             \
+pass:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        mov DREG_TEST_NUM, 0;               \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j pass;
diff --git a/tests/tcg/tricore/test_abs.S b/tests/tcg/tricore/test_abs.S
new file mode 100644
index 0000000000..e42240159a
--- /dev/null
+++ b/tests/tcg/tricore/test_abs.S
@@ -0,0 +1,7 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_D(abs, 1, 0, 0)
+
+    TEST_PASSFAIL
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 07/15] tests/tcg/tricore: Add bmerge test
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (5 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 06/15] tests/tcg/tricore: Add macros to create tests and first test 'abs' Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 08/15] tests/tcg/tricore: Add clz test Bastian Koppelmann
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target |  1 +
 tests/tcg/tricore/macros.h                | 24 +++++++++++++++++++++++
 tests/tcg/tricore/test_bmerge.S           |  8 ++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 tests/tcg/tricore/test_bmerge.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 3b048e49fa..de6a2cc88e 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -4,6 +4,7 @@ LDFLAGS = -T$(TESTS_PATH)/link.ld
 ASFLAGS =
 
 TESTS += test_abs.tst
+TESTS += test_bmerge.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index 76c133132a..52aa936c56 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -8,7 +8,10 @@
 #define TESTDEV_ADDR 0xf0000000
 /* Register definitions */
 #define DREG_RS1 %d0
+#define DREG_RS2 %d1
 #define DREG_CALC_RESULT %d1
+#define DREG_CALC_PSW %d2
+#define DREG_CORRECT_PSW %d3
 #define DREG_TEMP_LI %d10
 #define DREG_TEMP %d11
 #define DREG_TEST_NUM %d14
@@ -24,6 +27,17 @@ test_ ## num:                                     \
     mov DREG_TEST_NUM, num;                       \
     jne testreg, DREG_CORRECT_RESULT, fail        \
 
+#define TEST_CASE_PSW(num, testreg, correct, correct_psw, code...) \
+test_ ## num:                                                      \
+    code;                                                          \
+    LI(DREG_CORRECT_RESULT, correct)                               \
+    mov DREG_TEST_NUM, num;                                        \
+    jne testreg, DREG_CORRECT_RESULT, fail;                        \
+    mfcr DREG_CALC_PSW, $psw;                                      \
+    LI(DREG_CORRECT_PSW, correct_psw)                              \
+    mov DREG_TEST_NUM, num;                                        \
+    jne DREG_CALC_PSW, DREG_CORRECT_PSW, fail;
+
 /* Actual test case type
  * e.g inst %dX, %dY      -> TEST_D_D
  *     inst %dX, %dY, %dZ -> TEST_D_DD
@@ -35,6 +49,16 @@ test_ ## num:                                     \
     insn DREG_CALC_RESULT, DREG_RS1;          \
     )
 
+#define TEST_D_DD_PSW(insn, num, result, psw, rs1, rs2) \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,   \
+    LI(DREG_RS1, rs1);                                  \
+    LI(DREG_RS2, rs2);                                  \
+    rstv;                                               \
+    insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2;          \
+    )
+
+
+
 /* Pass/Fail handling part */
 #define TEST_PASSFAIL                       \
         j pass;                             \
diff --git a/tests/tcg/tricore/test_bmerge.S b/tests/tcg/tricore/test_bmerge.S
new file mode 100644
index 0000000000..8a0fa6d3f6
--- /dev/null
+++ b/tests/tcg/tricore/test_bmerge.S
@@ -0,0 +1,8 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(bmerge, 1, 0x555557f7, 0x00000b80, 0x0000001d, 0x0000ffff)
+
+    TEST_PASSFAIL
+
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 08/15] tests/tcg/tricore: Add clz test
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (6 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 07/15] tests/tcg/tricore: Add bmerge test Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 09/15] tests/tcg/tricore: Add dvstep test Bastian Koppelmann
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      |  1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig | 18 ++++++++++++++++++
 tests/tcg/tricore/test_clz.S                   |  9 +++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 tests/tcg/tricore/Makefile.softmmu-target.orig
 create mode 100644 tests/tcg/tricore/test_clz.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index de6a2cc88e..a9b81545e2 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -5,6 +5,7 @@ ASFLAGS =
 
 TESTS += test_abs.tst
 TESTS += test_bmerge.tst
+TESTS += test_clz.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
new file mode 100644
index 0000000000..de6a2cc88e
--- /dev/null
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -0,0 +1,18 @@
+TESTS_PATH = $(SRC_PATH)/tests/tcg/tricore
+
+LDFLAGS = -T$(TESTS_PATH)/link.ld
+ASFLAGS =
+
+TESTS += test_abs.tst
+TESTS += test_bmerge.tst
+
+QEMU_OPTS += -M tricore_testboard -nographic -kernel
+
+%.pS: $(TESTS_PATH)/%.S
+	$(HOST_CC) -E -o $@ $<
+
+%.o: %.pS
+	$(AS) $(ASFLAGS) -o $@ $<
+
+%.tst: %.o
+	$(LD) $(LDFLAGS) $< -o $@
diff --git a/tests/tcg/tricore/test_clz.S b/tests/tcg/tricore/test_clz.S
new file mode 100644
index 0000000000..e03835f123
--- /dev/null
+++ b/tests/tcg/tricore/test_clz.S
@@ -0,0 +1,9 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_D(cls.h, 1, 0x0, 0x6db17976)
+    TEST_D_D(cls.h, 2, 0x000f000f, 0x0)
+
+    TEST_PASSFAIL
+
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 09/15] tests/tcg/tricore: Add dvstep test
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (7 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 08/15] tests/tcg/tricore: Add clz test Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 10/15] tests/tcg/tricore: Add fadd test Bastian Koppelmann
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target     |  1 +
 .../tcg/tricore/Makefile.softmmu-target.orig  |  1 +
 tests/tcg/tricore/macros.h                    | 29 ++++++++++++++++++-
 tests/tcg/tricore/test_dvstep.S               | 15 ++++++++++
 4 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 tests/tcg/tricore/test_dvstep.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index a9b81545e2..799b51191e 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -6,6 +6,7 @@ ASFLAGS =
 TESTS += test_abs.tst
 TESTS += test_bmerge.tst
 TESTS += test_clz.tst
+TESTS += test_dvstep.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index de6a2cc88e..a9b81545e2 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -5,6 +5,7 @@ ASFLAGS =
 
 TESTS += test_abs.tst
 TESTS += test_bmerge.tst
+TESTS += test_clz.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index 52aa936c56..59b4b9a352 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -19,6 +19,18 @@
 
 #define DREG_DEV_ADDR %a15
 
+#define EREG_RS1 %e6
+#define EREG_RS1_LO %d6
+#define EREG_RS1_HI %d7
+#define EREG_RS2 %e8
+#define EREG_RS2_LO %d8
+#define EREG_RS2_HI %d9
+#define EREG_CALC_RESULT %e8
+#define EREG_CALC_RESULT_HI %d9
+#define EREG_CALC_RESULT_LO %d8
+#define EREG_CORRECT_RESULT_LO %d0
+#define EREG_CORRECT_RESULT_HI %d1
+
 /* Test case wrappers */
 #define TEST_CASE(num, testreg, correct, code...) \
 test_ ## num:                                     \
@@ -27,6 +39,15 @@ test_ ## num:                                     \
     mov DREG_TEST_NUM, num;                       \
     jne testreg, DREG_CORRECT_RESULT, fail        \
 
+#define TEST_CASE_E(num, correct_lo, correct_hi, code...)  \
+test_ ## num:                                              \
+    code;                                                  \
+    mov DREG_TEST_NUM, num;                                \
+    LI(EREG_CORRECT_RESULT_LO, correct_lo)                 \
+    jne EREG_CALC_RESULT_LO, EREG_CORRECT_RESULT_LO, fail; \
+    LI(EREG_CORRECT_RESULT_HI, correct_hi)                 \
+    jne EREG_CALC_RESULT_HI, EREG_CORRECT_RESULT_HI, fail;
+
 #define TEST_CASE_PSW(num, testreg, correct, correct_psw, code...) \
 test_ ## num:                                                      \
     code;                                                          \
@@ -57,7 +78,13 @@ test_ ## num:                                                      \
     insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2;          \
     )
 
-
+#define TEST_E_ED(insn, num, res_hi, res_lo, rs1_hi, rs1_lo, rs2) \
+    TEST_CASE_E(num, res_lo, res_hi,                              \
+    LI(EREG_RS1_LO, rs1_lo);                                      \
+    LI(EREG_RS1_HI, rs1_hi);                                      \
+    LI(DREG_RS2, rs2);                                            \
+    insn EREG_CALC_RESULT, EREG_RS1, DREG_RS2;                    \
+    )
 
 /* Pass/Fail handling part */
 #define TEST_PASSFAIL                       \
diff --git a/tests/tcg/tricore/test_dvstep.S b/tests/tcg/tricore/test_dvstep.S
new file mode 100644
index 0000000000..858dbc62dd
--- /dev/null
+++ b/tests/tcg/tricore/test_dvstep.S
@@ -0,0 +1,15 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    #                              Result                   RS1            RS2
+    TEST_E_ED(dvstep,   1, 0x000001ff, 0xfffe5cff, 0x00000001, 0xfffffe5c, 0x0)
+    TEST_E_ED(dvstep,   2, 0x00000000, 0x000000ff, 0x00000000, 0x00000000, 0x0)
+    TEST_E_ED(dvstep,   3, 0x0000f000, 0x000000fd, 0x010000f0, 0x00000000, 0x0)
+    TEST_E_ED(dvstep,   4, 0xfffff000, 0x00000000, 0x7ffffff0, 0x00000000, 0x0)
+    TEST_E_ED(dvstep.u, 5, 0xffffff00, 0x100008ff, 0xffffffff, 0x00100008, 0x0)
+    TEST_E_ED(dvstep.u, 6, 0x00000100, 0x00000000, 0x08000001, 0x00000000, \
+                           0xffffff2d)
+
+    TEST_PASSFAIL
+
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 10/15] tests/tcg/tricore: Add fadd test
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (8 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 09/15] tests/tcg/tricore: Add dvstep test Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 11/15] tests/tcg/tricore: Add fmul test Bastian Koppelmann
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      |  1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig |  1 +
 tests/tcg/tricore/test_fadd.S                  | 16 ++++++++++++++++
 3 files changed, 18 insertions(+)
 create mode 100644 tests/tcg/tricore/test_fadd.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 799b51191e..e7adb16af9 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -7,6 +7,7 @@ TESTS += test_abs.tst
 TESTS += test_bmerge.tst
 TESTS += test_clz.tst
 TESTS += test_dvstep.tst
+TESTS += test_fadd.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index a9b81545e2..799b51191e 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -6,6 +6,7 @@ ASFLAGS =
 TESTS += test_abs.tst
 TESTS += test_bmerge.tst
 TESTS += test_clz.tst
+TESTS += test_dvstep.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_fadd.S b/tests/tcg/tricore/test_fadd.S
new file mode 100644
index 0000000000..1a65054803
--- /dev/null
+++ b/tests/tcg/tricore/test_fadd.S
@@ -0,0 +1,16 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(add.f, 1, 0x7fc00000, 0x00000b80, 0xffffff85, 0x00001234)
+    TEST_D_DD_PSW(add.f, 2, 0xf9c00000, 0x00000b80, 0xf9400000, 0xf9400000)
+    TEST_D_DD_PSW(add.f, 3, 0x8bb858ca, 0x00000b80, 0x8b3858ca, 0x8b3858ca)
+    TEST_D_DD_PSW(add.f, 4, 0x00000000, 0x00000b80, 0x000000ff, 0x00000000)
+    TEST_D_DD_PSW(add.f, 5, 0x7fc00000, 0x00000b80, 0xfffffe52, 0x0a4cf70c)
+    TEST_D_DD_PSW(add.f, 6, 0x9e6d5076, 0x84000b80, 0x9ded50ec, 0x9ded4fff)
+    TEST_D_DD_PSW(add.f, 7, 0x00000000, 0x04000b80, 0x0000e8bd, 0x00000000)
+    TEST_D_DD_PSW(add.f, 8, 0x7fc00000, 0xc4000b80, 0xffad546e, 0xffad546e)
+    TEST_D_DD_PSW(add.f, 9, 0x7fc00000, 0x04000b80, 0xfffe0000, 0x08130000)
+
+    TEST_PASSFAIL
+
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 11/15] tests/tcg/tricore: Add fmul test
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (9 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 10/15] tests/tcg/tricore: Add fadd test Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 12/15] tests/tcg/tricore: Add ftoi test Bastian Koppelmann
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      | 1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig | 1 +
 tests/tcg/tricore/test_fmul.S                  | 8 ++++++++
 3 files changed, 10 insertions(+)
 create mode 100644 tests/tcg/tricore/test_fmul.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index e7adb16af9..34da1f37de 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -8,6 +8,7 @@ TESTS += test_bmerge.tst
 TESTS += test_clz.tst
 TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
+TESTS += test_fmul.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index 799b51191e..e7adb16af9 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -7,6 +7,7 @@ TESTS += test_abs.tst
 TESTS += test_bmerge.tst
 TESTS += test_clz.tst
 TESTS += test_dvstep.tst
+TESTS += test_fadd.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_fmul.S b/tests/tcg/tricore/test_fmul.S
new file mode 100644
index 0000000000..fb1f634b2d
--- /dev/null
+++ b/tests/tcg/tricore/test_fmul.S
@@ -0,0 +1,8 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(mul.f, 1, 0x974f4f0a, 0x84000b80, 0x1a0b1980, 0xbcbec42d)
+
+    TEST_PASSFAIL
+
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 12/15] tests/tcg/tricore: Add ftoi test
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (10 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 11/15] tests/tcg/tricore: Add fmul test Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 13/15] tests/tcg/tricore: Add madd test Bastian Koppelmann
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      |  1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig |  1 +
 tests/tcg/tricore/macros.h                     |  7 +++++++
 tests/tcg/tricore/test_ftoi.S                  | 10 ++++++++++
 4 files changed, 19 insertions(+)
 create mode 100644 tests/tcg/tricore/test_ftoi.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 34da1f37de..fcc7b6c1c9 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -9,6 +9,7 @@ TESTS += test_clz.tst
 TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
 TESTS += test_fmul.tst
+TESTS += test_ftoi.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index e7adb16af9..34da1f37de 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -8,6 +8,7 @@ TESTS += test_bmerge.tst
 TESTS += test_clz.tst
 TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
+TESTS += test_fmul.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index 59b4b9a352..e6a41cd1a2 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -70,6 +70,13 @@ test_ ## num:                                                      \
     insn DREG_CALC_RESULT, DREG_RS1;          \
     )
 
+#define TEST_D_D_PSW(insn, num, result, psw, rs1)     \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw, \
+    LI(DREG_RS1, rs1);                                \
+    rstv;                                             \
+    insn DREG_CORRECT_RESULT, DREG_RS1;               \
+    )
+
 #define TEST_D_DD_PSW(insn, num, result, psw, rs1, rs2) \
     TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,   \
     LI(DREG_RS1, rs1);                                  \
diff --git a/tests/tcg/tricore/test_ftoi.S b/tests/tcg/tricore/test_ftoi.S
new file mode 100644
index 0000000000..fb4af6b5aa
--- /dev/null
+++ b/tests/tcg/tricore/test_ftoi.S
@@ -0,0 +1,10 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_D_PSW(ftoi, 1, 0x0, 0x84000b80, 0x05f6e605)
+    TEST_D_D_PSW(ftoi, 2, 0x0, 0x04000b80, 0x00012200)
+    TEST_D_D_PSW(ftoi, 3, 0x0, 0xc4000b80, 0xffffffff)
+
+    TEST_PASSFAIL
+
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 13/15] tests/tcg/tricore: Add madd test
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (11 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 12/15] tests/tcg/tricore: Add ftoi test Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 14/15] tests/tcg/tricore: Add msub test Bastian Koppelmann
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      |  1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig |  1 +
 tests/tcg/tricore/macros.h                     | 18 ++++++++++++++++++
 tests/tcg/tricore/test_madd.S                  | 11 +++++++++++
 4 files changed, 31 insertions(+)
 create mode 100644 tests/tcg/tricore/test_madd.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index fcc7b6c1c9..8de005523e 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -10,6 +10,7 @@ TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
 TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
+TESTS += test_madd.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index 34da1f37de..fcc7b6c1c9 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -9,6 +9,7 @@ TESTS += test_clz.tst
 TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
 TESTS += test_fmul.tst
+TESTS += test_ftoi.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index e6a41cd1a2..0d76fc403a 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -9,6 +9,7 @@
 /* Register definitions */
 #define DREG_RS1 %d0
 #define DREG_RS2 %d1
+#define DREG_RS3 %d4
 #define DREG_CALC_RESULT %d1
 #define DREG_CALC_PSW %d2
 #define DREG_CORRECT_PSW %d3
@@ -85,6 +86,23 @@ test_ ## num:                                                      \
     insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2;          \
     )
 
+#define TEST_D_DDD_PSW(insn, num, result, psw, rs1, rs2, rs3) \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,         \
+    LI(DREG_RS1, rs1);                                        \
+    LI(DREG_RS2, rs2);                                        \
+    LI(DREG_RS3, rs3);                                        \
+    rstv;                                                     \
+    insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, DREG_RS3;      \
+    )
+
+#define TEST_D_DDI_PSW(insn, num, result, psw, rs1, rs2, imm) \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,         \
+    LI(DREG_RS1, rs1);                                        \
+    LI(DREG_RS2, rs2);                                        \
+    rstv;                                                     \
+    insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, imm;           \
+    )
+
 #define TEST_E_ED(insn, num, res_hi, res_lo, rs1_hi, rs1_lo, rs2) \
     TEST_CASE_E(num, res_lo, res_hi,                              \
     LI(EREG_RS1_LO, rs1_lo);                                      \
diff --git a/tests/tcg/tricore/test_madd.S b/tests/tcg/tricore/test_madd.S
new file mode 100644
index 0000000000..5d839772bb
--- /dev/null
+++ b/tests/tcg/tricore/test_madd.S
@@ -0,0 +1,11 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DDI_PSW(madd,    1, 0x0000fffd, 0x60000b80, 0x0000ffff, 0x7fffffff,2)
+    TEST_D_DDI_PSW(madd,    2, 0xffff7fff, 0x60000b80, 0xffff8001, 0x7fffffff,2)
+    TEST_D_DDD_PSW(madds.u, 3, 0xffffffff, 0x60000b80, 0x00000000, 0x80000000, \
+                             0x80000000)
+
+    TEST_PASSFAIL
+
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 14/15] tests/tcg/tricore: Add msub test
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (12 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 13/15] tests/tcg/tricore: Add madd test Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 17:00 ` [PATCH v3 15/15] tests/tcg/tricore: Add muls test Bastian Koppelmann
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      | 1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig | 1 +
 tests/tcg/tricore/test_msub.S                  | 9 +++++++++
 3 files changed, 11 insertions(+)
 create mode 100644 tests/tcg/tricore/test_msub.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 8de005523e..0fe6a86482 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -11,6 +11,7 @@ TESTS += test_fadd.tst
 TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
 TESTS += test_madd.tst
+TESTS += test_msub.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index fcc7b6c1c9..8de005523e 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -10,6 +10,7 @@ TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
 TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
+TESTS += test_madd.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_msub.S b/tests/tcg/tricore/test_msub.S
new file mode 100644
index 0000000000..6dee87d99c
--- /dev/null
+++ b/tests/tcg/tricore/test_msub.S
@@ -0,0 +1,9 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DDI_PSW(msub, 1, 0xd2fbe5e0, 0x00000b80,0x64003300, 0xff5420d4, -216)
+    TEST_D_DDI_PSW(msub, 2, 0xfffffc10, 0x00000b80,0xfffffe68, 0xfffffffd, -200)
+    TEST_D_DDD_PSW(msubs.u, 3, 0x0, 0x60000b80, 0x1, 0xffffffff, 0xffffffdb)
+    TEST_PASSFAIL
+
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 15/15] tests/tcg/tricore: Add muls test
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (13 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 14/15] tests/tcg/tricore: Add msub test Bastian Koppelmann
@ 2021-03-05 17:00 ` Bastian Koppelmann
  2021-03-05 18:00 ` [PATCH v3 00/15] tests/tcg: Add TriCore tests no-reply
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Bastian Koppelmann @ 2021-03-05 17:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: kbastian, alex.bennee

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      | 1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig | 1 +
 tests/tcg/tricore/test_muls.S                  | 9 +++++++++
 3 files changed, 11 insertions(+)
 create mode 100644 tests/tcg/tricore/test_muls.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 0fe6a86482..5007c60ce8 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -12,6 +12,7 @@ TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
 TESTS += test_madd.tst
 TESTS += test_msub.tst
+TESTS += test_muls.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index 8de005523e..0fe6a86482 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -11,6 +11,7 @@ TESTS += test_fadd.tst
 TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
 TESTS += test_madd.tst
+TESTS += test_msub.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_muls.S b/tests/tcg/tricore/test_muls.S
new file mode 100644
index 0000000000..ca517556bc
--- /dev/null
+++ b/tests/tcg/tricore/test_muls.S
@@ -0,0 +1,9 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(muls.u, 1, 0xffffffff, 0x78000b80, 0x80000001, 0xffffffff)
+    TEST_D_DD_PSW(muls.u, 2, 0xffffffff, 0x60000b80, 0xfffffffe, 0xffffffff)
+
+    TEST_PASSFAIL
+
-- 
2.30.1



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 00/15] tests/tcg: Add TriCore tests
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (14 preceding siblings ...)
  2021-03-05 17:00 ` [PATCH v3 15/15] tests/tcg/tricore: Add muls test Bastian Koppelmann
@ 2021-03-05 18:00 ` no-reply
  2021-04-06 10:36 ` Bastian Koppelmann
  2021-04-14 15:34 ` Alex Bennée
  17 siblings, 0 replies; 22+ messages in thread
From: no-reply @ 2021-03-05 18:00 UTC (permalink / raw)
  To: kbastian; +Cc: kbastian, alex.bennee, qemu-devel

Patchew URL: https://patchew.org/QEMU/20210305170045.869437-1-kbastian@mail.uni-paderborn.de/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210305170045.869437-1-kbastian@mail.uni-paderborn.de
Subject: [PATCH v3 00/15] tests/tcg: Add TriCore tests

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 - [tag update]      patchew/20210302175741.1079851-1-richard.henderson@linaro.org -> patchew/20210302175741.1079851-1-richard.henderson@linaro.org
 * [new tag]         patchew/20210305170045.869437-1-kbastian@mail.uni-paderborn.de -> patchew/20210305170045.869437-1-kbastian@mail.uni-paderborn.de
Switched to a new branch 'test'
785f2f1 tests/tcg/tricore: Add muls test
6ebe3c1 tests/tcg/tricore: Add msub test
0d35ed5 tests/tcg/tricore: Add madd test
a84017b tests/tcg/tricore: Add ftoi test
4826c78 tests/tcg/tricore: Add fmul test
5b6068a tests/tcg/tricore: Add fadd test
04b0e67 tests/tcg/tricore: Add dvstep test
a25a3b7 tests/tcg/tricore: Add clz test
d936575 tests/tcg/tricore: Add bmerge test
9dec54f tests/tcg/tricore: Add macros to create tests and first test 'abs'
1b6b30f configure: Emit HOST_CC to config-host.mak
b2cb09f tests/tcg/tricore: Add build infrastructure
babfdc2 hw/tricore: Add testdevice for tests in tests/tcg/
cdd7404 tests/tcg: Run timeout cmds using --foreground
b984fc1 tests/tcg: Add docker_as and docker_ld cmds

=== OUTPUT BEGIN ===
1/15 Checking commit b984fc156b90 (tests/tcg: Add docker_as and docker_ld cmds)
2/15 Checking commit cdd740438950 (tests/tcg: Run timeout cmds using --foreground)
3/15 Checking commit babfdc203cf6 (hw/tricore: Add testdevice for tests in tests/tcg/)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#65: 
new file mode 100644

total: 0 errors, 1 warnings, 151 lines checked

Patch 3/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
4/15 Checking commit b2cb09f9515b (tests/tcg/tricore: Add build infrastructure)
5/15 Checking commit 1b6b30f24216 (configure: Emit HOST_CC to config-host.mak)
6/15 Checking commit 9dec54ffbf04 (tests/tcg/tricore: Add macros to create tests and first test 'abs')
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
ERROR: line over 90 characters
#36: FILE: tests/tcg/configure.sh:105:
+    alpha|cris|hexagon|hppa|i386|lm32|microblaze|microblazeel|m68k|openrisc|riscv64|s390x|sh4|sparc64|tricore)

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#66: 
new file mode 100644

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#72: FILE: tests/tcg/tricore/macros.h:2:
+#define LI(reg, val)           \
+    mov.u reg, lo:val;         \
+    movh DREG_TEMP_LI, up:val; \
+    or reg, reg, DREG_TEMP_LI; \
+

ERROR: spaces required around that ':' (ctx:VxV)
#73: FILE: tests/tcg/tricore/macros.h:3:
+    mov.u reg, lo:val;         \
                  ^

ERROR: spaces required around that ':' (ctx:VxV)
#74: FILE: tests/tcg/tricore/macros.h:4:
+    movh DREG_TEMP_LI, up:val; \
                          ^

ERROR: spaces required around that '%' (ctx:WxV)
#80: FILE: tests/tcg/tricore/macros.h:10:
+#define DREG_RS1 %d0
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#80: FILE: tests/tcg/tricore/macros.h:10:
+#define DREG_RS1 %d0

ERROR: spaces required around that '%' (ctx:WxV)
#81: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_CALC_RESULT %d1
                          ^

ERROR: Macros with complex values should be enclosed in parenthesis
#81: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_CALC_RESULT %d1

ERROR: spaces required around that '%' (ctx:WxV)
#82: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_TEMP_LI %d10
                      ^

ERROR: Macros with complex values should be enclosed in parenthesis
#82: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_TEMP_LI %d10

ERROR: spaces required around that '%' (ctx:WxV)
#83: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_TEMP %d11
                   ^

ERROR: Macros with complex values should be enclosed in parenthesis
#83: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_TEMP %d11

ERROR: spaces required around that '%' (ctx:WxV)
#84: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_TEST_NUM %d14
                       ^

ERROR: Macros with complex values should be enclosed in parenthesis
#84: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_TEST_NUM %d14

ERROR: spaces required around that '%' (ctx:WxV)
#85: FILE: tests/tcg/tricore/macros.h:15:
+#define DREG_CORRECT_RESULT %d15
                             ^

ERROR: Macros with complex values should be enclosed in parenthesis
#85: FILE: tests/tcg/tricore/macros.h:15:
+#define DREG_CORRECT_RESULT %d15

ERROR: spaces required around that '%' (ctx:WxV)
#87: FILE: tests/tcg/tricore/macros.h:17:
+#define DREG_DEV_ADDR %a15
                       ^

ERROR: Macros with complex values should be enclosed in parenthesis
#87: FILE: tests/tcg/tricore/macros.h:17:
+#define DREG_DEV_ADDR %a15

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#90: FILE: tests/tcg/tricore/macros.h:20:
+#define TEST_CASE(num, testreg, correct, code...) \
+test_ ## num:                                     \
+    code;                                         \
+    LI(DREG_CORRECT_RESULT, correct)              \
+    mov DREG_TEST_NUM, num;                       \
+    jne testreg, DREG_CORRECT_RESULT, fail        \
+

ERROR: spaces required around that ':' (ctx:VxE)
#91: FILE: tests/tcg/tricore/macros.h:21:
+test_ ## num:                                     \
             ^

WARNING: Block comments use a leading /* on a separate line
#97: FILE: tests/tcg/tricore/macros.h:27:
+/* Actual test case type

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#109: FILE: tests/tcg/tricore/macros.h:39:
+#define TEST_PASSFAIL                       \
+        j pass;                             \
+fail:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j fail;                             \
+pass:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        mov DREG_TEST_NUM, 0;               \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j pass;

ERROR: space prohibited before open square bracket '['
#114: FILE: tests/tcg/tricore/macros.h:44:
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\

ERROR: space prohibited before open square bracket '['
#121: FILE: tests/tcg/tricore/macros.h:51:
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\

total: 23 errors, 2 warnings, 87 lines checked

Patch 6/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

7/15 Checking commit d93657590bf8 (tests/tcg/tricore: Add bmerge test)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
ERROR: spaces required around that '%' (ctx:WxV)
#36: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_RS2 %d1
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#36: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_RS2 %d1

ERROR: spaces required around that '%' (ctx:WxV)
#38: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_CALC_PSW %d2
                       ^

ERROR: Macros with complex values should be enclosed in parenthesis
#38: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_CALC_PSW %d2

ERROR: spaces required around that '%' (ctx:WxV)
#39: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_CORRECT_PSW %d3
                          ^

ERROR: Macros with complex values should be enclosed in parenthesis
#39: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_CORRECT_PSW %d3

ERROR: spaces required around that ':' (ctx:VxE)
#48: FILE: tests/tcg/tricore/macros.h:31:
+test_ ## num:                                                      \
             ^

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#79: 
new file mode 100644

total: 7 errors, 1 warnings, 58 lines checked

Patch 7/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

8/15 Checking commit a25a3b734c10 (tests/tcg/tricore: Add clz test)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#29: 
new file mode 100644

total: 0 errors, 1 warnings, 34 lines checked

Patch 8/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
9/15 Checking commit 04b0e6738bde (tests/tcg/tricore: Add dvstep test)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
ERROR: spaces required around that '%' (ctx:WxV)
#49: FILE: tests/tcg/tricore/macros.h:22:
+#define EREG_RS1 %e6
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#49: FILE: tests/tcg/tricore/macros.h:22:
+#define EREG_RS1 %e6

ERROR: spaces required around that '%' (ctx:WxV)
#50: FILE: tests/tcg/tricore/macros.h:23:
+#define EREG_RS1_LO %d6
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#50: FILE: tests/tcg/tricore/macros.h:23:
+#define EREG_RS1_LO %d6

ERROR: spaces required around that '%' (ctx:WxV)
#51: FILE: tests/tcg/tricore/macros.h:24:
+#define EREG_RS1_HI %d7
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#51: FILE: tests/tcg/tricore/macros.h:24:
+#define EREG_RS1_HI %d7

ERROR: spaces required around that '%' (ctx:WxV)
#52: FILE: tests/tcg/tricore/macros.h:25:
+#define EREG_RS2 %e8
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#52: FILE: tests/tcg/tricore/macros.h:25:
+#define EREG_RS2 %e8

ERROR: spaces required around that '%' (ctx:WxV)
#53: FILE: tests/tcg/tricore/macros.h:26:
+#define EREG_RS2_LO %d8
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#53: FILE: tests/tcg/tricore/macros.h:26:
+#define EREG_RS2_LO %d8

ERROR: spaces required around that '%' (ctx:WxV)
#54: FILE: tests/tcg/tricore/macros.h:27:
+#define EREG_RS2_HI %d9
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#54: FILE: tests/tcg/tricore/macros.h:27:
+#define EREG_RS2_HI %d9

ERROR: spaces required around that '%' (ctx:WxV)
#55: FILE: tests/tcg/tricore/macros.h:28:
+#define EREG_CALC_RESULT %e8
                          ^

ERROR: Macros with complex values should be enclosed in parenthesis
#55: FILE: tests/tcg/tricore/macros.h:28:
+#define EREG_CALC_RESULT %e8

ERROR: spaces required around that '%' (ctx:WxV)
#56: FILE: tests/tcg/tricore/macros.h:29:
+#define EREG_CALC_RESULT_HI %d9
                             ^

ERROR: Macros with complex values should be enclosed in parenthesis
#56: FILE: tests/tcg/tricore/macros.h:29:
+#define EREG_CALC_RESULT_HI %d9

ERROR: spaces required around that '%' (ctx:WxV)
#57: FILE: tests/tcg/tricore/macros.h:30:
+#define EREG_CALC_RESULT_LO %d8
                             ^

ERROR: Macros with complex values should be enclosed in parenthesis
#57: FILE: tests/tcg/tricore/macros.h:30:
+#define EREG_CALC_RESULT_LO %d8

ERROR: spaces required around that '%' (ctx:WxV)
#58: FILE: tests/tcg/tricore/macros.h:31:
+#define EREG_CORRECT_RESULT_LO %d0
                                ^

ERROR: Macros with complex values should be enclosed in parenthesis
#58: FILE: tests/tcg/tricore/macros.h:31:
+#define EREG_CORRECT_RESULT_LO %d0

ERROR: spaces required around that '%' (ctx:WxV)
#59: FILE: tests/tcg/tricore/macros.h:32:
+#define EREG_CORRECT_RESULT_HI %d1
                                ^

ERROR: Macros with complex values should be enclosed in parenthesis
#59: FILE: tests/tcg/tricore/macros.h:32:
+#define EREG_CORRECT_RESULT_HI %d1

ERROR: spaces required around that ':' (ctx:VxE)
#69: FILE: tests/tcg/tricore/macros.h:43:
+test_ ## num:                                              \
             ^

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#96: 
new file mode 100644

total: 23 errors, 1 warnings, 76 lines checked

Patch 9/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

10/15 Checking commit 5b6068a01b76 (tests/tcg/tricore: Add fadd test)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#41: 
new file mode 100644

total: 0 errors, 1 warnings, 30 lines checked

Patch 10/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/15 Checking commit 4826c78c990d (tests/tcg/tricore: Add fmul test)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#41: 
new file mode 100644

total: 0 errors, 1 warnings, 22 lines checked

Patch 11/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
12/15 Checking commit a84017baab90 (tests/tcg/tricore: Add ftoi test)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#60: 
new file mode 100644

total: 0 errors, 1 warnings, 37 lines checked

Patch 12/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
13/15 Checking commit 0d35ed524fc2 (tests/tcg/tricore: Add madd test)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
ERROR: spaces required around that '%' (ctx:WxV)
#49: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_RS3 %d4
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#49: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_RS3 %d4

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#78: 
new file mode 100644

total: 2 errors, 1 warnings, 55 lines checked

Patch 13/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

14/15 Checking commit 6ebe3c1d09fb (tests/tcg/tricore: Add msub test)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#41: 
new file mode 100644

total: 0 errors, 1 warnings, 23 lines checked

Patch 14/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
15/15 Checking commit 785f2f191e37 (tests/tcg/tricore: Add muls test)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#41: 
new file mode 100644

total: 0 errors, 1 warnings, 23 lines checked

Patch 15/15 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20210305170045.869437-1-kbastian@mail.uni-paderborn.de/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 00/15] tests/tcg: Add TriCore tests
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (15 preceding siblings ...)
  2021-03-05 18:00 ` [PATCH v3 00/15] tests/tcg: Add TriCore tests no-reply
@ 2021-04-06 10:36 ` Bastian Koppelmann
  2021-04-06 18:03   ` Alex Bennée
  2021-04-14 15:34 ` Alex Bennée
  17 siblings, 1 reply; 22+ messages in thread
From: Bastian Koppelmann @ 2021-04-06 10:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

On Fri, Mar 05, 2021 at 06:00:30PM +0100, Bastian Koppelmann wrote:
> Hi Alex,
> 
> after a long while and thanks to Thomas reminder, I finally came back to this
> series. I addressed most of your comments except for the timeout --foreground
> problem (see https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00921.html). 
> I just couldn't figure out why QEMU hangs when run from the Makefile.
> 
> You can find the full tree here:
> https://github.com/bkoppelmann/qemu/tree/tricore-tcg-tests2
> 
> Cheers,
> Bastian

ping?

Cheers,
Bastian


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 00/15] tests/tcg: Add TriCore tests
  2021-04-06 10:36 ` Bastian Koppelmann
@ 2021-04-06 18:03   ` Alex Bennée
  0 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2021-04-06 18:03 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> On Fri, Mar 05, 2021 at 06:00:30PM +0100, Bastian Koppelmann wrote:
>> Hi Alex,
>> 
>> after a long while and thanks to Thomas reminder, I finally came back to this
>> series. I addressed most of your comments except for the timeout --foreground
>> problem (see https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00921.html). 
>> I just couldn't figure out why QEMU hangs when run from the Makefile.
>> 
>> You can find the full tree here:
>> https://github.com/bkoppelmann/qemu/tree/tricore-tcg-tests2
>> 
>> Cheers,
>> Bastian
>
> ping?

Sorry it dropped off my radar, added to the TODO list.

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 01/15] tests/tcg: Add docker_as and docker_ld cmds
  2021-03-05 17:00 ` [PATCH v3 01/15] tests/tcg: Add docker_as and docker_ld cmds Bastian Koppelmann
@ 2021-04-14 13:40   ` Alex Bennée
  2021-04-14 14:58   ` Alex Bennée
  1 sibling, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2021-04-14 13:40 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> At least for the TriCore target no easily available c compiler exists.
> Thus we need to rely on "as" and "ld". This allows us to run them
> through the docker image as well as with locally installed tools.
>
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> ---
> v2 -> v3:
>     - emit CROSS_LD_GUEST/CROSS_AS_GUEST
>
>  tests/tcg/Makefile.qemu | 15 +++++++++++++++
>  tests/tcg/configure.sh  | 20 ++++++++++++++++++++
>  2 files changed, 35 insertions(+)
>
> diff --git a/tests/tcg/Makefile.qemu b/tests/tcg/Makefile.qemu
> index a56564660c..fefb50903d 100644
> --- a/tests/tcg/Makefile.qemu
> +++ b/tests/tcg/Makefile.qemu
> @@ -22,6 +22,8 @@ quiet-@ = $(if $(V),,@)
>  quiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3)
>  
>  CROSS_CC_GUEST:=
> +CROSS_AS_GUEST:=
> +CROSS_LD_GUEST:=
>  DOCKER_IMAGE:=
>  
>  -include tests/tcg/config-$(TARGET).mak
> @@ -42,6 +44,7 @@ cross-build-guest-tests:
>  	$(call quiet-command, \
>  	   (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
>  	    $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC="$(CROSS_CC_GUEST)" \
> +			AS="$(CROSS_AS_GUEST) LD="$(CROSS_LD_GUEST)" \
>  			SRC_PATH="$(SRC_PATH)" BUILD_STATIC=$(CROSS_CC_GUEST_STATIC) \
>  			EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
>  	"BUILD","$(TARGET) guest-tests with $(CROSS_CC_GUEST)")
> @@ -59,11 +62,23 @@ DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc \
>  		-i qemu/$(DOCKER_IMAGE) \
>  		-s $(SRC_PATH) -- "
>  
> +DOCKER_AS_CMD="$(DOCKER_SCRIPT) cc \
> +		--cc $(DOCKER_CROSS_AS_GUEST) \
> +		-i qemu/$(DOCKER_IMAGE) \
> +		-s $(SRC_PATH) -- "
> +
> +DOCKER_LD_CMD="$(DOCKER_SCRIPT) cc \
> +		--cc $(DOCKER_CROSS_LD_GUEST) \
> +		-i qemu/$(DOCKER_IMAGE) \
> +		-s $(SRC_PATH) -- "
> +
> +
>  .PHONY: docker-build-guest-tests
>  docker-build-guest-tests: docker-image-$(DOCKER_IMAGE)
>  	$(call quiet-command, \
>  	  (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
>  	   $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC=$(DOCKER_COMPILE_CMD) \
> +			AS=$(DOCKER_AS_CMD) LD=$(DOCKER_LD_CMD) \
>  			SRC_PATH="$(SRC_PATH)" BUILD_STATIC=y \
>  			EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
>  	"BUILD","$(TARGET) guest-tests with docker qemu/$(DOCKER_IMAGE)")
> diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
> index 36b8a73a54..4da8c3fa12 100755
> --- a/tests/tcg/configure.sh
> +++ b/tests/tcg/configure.sh
> @@ -72,6 +72,12 @@ fi
>  : ${cross_cc_x86_64="x86_64-pc-linux-gnu-gcc"}
>  : ${cross_cc_cflags_x86_64="-m64"}
>  
> +# cross as defaults, can be overridden with --cross-as-ARCH
> +: ${cross_as_tricore="tricore-as"}
> +
> +# cross ld defaults, can be overridden with --cross-ld-ARCH
> +: ${cross_as_tricore="tricore-ld"}
> +

These explicit defaults should be in a separate patch.

>  for target in $target_list; do
>    arch=${target%%-*}
>    case $arch in
> @@ -228,6 +234,18 @@ for target in $target_list; do
>      fi
>      echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
>  
> +    eval "target_as=\${cross_as_$i}"
> +    if has $target_as; then
> +      echo "CROSS_AS_GUEST=$target_as" >> $config_target_mak
> +      continue
> +    fi

Should there be any attempt to verify the assembler will do something.
If you passed --cross-as-tricore=/bin/false to force the use of the
docker container it wouldn't work because we assume if it's there it
works.

> +
> +    eval "target_ld=\${cross_ld_$i}"
> +    if has $target_ld; then
> +      echo "CROSS_LD_GUEST=$target_ld" >> $config_target_mak
> +      continue
> +    fi
> +
>      # Test for compiler features for optional tests. We only do this
>      # for cross compilers because ensuring the docker containers based
>      # compilers is a requirememt for adding a new test that needs a
> @@ -261,5 +279,7 @@ for target in $target_list; do
>    if test $got_cross_cc = no && test "$container" != no && test -n "$container_image"; then
>      echo "DOCKER_IMAGE=$container_image" >> $config_target_mak
>      echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak
> +    echo "DOCKER_CROSS_AS_GUEST=$container_cross_as" >> $config_target_mak
> +    echo "DOCKER_CROSS_LD_GUEST=$container_cross_ld" >>
> $config_target_mak

Could we gate these on being defined please?

>    fi
>  done


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 01/15] tests/tcg: Add docker_as and docker_ld cmds
  2021-03-05 17:00 ` [PATCH v3 01/15] tests/tcg: Add docker_as and docker_ld cmds Bastian Koppelmann
  2021-04-14 13:40   ` Alex Bennée
@ 2021-04-14 14:58   ` Alex Bennée
  1 sibling, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2021-04-14 14:58 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> At least for the TriCore target no easily available c compiler exists.
> Thus we need to rely on "as" and "ld". This allows us to run them
> through the docker image as well as with locally installed tools.
>
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> ---
> v2 -> v3:
>     - emit CROSS_LD_GUEST/CROSS_AS_GUEST
>
>  tests/tcg/Makefile.qemu | 15 +++++++++++++++
>  tests/tcg/configure.sh  | 20 ++++++++++++++++++++
>  2 files changed, 35 insertions(+)
>
> diff --git a/tests/tcg/Makefile.qemu b/tests/tcg/Makefile.qemu
> index a56564660c..fefb50903d 100644
> --- a/tests/tcg/Makefile.qemu
> +++ b/tests/tcg/Makefile.qemu
> @@ -22,6 +22,8 @@ quiet-@ = $(if $(V),,@)
>  quiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3)
>  
>  CROSS_CC_GUEST:=
> +CROSS_AS_GUEST:=
> +CROSS_LD_GUEST:=
>  DOCKER_IMAGE:=
>  
>  -include tests/tcg/config-$(TARGET).mak
> @@ -42,6 +44,7 @@ cross-build-guest-tests:
>  	$(call quiet-command, \
>  	   (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
>  	    $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC="$(CROSS_CC_GUEST)" \
> +			AS="$(CROSS_AS_GUEST) LD="$(CROSS_LD_GUEST)" \

Also missing quote on AS="

>  			SRC_PATH="$(SRC_PATH)" BUILD_STATIC=$(CROSS_CC_GUEST_STATIC) \
>  			EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
>  	"BUILD","$(TARGET) guest-tests with $(CROSS_CC_GUEST)")
> @@ -59,11 +62,23 @@ DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc \
>  		-i qemu/$(DOCKER_IMAGE) \
>  		-s $(SRC_PATH) -- "
>  
> +DOCKER_AS_CMD="$(DOCKER_SCRIPT) cc \
> +		--cc $(DOCKER_CROSS_AS_GUEST) \
> +		-i qemu/$(DOCKER_IMAGE) \
> +		-s $(SRC_PATH) -- "
> +
> +DOCKER_LD_CMD="$(DOCKER_SCRIPT) cc \
> +		--cc $(DOCKER_CROSS_LD_GUEST) \
> +		-i qemu/$(DOCKER_IMAGE) \
> +		-s $(SRC_PATH) -- "
> +
> +
>  .PHONY: docker-build-guest-tests
>  docker-build-guest-tests: docker-image-$(DOCKER_IMAGE)
>  	$(call quiet-command, \
>  	  (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
>  	   $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC=$(DOCKER_COMPILE_CMD) \
> +			AS=$(DOCKER_AS_CMD) LD=$(DOCKER_LD_CMD) \
>  			SRC_PATH="$(SRC_PATH)" BUILD_STATIC=y \
>  			EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
>  	"BUILD","$(TARGET) guest-tests with docker qemu/$(DOCKER_IMAGE)")
> diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
> index 36b8a73a54..4da8c3fa12 100755
> --- a/tests/tcg/configure.sh
> +++ b/tests/tcg/configure.sh
> @@ -72,6 +72,12 @@ fi
>  : ${cross_cc_x86_64="x86_64-pc-linux-gnu-gcc"}
>  : ${cross_cc_cflags_x86_64="-m64"}
>  
> +# cross as defaults, can be overridden with --cross-as-ARCH
> +: ${cross_as_tricore="tricore-as"}
> +
> +# cross ld defaults, can be overridden with --cross-ld-ARCH
> +: ${cross_as_tricore="tricore-ld"}
> +
>  for target in $target_list; do
>    arch=${target%%-*}
>    case $arch in
> @@ -228,6 +234,18 @@ for target in $target_list; do
>      fi
>      echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
>  
> +    eval "target_as=\${cross_as_$i}"
> +    if has $target_as; then
> +      echo "CROSS_AS_GUEST=$target_as" >> $config_target_mak
> +      continue
> +    fi
> +
> +    eval "target_ld=\${cross_ld_$i}"
> +    if has $target_ld; then
> +      echo "CROSS_LD_GUEST=$target_ld" >> $config_target_mak
> +      continue
> +    fi
> +
>      # Test for compiler features for optional tests. We only do this
>      # for cross compilers because ensuring the docker containers based
>      # compilers is a requirememt for adding a new test that needs a
> @@ -261,5 +279,7 @@ for target in $target_list; do
>    if test $got_cross_cc = no && test "$container" != no && test -n "$container_image"; then
>      echo "DOCKER_IMAGE=$container_image" >> $config_target_mak
>      echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak
> +    echo "DOCKER_CROSS_AS_GUEST=$container_cross_as" >> $config_target_mak
> +    echo "DOCKER_CROSS_LD_GUEST=$container_cross_ld" >> $config_target_mak
>    fi
>  done


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v3 00/15] tests/tcg: Add TriCore tests
  2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
                   ` (16 preceding siblings ...)
  2021-04-06 10:36 ` Bastian Koppelmann
@ 2021-04-14 15:34 ` Alex Bennée
  17 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2021-04-14 15:34 UTC (permalink / raw)
  To: Bastian Koppelmann; +Cc: qemu-devel


Bastian Koppelmann <kbastian@mail.uni-paderborn.de> writes:

> Hi Alex,
>
> after a long while and thanks to Thomas reminder, I finally came back to this
> series. I addressed most of your comments except for the timeout --foreground
> problem (see https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00921.html). 
> I just couldn't figure out why QEMU hangs when run from the Makefile.

As I'm refactoring configure.sh anyway I have pulled the series and made
the suggested changes myself. Queued to testing/next, thanks.
>
> You can find the full tree here:
> https://github.com/bkoppelmann/qemu/tree/tricore-tcg-tests2
>
> Cheers,
> Bastian
>
> Bastian Koppelmann (15):
>   tests/tcg: Add docker_as and docker_ld cmds
>   tests/tcg: Run timeout cmds using --foreground
>   hw/tricore: Add testdevice for tests in tests/tcg/
>   tests/tcg/tricore: Add build infrastructure
>   configure: Emit HOST_CC to config-host.mak
>   tests/tcg/tricore: Add macros to create tests and first test 'abs'
>   tests/tcg/tricore: Add bmerge test
>   tests/tcg/tricore: Add clz test
>   tests/tcg/tricore: Add dvstep test
>   tests/tcg/tricore: Add fadd test
>   tests/tcg/tricore: Add fmul test
>   tests/tcg/tricore: Add ftoi test
>   tests/tcg/tricore: Add madd test
>   tests/tcg/tricore: Add msub test
>   tests/tcg/tricore: Add muls test
>
>  MAINTAINERS                                   |   1 +
>  configure                                     |   1 +
>  hw/tricore/meson.build                        |   1 +
>  hw/tricore/tricore_testboard.c                |   8 ++
>  hw/tricore/tricore_testdevice.c               |  82 +++++++++++
>  include/hw/tricore/tricore_testdevice.h       |  38 ++++++
>  tests/tcg/Makefile.qemu                       |  15 ++
>  tests/tcg/Makefile.target                     |   5 +-
>  tests/tcg/configure.sh                        |  27 +++-
>  tests/tcg/tricore/Makefile.softmmu-target     |  26 ++++
>  .../tcg/tricore/Makefile.softmmu-target.orig  |  25 ++++
>  tests/tcg/tricore/link.ld                     |  60 ++++++++
>  tests/tcg/tricore/macros.h                    | 129 ++++++++++++++++++
>  tests/tcg/tricore/test_abs.S                  |   7 +
>  tests/tcg/tricore/test_bmerge.S               |   8 ++
>  tests/tcg/tricore/test_clz.S                  |   9 ++
>  tests/tcg/tricore/test_dvstep.S               |  15 ++
>  tests/tcg/tricore/test_fadd.S                 |  16 +++
>  tests/tcg/tricore/test_fmul.S                 |   8 ++
>  tests/tcg/tricore/test_ftoi.S                 |  10 ++
>  tests/tcg/tricore/test_madd.S                 |  11 ++
>  tests/tcg/tricore/test_msub.S                 |   9 ++
>  tests/tcg/tricore/test_muls.S                 |   9 ++
>  23 files changed, 517 insertions(+), 3 deletions(-)
>  create mode 100644 hw/tricore/tricore_testdevice.c
>  create mode 100644 include/hw/tricore/tricore_testdevice.h
>  create mode 100644 tests/tcg/tricore/Makefile.softmmu-target
>  create mode 100644 tests/tcg/tricore/Makefile.softmmu-target.orig
>  create mode 100644 tests/tcg/tricore/link.ld
>  create mode 100644 tests/tcg/tricore/macros.h
>  create mode 100644 tests/tcg/tricore/test_abs.S
>  create mode 100644 tests/tcg/tricore/test_bmerge.S
>  create mode 100644 tests/tcg/tricore/test_clz.S
>  create mode 100644 tests/tcg/tricore/test_dvstep.S
>  create mode 100644 tests/tcg/tricore/test_fadd.S
>  create mode 100644 tests/tcg/tricore/test_fmul.S
>  create mode 100644 tests/tcg/tricore/test_ftoi.S
>  create mode 100644 tests/tcg/tricore/test_madd.S
>  create mode 100644 tests/tcg/tricore/test_msub.S
>  create mode 100644 tests/tcg/tricore/test_muls.S


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2021-04-14 15:37 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 17:00 [PATCH v3 00/15] tests/tcg: Add TriCore tests Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 01/15] tests/tcg: Add docker_as and docker_ld cmds Bastian Koppelmann
2021-04-14 13:40   ` Alex Bennée
2021-04-14 14:58   ` Alex Bennée
2021-03-05 17:00 ` [PATCH v3 02/15] tests/tcg: Run timeout cmds using --foreground Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 03/15] hw/tricore: Add testdevice for tests in tests/tcg/ Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 04/15] tests/tcg/tricore: Add build infrastructure Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 05/15] configure: Emit HOST_CC to config-host.mak Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 06/15] tests/tcg/tricore: Add macros to create tests and first test 'abs' Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 07/15] tests/tcg/tricore: Add bmerge test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 08/15] tests/tcg/tricore: Add clz test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 09/15] tests/tcg/tricore: Add dvstep test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 10/15] tests/tcg/tricore: Add fadd test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 11/15] tests/tcg/tricore: Add fmul test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 12/15] tests/tcg/tricore: Add ftoi test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 13/15] tests/tcg/tricore: Add madd test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 14/15] tests/tcg/tricore: Add msub test Bastian Koppelmann
2021-03-05 17:00 ` [PATCH v3 15/15] tests/tcg/tricore: Add muls test Bastian Koppelmann
2021-03-05 18:00 ` [PATCH v3 00/15] tests/tcg: Add TriCore tests no-reply
2021-04-06 10:36 ` Bastian Koppelmann
2021-04-06 18:03   ` Alex Bennée
2021-04-14 15:34 ` Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).