From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525185194828709.2227998678696; Tue, 1 May 2018 07:33:14 -0700 (PDT) Received: from localhost ([::1]:42828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWLA-0004fe-12 for importer@patchew.org; Tue, 01 May 2018 10:33:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBC-0004v1-LK for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWB9-00034a-8j for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:54 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:51886) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWB8-00033P-Ut for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qqMQRMMHaPlUSFFNJqPWpbICcMtyBeIIt1ALpJG93qc=; b=ZWaola/Ze+lJGpg1NKO3b3tAs PlE4l388APt3hipWdak7zazIsdjjMOMlCR8Uk+6b8XVY+wVrTMr0/fsGz/qNKkzX7XdEYRjZCL2Uj dP44tBBL1TfDcdoGqpo/z6NtzXE8Zyz+uO1W590blLV4CKIKUsJfwz1wccLtVz6AV9ehc=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:11 +0200 Message-Id: <20180501142222.19154-2-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141516, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.5.1.5491001 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 01/12] hw/tricore: Add testdevice for tests in tests/tcg/ X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Bastian Koppelmann Reviewed-by: Alex Benn=C3=A9e --- hw/tricore/Makefile.objs | 1 + hw/tricore/tricore_testboard.c | 8 ++++ hw/tricore/tricore_testdevice.c | 81 +++++++++++++++++++++++++++++= ++++ include/hw/tricore/tricore_testdevice.h | 38 ++++++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 hw/tricore/tricore_testdevice.c create mode 100644 include/hw/tricore/tricore_testdevice.h diff --git a/hw/tricore/Makefile.objs b/hw/tricore/Makefile.objs index 435e095cff..9e871a01e2 100644 --- a/hw/tricore/Makefile.objs +++ b/hw/tricore/Makefile.objs @@ -1 +1,2 @@ obj-y +=3D tricore_testboard.o +obj-y +=3D tricore_testdevice.o diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c index 8e61dfc3e6..ee0a332e12 100644 --- a/hw/tricore/tricore_testboard.c +++ b/hw/tricore/tricore_testboard.c @@ -31,6 +31,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" =20 =20 @@ -60,6 +61,7 @@ static void tricore_testboard_init(MachineState *machine,= int board_id) { TriCoreCPU *cpu; CPUTriCoreState *env; + TriCoreTestDeviceState *test_dev; =20 MemoryRegion *sysmem =3D get_system_memory(); MemoryRegion *ext_cram =3D g_new(MemoryRegion, 1); @@ -91,6 +93,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); =20 + /* test device */ + test_dev =3D 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 =3D machine->ram_size; tricoretb_binfo.kernel_filename =3D machine->kernel_filename; =20 diff --git a/hw/tricore/tricore_testdevice.c b/hw/tricore/tricore_testdevic= e.c new file mode 100644 index 0000000000..ce4c67fcae --- /dev/null +++ b/hw/tricore/tricore_testdevice.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2018 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 . + */ + +#include "qemu/osdep.h" +#include "hw/sysbus.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 =3D { + .read =3D tricore_testdevice_read, + .write =3D tricore_testdevice_write, + .valid =3D { + .min_access_size =3D 4, + .max_access_size =3D 4, + }, + .endianness =3D DEVICE_NATIVE_ENDIAN, +}; + +static void tricore_testdevice_init(Object *obj) +{ + TriCoreTestDeviceState *s =3D 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[] =3D { + DEFINE_PROP_END_OF_LIST() +}; + +static void tricore_testdevice_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + dc->props =3D tricore_testdevice_properties; + dc->reset =3D tricore_testdevice_reset; +} + +static const TypeInfo tricore_testdevice_info =3D { + .name =3D TYPE_TRICORE_TESTDEVICE, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(TriCoreTestDeviceState), + .instance_init =3D tricore_testdevice_init, + .class_init =3D 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/t= ricore_testdevice.h new file mode 100644 index 0000000000..5b2df219e3 --- /dev/null +++ b/include/hw/tricore/tricore_testdevice.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018 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 . + */ + + +#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 { + /* */ + SysBusDevice parent_obj; + + /* */ + MemoryRegion iomem; + +} TriCoreTestDeviceState; + +#endif --=20 2.11.0 From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525184701923673.2676843999474; Tue, 1 May 2018 07:25:01 -0700 (PDT) Received: from localhost ([::1]:42765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWDF-0006Ck-74 for importer@patchew.org; Tue, 01 May 2018 10:25:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBC-0004uz-LF for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWB9-00034v-Df for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:54 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:51898) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWB9-00033o-7D for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CJxUya8F9g+axwd+wX50hjz1+p24EDhDJMg885JVk1k=; b=ulh6DZsLC01beRds+sILtoSC7 9aC2jL18q6VP1iXvYtNQikRxZ+VzLh8Ly2Dey3Qx39BJ9nSFLXebrOvU/li2A1yW3cEGbkHPkwW7w jjK5Eso5/wXdyxtYcRUvBiGMYd8YLrilK6Uyr3AwJ94yO4dW/LUVbAnz/ovUx7oNWTQFQ=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:12 +0200 Message-Id: <20180501142222.19154-3-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141516, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.4.9.5491000 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 02/12] tests/tcg/tricore: Add build infrastructure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" this includes the Makefile and linker script to build all the tests. Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile | 30 +++++++++++++++++++++++ tests/tcg/tricore/link.ld | 60 ++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 90 insertions(+) create mode 100644 tests/tcg/tricore/Makefile create mode 100644 tests/tcg/tricore/link.ld diff --git a/tests/tcg/tricore/Makefile b/tests/tcg/tricore/Makefile new file mode 100644 index 0000000000..8c168d1062 --- /dev/null +++ b/tests/tcg/tricore/Makefile @@ -0,0 +1,30 @@ +AS :=3D tricore-as +LD :=3D tricore-ld +HOST_CC =3D gcc + +LDFLAGS =3D -Tlink.ld +ASFLAGS =3D + +SIM =3D ../../../tricore-softmmu/qemu-system-tricore +SIMFLAGS =3D -M tricore_testboard -nographic -kernel + +all: build + +%.pS: %.S + $(HOST_CC) -E -o $@ $< + +%.o: %.pS + $(AS) $(ASFLAGS) -o $@ $< + +%.tst: %.o link.ld + $(LD) $(LDFLAGS) $< -o $@ + +build: $(TESTCASES) + +check: $(addprefix run-, $(TESTCASES)) + +run-%.tst: %.tst + $(SIM) $(SIMFLAGS) ./$< + +clean: + $(RM) -fr $(TESTCASES) linker.ld 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 =3D 0x80000000, len =3D 15K + data_ram (w!xp): org =3D 0xd0000000, len =3D 130K +} +/* + * Define the sizes of the user and system stacks. + */ +__USTACK_SIZE =3D DEFINED (__USTACK_SIZE) ? __USTACK_SIZE : 1K ; +/* + * Define the start address and the size of the context save area. + */ +__CSA_BEGIN =3D 0xd0000000 ; +__CSA_SIZE =3D 8k ; +__CSA_END =3D __CSA_BEGIN + __CSA_SIZE ; + +SECTIONS +{ + .text : + { + *(.text) + . =3D ALIGN(8); + } > text_ram + + .rodata : + { + *(.rodata) + *(.rodata1) + } > data_ram + + .data : + { + . =3D ALIGN(8) ; + *(.data) + *(.data.*) + . =3D ALIGN(8) ; + __USTACK =3D . + __USTACK_SIZE -768; + + } > data_ram + /* + * Allocate space for BSS sections. + */ + .bss : + { + BSS_BASE =3D . ; + *(.bss) + *(COMMON) + . =3D ALIGN(8) ; + } > data_ram + /* Make sure CSA, stack and heap addresses are properly aligned. */ + _. =3D ASSERT ((__CSA_BEGIN & 0x3f) =3D=3D 0 , "illegal CSA start addres= s") ; + _. =3D ASSERT ((__CSA_SIZE & 0x3f) =3D=3D 0 , "illegal CSA size") ; + +} --=20 2.11.0 From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525184698173366.0896891063686; Tue, 1 May 2018 07:24:58 -0700 (PDT) Received: from localhost ([::1]:42764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWDB-000682-Ej for importer@patchew.org; Tue, 01 May 2018 10:24:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBC-0004uy-LH for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWB9-000357-LH for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:54 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:51906) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWB9-00033v-EM for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CJzYV7RLyvHnNCPMoBPQ12LEavZUTCmIGY6+IxX5bXY=; b=R/Reb5OOcH4JtzaR9iPD6XrUo 0/dUizcjfzYygKdXyAlhSlzPI23zNYMMyQAoWvTgYXH4ojy1zd92NItf90zwbKbE5mr4ZlJu5Bi+H faOuFkshczwLHgxfXPxZ8GniHxlRNrfcqrr4zXmo9nQYNOJNKSrgQm6PE/C9yV4W3hXds=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:13 +0200 Message-Id: <20180501142222.19154-4-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141817, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.3.29.5491001 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 03/12] tests/tcg/tricore: Add macros to easily create tests and first test 'abs' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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. This 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 co= de. If all tests pass we write back 0 as a status code and exit. Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile | 2 ++ tests/tcg/tricore/macros.h | 53 ++++++++++++++++++++++++++++++++++++++++= ++++ tests/tcg/tricore/test_abs.S | 8 +++++++ 3 files changed, 63 insertions(+) create mode 100644 tests/tcg/tricore/macros.h create mode 100644 tests/tcg/tricore/test_abs.S diff --git a/tests/tcg/tricore/Makefile b/tests/tcg/tricore/Makefile index 8c168d1062..a0e1f4b20d 100644 --- a/tests/tcg/tricore/Makefile +++ b/tests/tcg/tricore/Makefile @@ -8,6 +8,8 @@ ASFLAGS =3D SIM =3D ../../../tricore-softmmu/qemu-system-tricore SIMFLAGS =3D -M tricore_testboard -nographic -kernel =20 +TESTCASES +=3D test_abs.tst + all: build =20 %.pS: %.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..acc143901c --- /dev/null +++ b/tests/tcg/tricore/test_abs.S @@ -0,0 +1,8 @@ +#include "macros.h" +.text +.global _start +_start: + TEST_D_D(abs, 1, 0, 0) + + TEST_PASSFAIL + --=20 2.11.0 From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525184878993830.254882786337; Tue, 1 May 2018 07:27:58 -0700 (PDT) Received: from localhost ([::1]:42783 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWFz-0000Af-31 for importer@patchew.org; Tue, 01 May 2018 10:27:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBC-0004v2-Lu for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWB9-00035M-UO for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:54 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:51918) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWB9-000347-Nh for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/kla4O1KYAh++z3mPG+6D4DVuXnpCgSYmRT8ctcq0w4=; b=aNvN4+LkunL5lOnEqBPiIeDLv WjXVpgYsuxUm0vkhy4G+cEJCu9eySnrxrk8q3S/7ZR53J3fCuLB9mnhd/nYs9I2LGkwJd3DQe5Ahq CTkjpiMVZKh0yuW6FQENYvqwgcXAwWUTzRTdYABVMHgXQyWCZ8gjng+RWn/PU7tO4D5Vo=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:14 +0200 Message-Id: <20180501142222.19154-5-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141817, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.3.29.5491001 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 04/12] tests/tcg/tricore: Add bmerge test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile | 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 b/tests/tcg/tricore/Makefile index a0e1f4b20d..34c91dccf5 100644 --- a/tests/tcg/tricore/Makefile +++ b/tests/tcg/tricore/Makefile @@ -9,6 +9,7 @@ SIM =3D ../../../tricore-softmmu/qemu-system-tricore SIMFLAGS =3D -M tricore_testboard -nographic -kernel =20 TESTCASES +=3D test_abs.tst +TESTCASES +=3D test_bmerge.tst =20 all: build =20 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 \ =20 +#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; \ ) =20 +#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_bmerg= e.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, 0x0000fff= f) + + TEST_PASSFAIL + --=20 2.11.0 From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525184768104559.7192358941475; Tue, 1 May 2018 07:26:08 -0700 (PDT) Received: from localhost ([::1]:42772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWEJ-0007Ai-C2 for importer@patchew.org; Tue, 01 May 2018 10:26:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBC-0004uw-LB for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWBA-00035i-9e for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:54 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:51930) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWBA-00034i-1Z for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=a28DrYjTITggoA/l3rHkIJiAFujzvACIAurrRViX8vA=; b=GNoK5OzZJgO87OL3x/8/wm2Mu HacDy8ml5EI3XBdI2Fa+gB2NcooNkVCEyfqV5f4Wh8T6mxbfg/Fgsz/nTCuvVdWW6VUPZcXNdHIdH lIIIaw5IMaZWwHCieEPPm5FBgrskCYXZvHixkYr0TduzQ4J7mkb9K2RFv5zowsdZL4CCY=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:15 +0200 Message-Id: <20180501142222.19154-6-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141516, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.5.1.5491001 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 05/12] tests/tcg/tricore: Add clz test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile | 1 + tests/tcg/tricore/test_clz.S | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 tests/tcg/tricore/test_clz.S diff --git a/tests/tcg/tricore/Makefile b/tests/tcg/tricore/Makefile index 34c91dccf5..16ec5460d7 100644 --- a/tests/tcg/tricore/Makefile +++ b/tests/tcg/tricore/Makefile @@ -10,6 +10,7 @@ SIMFLAGS =3D -M tricore_testboard -nographic -kernel =20 TESTCASES +=3D test_abs.tst TESTCASES +=3D test_bmerge.tst +TESTCASES +=3D test_clz.tst =20 all: build =20 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 + --=20 2.11.0 From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 152518487929813.2067102051941; Tue, 1 May 2018 07:27:59 -0700 (PDT) Received: from localhost ([::1]:42782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWFt-00005M-J6 for importer@patchew.org; Tue, 01 May 2018 10:27:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBC-0004v3-LL for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWBA-00036E-P2 for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:54 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:51946) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWBA-00035C-Et for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=a/A1Zy/rC8hCeXwuRJFwGaRPiLGAvtyGT+yky55NjkM=; b=F1BK2IVO6XQ8jQhbl8G5fgLQI GMmvhqraA8Lme+1G8ITv+IfUnbfMst96p4ON8ptbmbb5+ca1wsxZAojz4ElQZLQEkMwYtMBZIo0im zh5WdEkFoZ/b4HdXo3+gaKDOG+6lXzDhM6DPIsQmdDuMX3Bo04UbQ8liCZk1yAcIeT7GM=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:16 +0200 Message-Id: <20180501142222.19154-7-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141516, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.4.9.5491000 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 06/12] tests/tcg/tricore: Add dvstep test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile | 1 + tests/tcg/tricore/macros.h | 29 ++++++++++++++++++++++++++++- tests/tcg/tricore/test_dvstep.S | 15 +++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/tricore/test_dvstep.S diff --git a/tests/tcg/tricore/Makefile b/tests/tcg/tricore/Makefile index 16ec5460d7..36f15a7544 100644 --- a/tests/tcg/tricore/Makefile +++ b/tests/tcg/tricore/Makefile @@ -11,6 +11,7 @@ SIMFLAGS =3D -M tricore_testboard -nographic -kernel TESTCASES +=3D test_abs.tst TESTCASES +=3D test_bmerge.tst TESTCASES +=3D test_clz.tst +TESTCASES +=3D test_dvstep.tst =20 all: build =20 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 @@ =20 #define DREG_DEV_ADDR %a15 =20 +#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 \ =20 +#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; \ ) =20 - +#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; \ + ) =20 /* Pass/Fail handling part */ #define TEST_PASSFAIL \ diff --git a/tests/tcg/tricore/test_dvstep.S b/tests/tcg/tricore/test_dvste= p.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 + --=20 2.11.0 From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525185067808310.5978806290476; Tue, 1 May 2018 07:31:07 -0700 (PDT) Received: from localhost ([::1]:42811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWJ9-0003HV-59 for importer@patchew.org; Tue, 01 May 2018 10:31:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBC-0004ux-LD for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWBA-00036Y-V3 for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:54 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:51958) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWBA-00035W-O2 for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vebGJtzceuISZP51R7nQCTuiX7dWJ6nIwUqAqJju5QI=; b=A1YPd8mQyfS0XuEfozOY6yU+V lsrj9tG/FBmXqMmD67AUBhZ4+6sxflzxokrzC7zzEbT6tw5E44eN7uaBhNevqLmIw5+bqRxTwzHTJ knqgNF7VoMpJKgYxhwR46vHVv5joC7wVnOBfSAbiCLAzPRHsQ4WozT8DnFTRo+e4+nkTM=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:17 +0200 Message-Id: <20180501142222.19154-8-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141817, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.3.29.5491001 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 07/12] tests/tcg/tricore: Add fadd test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile | 1 + tests/tcg/tricore/test_fadd.S | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/tcg/tricore/test_fadd.S diff --git a/tests/tcg/tricore/Makefile b/tests/tcg/tricore/Makefile index 36f15a7544..ba0514bfa3 100644 --- a/tests/tcg/tricore/Makefile +++ b/tests/tcg/tricore/Makefile @@ -12,6 +12,7 @@ TESTCASES +=3D test_abs.tst TESTCASES +=3D test_bmerge.tst TESTCASES +=3D test_clz.tst TESTCASES +=3D test_dvstep.tst +TESTCASES +=3D test_fadd.tst =20 all: build =20 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 + --=20 2.11.0 From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15251847392401.2736355359828622; Tue, 1 May 2018 07:25:39 -0700 (PDT) Received: from localhost ([::1]:42766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWDq-0006gF-FS for importer@patchew.org; Tue, 01 May 2018 10:25:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBC-0004v4-LK for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWBB-00036o-7u for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:54 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:51966) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWBB-00035n-0A for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VWP3o5L7bKBf1bw5KQ0nKThZ7/fHcEnTnFf7VJTIYxo=; b=kk+YCL5OxbqGQ3lMkG1tOaUzL SfPJpfI3GImHdloGN9T5hwlsd/OyOj7sWFSox1nZjXbcm802xMKGlLv6VRBFPEA8JqE4qfMaBucxG TjRIltXAWvBJMf4pq8kV5nuCdZOVrwzFmMz+SFSpUnBQJXoUU879G/gWHJSvETcT1zc0g=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:18 +0200 Message-Id: <20180501142222.19154-9-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141817, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.3.29.5491001 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 08/12] tests/tcg/tricore: Add fmul test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile | 1 + tests/tcg/tricore/test_fmul.S | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 tests/tcg/tricore/test_fmul.S diff --git a/tests/tcg/tricore/Makefile b/tests/tcg/tricore/Makefile index ba0514bfa3..5e2a450892 100644 --- a/tests/tcg/tricore/Makefile +++ b/tests/tcg/tricore/Makefile @@ -13,6 +13,7 @@ TESTCASES +=3D test_bmerge.tst TESTCASES +=3D test_clz.tst TESTCASES +=3D test_dvstep.tst TESTCASES +=3D test_fadd.tst +TESTCASES +=3D test_fmul.tst =20 all: build =20 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 + --=20 2.11.0 From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152518490870945.2556107696912; Tue, 1 May 2018 07:28:28 -0700 (PDT) Received: from localhost ([::1]:42784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWGZ-0000hr-Vu for importer@patchew.org; Tue, 01 May 2018 10:28:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBD-0004v6-3T for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWBB-00036z-HC for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:54 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:51978) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWBB-000365-AO for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3qohVcVuklzZ2iKTyWlAiYitb2h6CK4PY4cX+8jC2C8=; b=shatfWFckXyqDi5tbX4pt3rY5 C+zAryD9vu4MQmT70gtQQinnA2v4Ao6vPChwVaMmOet5ziR1JkoY+jS0W99ArzqeQUiCeX5N0PBQJ w+rK9g2b5Lr2SmMNX9/k2lR7f2L2HSxZj7FGdfRwO7Mz5PdtefbQllIrjFlWgohdyOnBQ=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:19 +0200 Message-Id: <20180501142222.19154-10-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141516, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.5.1.5491001 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 09/12] tests/tcg/tricore: Add ftoi test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile | 1 + tests/tcg/tricore/macros.h | 7 +++++++ tests/tcg/tricore/test_ftoi.S | 10 ++++++++++ 3 files changed, 18 insertions(+) create mode 100644 tests/tcg/tricore/test_ftoi.S diff --git a/tests/tcg/tricore/Makefile b/tests/tcg/tricore/Makefile index 5e2a450892..c3c7c59065 100644 --- a/tests/tcg/tricore/Makefile +++ b/tests/tcg/tricore/Makefile @@ -14,6 +14,7 @@ TESTCASES +=3D test_clz.tst TESTCASES +=3D test_dvstep.tst TESTCASES +=3D test_fadd.tst TESTCASES +=3D test_fmul.tst +TESTCASES +=3D test_ftoi.tst =20 all: build =20 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; \ ) =20 +#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 + --=20 2.11.0 From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525185023208759.0126434804981; Tue, 1 May 2018 07:30:23 -0700 (PDT) Received: from localhost ([::1]:42804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWIQ-0002ip-E3 for importer@patchew.org; Tue, 01 May 2018 10:30:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBD-0004vS-FD for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWBB-00037T-VO for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:55 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:51996) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWBB-00036V-MK for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ucF0r9sLyXbRuCr6DtIQ0JBiF9yuiR2TPHd60ino1CA=; b=T5bgqRfpRzJat3xaiz9wt37ZI o3Ev73nSmrw7gcY10wHEUJbq792nvQKQFC9xGltpne32tiQDKfZEBFiI5X6F3WgiNxeYXp4xoPm8n /Va43vyLKpne4E+51N7m3ULSWnKAmB20+DkuFCCDkKL+Ymyq7HNMG+psJFVGLw0nlqk7I=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:20 +0200 Message-Id: <20180501142222.19154-11-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141817, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.3.29.5491001 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 10/12] tests/tcg/tricore: Add madd test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile | 1 + tests/tcg/tricore/macros.h | 18 ++++++++++++++++++ tests/tcg/tricore/test_madd.S | 11 +++++++++++ 3 files changed, 30 insertions(+) create mode 100644 tests/tcg/tricore/test_madd.S diff --git a/tests/tcg/tricore/Makefile b/tests/tcg/tricore/Makefile index c3c7c59065..2d32ec3077 100644 --- a/tests/tcg/tricore/Makefile +++ b/tests/tcg/tricore/Makefile @@ -15,6 +15,7 @@ TESTCASES +=3D test_dvstep.tst TESTCASES +=3D test_fadd.tst TESTCASES +=3D test_fmul.tst TESTCASES +=3D test_ftoi.tst +TESTCASES +=3D test_madd.tst =20 all: build =20 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; \ ) =20 +#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, 0x7ffff= fff,2) + TEST_D_DDI_PSW(madd, 2, 0xffff7fff, 0x60000b80, 0xffff8001, 0x7ffff= fff,2) + TEST_D_DDD_PSW(madds.u, 3, 0xffffffff, 0x60000b80, 0x00000000, 0x80000= 000, \ + 0x80000000) + + TEST_PASSFAIL + --=20 2.11.0 From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525184936817949.9483531173522; Tue, 1 May 2018 07:28:56 -0700 (PDT) Received: from localhost ([::1]:42785 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWH2-00015O-31 for importer@patchew.org; Tue, 01 May 2018 10:28:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBE-0004vq-0o for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWBC-00037m-4P for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:55 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:52006) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWBB-00036g-TP for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=b58enV4I/gtRT6XG0nxGEuRCxnB16PK2TIt75uwK214=; b=XcZtA8n9XPFL521Ca4wJuhzex dn1g6hkF0ej70d+LnQgyOWvIIIA3tWQK0YTuErnxbpr5e4IYQPMkHyyFX1w5NhGmpqAb0uxln4PfS LWzsgSQTqIMTn+1eboL8dq7MrqXEtN0jgqPpLvzjrSgLm09CkepYWqcsvMnLAxIORlBYo=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:21 +0200 Message-Id: <20180501142222.19154-12-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141817, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.3.29.5491001 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 11/12] tests/tcg/tricore: Add msub test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile | 1 + tests/tcg/tricore/test_msub.S | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 tests/tcg/tricore/test_msub.S diff --git a/tests/tcg/tricore/Makefile b/tests/tcg/tricore/Makefile index 2d32ec3077..e3113b726c 100644 --- a/tests/tcg/tricore/Makefile +++ b/tests/tcg/tricore/Makefile @@ -16,6 +16,7 @@ TESTCASES +=3D test_fadd.tst TESTCASES +=3D test_fmul.tst TESTCASES +=3D test_ftoi.tst TESTCASES +=3D test_madd.tst +TESTCASES +=3D test_msub.tst =20 all: build =20 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, 0xffffffd= b) + TEST_PASSFAIL + --=20 2.11.0 From nobody Wed Oct 29 17:27:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525185194779356.4071831129746; Tue, 1 May 2018 07:33:14 -0700 (PDT) Received: from localhost ([::1]:42827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWL1-0004c9-Vk for importer@patchew.org; Tue, 01 May 2018 10:33:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDWBE-0004vu-2u for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDWBC-00038O-Ls for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:56 -0400 Received: from mail.uni-paderborn.de ([131.234.142.9]:52010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fDWBC-000373-9u for qemu-devel@nongnu.org; Tue, 01 May 2018 10:22:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nBxcA7gEtDTEfBiVBAMbGRKI+WQhm/S2FqpW9gGRHus=; b=JH6rqmnzAMA5TgKKLLPA/mH+2 ULZO76JbEGHWF5arZFppr2vqTHUptPXykW8TZLbGySu22ELLZCq8SRGOsNYFkKjx+nBaWcCXDi5A3 rV/gK/Uvi5Rq4+gzFGjIIbE0akMCPQkILRP4WWHndjRR6f26tR9Gb+grZKBtgVpG+4Id8=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 1 May 2018 16:22:22 +0200 Message-Id: <20180501142222.19154-13-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> References: <20180501142222.19154-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.1.141516, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.5.1.5491001 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [RFC PATCH 12/12] tests/tcg/tricore: Add muls test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann --- tests/tcg/tricore/Makefile | 1 + tests/tcg/tricore/test_muls.S | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 tests/tcg/tricore/test_muls.S diff --git a/tests/tcg/tricore/Makefile b/tests/tcg/tricore/Makefile index e3113b726c..37c3101e4d 100644 --- a/tests/tcg/tricore/Makefile +++ b/tests/tcg/tricore/Makefile @@ -17,6 +17,7 @@ TESTCASES +=3D test_fmul.tst TESTCASES +=3D test_ftoi.tst TESTCASES +=3D test_madd.tst TESTCASES +=3D test_msub.tst +TESTCASES +=3D test_muls.tst =20 all: build =20 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, 0xfffffff= f) + TEST_D_DD_PSW(muls.u, 2, 0xffffffff, 0x60000b80, 0xfffffffe, 0xfffffff= f) + + TEST_PASSFAIL + --=20 2.11.0