From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807503327702.9624560874809; Wed, 27 Sep 2023 02:38:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyE-0000tk-0W; Wed, 27 Sep 2023 05:36:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQxx-0000lY-5r for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:23 -0400 Received: from hoth.uni-paderborn.de ([2001:638:502:c003::19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQxn-0000fu-DZ for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=b5I1dbiEujj3bnPrvclDUc5hYSsrMePBI6m5GKX/TCs=; b=HjxgyQ7xEx38DE2WY83/WTrjtC d4JD8qPFWzB8vjh/oMHtIV6Yt2vOeIaF7ajXyQKXy9cn/C4A4btuAsvEMyIZhOFR2MIUvsOhT0zpM CcibFtgW2cgzrFmPMtlHAyP+zkbgJTxbDgEgYCDjAlx7Cci7vsXH7myEJYEQJ3EZiOag=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL 01/21] tests/tcg/tricore: Bump cpu to tc37x Date: Wed, 27 Sep 2023 11:35:32 +0200 Message-ID: <20230927093552.493279-2-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.27.602000 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::19; envelope-from=kbastian@mail.uni-paderborn.de; helo=hoth.uni-paderborn.de X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807505422100001 Content-Type: text/plain; charset="utf-8" we don't want to exclude ISA v1.6.2 insns from our tests. Acked-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-Id: <20230828112651.522058-2-kbastian@mail.uni-paderborn.de> --- tests/tcg/tricore/Makefile.softmmu-target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/= Makefile.softmmu-target index 2ec0bd3622..d556201b07 100644 --- a/tests/tcg/tricore/Makefile.softmmu-target +++ b/tests/tcg/tricore/Makefile.softmmu-target @@ -25,7 +25,7 @@ TESTS +=3D test_muls.asm.tst TESTS +=3D test_boot_to_main.c.tst TESTS +=3D test_context_save_areas.c.tst =20 -QEMU_OPTS +=3D -M tricore_testboard -cpu tc27x -nographic -kernel +QEMU_OPTS +=3D -M tricore_testboard -cpu tc37x -nographic -kernel =20 %.pS: $(ASM_TESTS_PATH)/%.S $(CC) -E -o $@ $< --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807569290250.99183934077018; Wed, 27 Sep 2023 02:39:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyH-0000uH-4F; Wed, 27 Sep 2023 05:36:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQxx-0000lV-5U for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:24 -0400 Received: from doohan.uni-paderborn.de ([2001:638:502:c003::16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQxp-0000gB-7i for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=5I3hxpXIo/Aj9WtZLitXsFXjv/wDHOVI3zcJt8ymVSQ=; b=Au5mWVQ5nsF0+u6gpLrXKxx9fc peC430uUGJrTEa79lF+6Wz2l5Xf4pk2DNfrqoGpQhzftdjmPMSIQ/c+fa96SFzysbmKzfBwxJIlG+ ld42hN0xDuG7knvvtEWo4o5jM8wzumD5QR9PmbLNSj7rfSMz+rwT46WI4EQ2WXcPodVw=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL 02/21] target/tricore: Implement CRCN insn Date: Wed, 27 Sep 2023 11:35:33 +0200 Message-ID: <20230927093552.493279-3-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.26.602000 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::16; envelope-from=kbastian@mail.uni-paderborn.de; helo=doohan.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807571306100001 Content-Type: text/plain; charset="utf-8" reported in https://gitlab.com/qemu-project/qemu/-/issues/1667 Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-3-kbastian@mail.uni-paderborn.de> --- target/tricore/helper.h | 1 + target/tricore/op_helper.c | 63 +++++++++++++++++++++++ target/tricore/translate.c | 8 +++ target/tricore/tricore-opcodes.h | 1 + tests/tcg/tricore/Makefile.softmmu-target | 1 + tests/tcg/tricore/asm/test_crcn.S | 9 ++++ 6 files changed, 83 insertions(+) create mode 100644 tests/tcg/tricore/asm/test_crcn.S diff --git a/target/tricore/helper.h b/target/tricore/helper.h index 31d71eac7a..190645413a 100644 --- a/target/tricore/helper.h +++ b/target/tricore/helper.h @@ -134,6 +134,7 @@ DEF_HELPER_FLAGS_5(mulr_h, TCG_CALL_NO_RWG_SE, i32, i32= , i32, i32, i32, i32) DEF_HELPER_FLAGS_2(crc32b, TCG_CALL_NO_RWG_SE, i32, i32, i32) DEF_HELPER_FLAGS_2(crc32_be, TCG_CALL_NO_RWG_SE, i32, i32, i32) DEF_HELPER_FLAGS_2(crc32_le, TCG_CALL_NO_RWG_SE, i32, i32, i32) +DEF_HELPER_FLAGS_3(crcn, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32) DEF_HELPER_FLAGS_2(shuffle, TCG_CALL_NO_RWG_SE, i32, i32, i32) /* CSA */ DEF_HELPER_2(call, void, env, i32) diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c index 89be1ed648..0cf8eb50bd 100644 --- a/target/tricore/op_helper.c +++ b/target/tricore/op_helper.c @@ -2308,6 +2308,69 @@ uint32_t helper_crc32_le(uint32_t arg0, uint32_t arg= 1) return crc32(arg1, buf, 4); } =20 +static uint32_t crc_div(uint32_t crc_in, uint32_t data, uint32_t gen, + uint32_t n, uint32_t m) +{ + uint32_t i; + + data =3D data << n; + for (i =3D 0; i < m; i++) { + if (crc_in & (1u << (n - 1))) { + crc_in <<=3D 1; + if (data & (1u << (m - 1))) { + crc_in++; + } + crc_in ^=3D gen; + } else { + crc_in <<=3D 1; + if (data & (1u << (m - 1))) { + crc_in++; + } + } + data <<=3D 1; + } + + return crc_in; +} + +uint32_t helper_crcn(uint32_t arg0, uint32_t arg1, uint32_t arg2) +{ + uint32_t crc_out, crc_in; + uint32_t n =3D extract32(arg0, 12, 4) + 1; + uint32_t gen =3D extract32(arg0, 16, n); + uint32_t inv =3D extract32(arg0, 9, 1); + uint32_t le =3D extract32(arg0, 8, 1); + uint32_t m =3D extract32(arg0, 0, 3) + 1; + uint32_t data =3D extract32(arg1, 0, m); + uint32_t seed =3D extract32(arg2, 0, n); + + if (le =3D=3D 1) { + if (m =3D=3D 0) { + data =3D 0; + } else { + data =3D revbit32(data) >> (32 - m); + } + } + + if (inv =3D=3D 1) { + seed =3D ~seed; + } + + if (m > n) { + crc_in =3D (data >> (m - n)) ^ seed; + } else { + crc_in =3D (data << (n - m)) ^ seed; + } + + crc_out =3D crc_div(crc_in, data, gen, n, m); + + if (inv) { + crc_out =3D ~crc_out; + } + + return extract32(crc_out, 0, n); +} + uint32_t helper_shuffle(uint32_t arg0, uint32_t arg1) { uint32_t resb; diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 6ae5ccbf72..4e7e18f985 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -6669,6 +6669,14 @@ static void decode_rrr_divide(DisasContext *ctx) gen_helper_pack(cpu_gpr_d[r4], cpu_PSW_C, cpu_gpr_d[r3], cpu_gpr_d[r3+1], cpu_gpr_d[r1]); break; + case OPC2_32_RRR_CRCN: + if (has_feature(ctx, TRICORE_FEATURE_162)) { + gen_helper_crcn(cpu_gpr_d[r4], cpu_gpr_d[r1], cpu_gpr_d[r2], + cpu_gpr_d[r3]); + } else { + generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC); + } + break; case OPC2_32_RRR_ADD_F: gen_helper_fadd(cpu_gpr_d[r4], cpu_env, cpu_gpr_d[r1], cpu_gpr_d[r= 3]); break; diff --git a/target/tricore/tricore-opcodes.h b/target/tricore/tricore-opco= des.h index bc62b73173..f070571665 100644 --- a/target/tricore/tricore-opcodes.h +++ b/target/tricore/tricore-opcodes.h @@ -1247,6 +1247,7 @@ enum { OPC2_32_RRR_SUB_F =3D 0x03, OPC2_32_RRR_MADD_F =3D 0x06, OPC2_32_RRR_MSUB_F =3D 0x07, + OPC2_32_RRR_CRCN =3D 0x01, /* 1.6.2 up */ }; /* * RRR1 Format diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/= Makefile.softmmu-target index d556201b07..b8d9b33933 100644 --- a/tests/tcg/tricore/Makefile.softmmu-target +++ b/tests/tcg/tricore/Makefile.softmmu-target @@ -9,6 +9,7 @@ CFLAGS =3D -mtc162 -c -I$(TESTS_PATH) TESTS +=3D test_abs.asm.tst TESTS +=3D test_bmerge.asm.tst TESTS +=3D test_clz.asm.tst +TESTS +=3D test_crcn.asm.tst TESTS +=3D test_dextr.asm.tst TESTS +=3D test_dvstep.asm.tst TESTS +=3D test_fadd.asm.tst diff --git a/tests/tcg/tricore/asm/test_crcn.S b/tests/tcg/tricore/asm/test= _crcn.S new file mode 100644 index 0000000000..51a22722a3 --- /dev/null +++ b/tests/tcg/tricore/asm/test_crcn.S @@ -0,0 +1,9 @@ +#include "macros.h" +.text +.global _start +_start: +# insn num result rs1 rs2 rs3 +# | | | | | | + TEST_D_DDD(crcn, 1, 0x00002bed, 0x0, 0xa10ddeed, 0x0) + + TEST_PASSFAIL --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807475291113.9813065385257; Wed, 27 Sep 2023 02:37:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyD-0000t4-IG; Wed, 27 Sep 2023 05:36:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQxx-0000lW-5E for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:23 -0400 Received: from nylar.uni-paderborn.de ([2001:638:502:c003::18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQxp-0000gl-7t for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=0ZVKuipTJZZwnR/JF/GcM77eIVDauUJCXY9qIu7SUNg=; b=bC01ekzP3KytSGniIJ1jg4+XIA WZLLvL0pEF/wax83Zxd0phMEanQZE2N1tn2yQ8S9LJE0PBWOteHDyACJ7cjtlEf00InSILv/nAakU tt5iCCl+e7arcMC5RCbf3GdD/YJpD9++IlNfNg27KK0A2fM0NiaZHXNAxqKFAecG0lNk=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL 03/21] target/tricore: Correctly handle FPU RM from PSW Date: Wed, 27 Sep 2023 11:35:34 +0200 Message-ID: <20230927093552.493279-4-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: add header X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.93017, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.27.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=5, da=183416434, mc=2, sc=0, hc=2, sp=0, fso=5, re=0, sd=0, hd=0 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::18; envelope-from=kbastian@mail.uni-paderborn.de; helo=nylar.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807476904100003 Content-Type: text/plain; charset="utf-8" when we reconstructed PSW using psw_read(), we were trying to clear the cached USB bits out of env->PSW. The mask was wrong and we would clear PSW.RM as well. when we write the PSW using psw_write() we update the rounding modes in env->fp_status for softfloat. The order of bits used by TriCore is not the one used by softfloat. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-4-kbastian@mail.uni-paderborn.de> --- target/tricore/helper.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/target/tricore/helper.c b/target/tricore/helper.c index 6d076ac36f..e615c3d6d4 100644 --- a/target/tricore/helper.c +++ b/target/tricore/helper.c @@ -120,7 +120,21 @@ void tricore_cpu_list(void) =20 void fpu_set_state(CPUTriCoreState *env) { - set_float_rounding_mode(env->PSW & MASK_PSW_FPU_RM, &env->fp_status); + switch (extract32(env->PSW, 24, 2)) { + case 0: + set_float_rounding_mode(float_round_nearest_even, &env->fp_status); + break; + case 1: + set_float_rounding_mode(float_round_up, &env->fp_status); + break; + case 2: + set_float_rounding_mode(float_round_down, &env->fp_status); + break; + case 3: + set_float_rounding_mode(float_round_to_zero, &env->fp_status); + break; + } + set_flush_inputs_to_zero(1, &env->fp_status); set_flush_to_zero(1, &env->fp_status); set_default_nan_mode(1, &env->fp_status); @@ -129,7 +143,7 @@ void fpu_set_state(CPUTriCoreState *env) uint32_t psw_read(CPUTriCoreState *env) { /* clear all USB bits */ - env->PSW &=3D 0x6ffffff; + env->PSW &=3D 0x7ffffff; /* now set them from the cache */ env->PSW |=3D ((env->PSW_USB_C !=3D 0) << 31); env->PSW |=3D ((env->PSW_USB_V & (1 << 31)) >> 1); --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807544747668.4338975585376; Wed, 27 Sep 2023 02:39:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQy7-0000qS-D6; Wed, 27 Sep 2023 05:36:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQxx-0000lX-5F for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:23 -0400 Received: from doohan.uni-paderborn.de ([2001:638:502:c003::16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQxr-0000gw-3K for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=ztyiR4O7yUKNMu62qAC5I6VE6EL6Xn2CyTtUB4FAoRc=; b=D/nMtdhcu5JwOLFxUW3GIB+pqJ FkNL1gucIZtAtyqcJ5CPRRTX6d8bh7IPX8UBuunRT/Q1CxLvvqt01BJCR2AxxJCRFCFXnAudAUVZI Hj1vETSqR1Mc1FRbxYphB6d3yAI7/6/YMHFxwvTkQD5ROSgaZSpthgpUvhLZ3QE7czT0=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL 04/21] target/tricore: Implement FTOU insn Date: Wed, 27 Sep 2023 11:35:35 +0200 Message-ID: <20230927093552.493279-5-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: add header X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.26.602000 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::16; envelope-from=kbastian@mail.uni-paderborn.de; helo=doohan.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807546564100004 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-5-kbastian@mail.uni-paderborn.de> --- target/tricore/fpu_helper.c | 32 +++++++++++++++++++++++ target/tricore/helper.h | 1 + target/tricore/translate.c | 3 +++ tests/tcg/tricore/Makefile.softmmu-target | 1 + tests/tcg/tricore/asm/test_ftou.S | 12 +++++++++ 5 files changed, 49 insertions(+) create mode 100644 tests/tcg/tricore/asm/test_ftou.S diff --git a/target/tricore/fpu_helper.c b/target/tricore/fpu_helper.c index cb7ee7dd35..3aefeb776e 100644 --- a/target/tricore/fpu_helper.c +++ b/target/tricore/fpu_helper.c @@ -429,6 +429,38 @@ uint32_t helper_ftoiz(CPUTriCoreState *env, uint32_t a= rg) return result; } =20 +uint32_t helper_ftou(CPUTriCoreState *env, uint32_t arg) +{ + float32 f_arg =3D make_float32(arg); + uint32_t result; + int32_t flags =3D 0; + + result =3D float32_to_uint32(f_arg, &env->fp_status); + + flags =3D f_get_excp_flags(env); + if (flags & float_flag_invalid) { + flags &=3D ~float_flag_inexact; + if (float32_is_any_nan(f_arg)) { + result =3D 0; + } + /* + * we need to check arg < 0.0 before rounding as TriCore needs to raise + * float_flag_invalid as well. For instance, when we have a negative + * exponent and sign, softfloat would only raise float_flat_inexact. + */ + } else if (float32_lt_quiet(f_arg, 0, &env->fp_status)) { + flags =3D float_flag_invalid; + result =3D 0; + } + + if (flags) { + f_update_psw_flags(env, flags); + } else { + env->FPU_FS =3D 0; + } + return result; +} + uint32_t helper_ftouz(CPUTriCoreState *env, uint32_t arg) { float32 f_arg =3D make_float32(arg); diff --git a/target/tricore/helper.h b/target/tricore/helper.h index 190645413a..827fbaa692 100644 --- a/target/tricore/helper.h +++ b/target/tricore/helper.h @@ -114,6 +114,7 @@ DEF_HELPER_2(ftoi, i32, env, i32) DEF_HELPER_2(itof, i32, env, i32) DEF_HELPER_2(utof, i32, env, i32) DEF_HELPER_2(ftoiz, i32, env, i32) +DEF_HELPER_2(ftou, i32, env, i32) DEF_HELPER_2(ftouz, i32, env, i32) DEF_HELPER_2(updfl, void, env, i32) /* dvinit */ diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 4e7e18f985..382ecf4775 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -6269,6 +6269,9 @@ static void decode_rr_divide(DisasContext *ctx) case OPC2_32_RR_ITOF: gen_helper_itof(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); break; + case OPC2_32_RR_FTOU: + gen_helper_ftou(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); + break; case OPC2_32_RR_FTOUZ: gen_helper_ftouz(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); break; diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/= Makefile.softmmu-target index b8d9b33933..91ae129a83 100644 --- a/tests/tcg/tricore/Makefile.softmmu-target +++ b/tests/tcg/tricore/Makefile.softmmu-target @@ -15,6 +15,7 @@ TESTS +=3D test_dvstep.asm.tst TESTS +=3D test_fadd.asm.tst TESTS +=3D test_fmul.asm.tst TESTS +=3D test_ftoi.asm.tst +TESTS +=3D test_ftou.asm.tst TESTS +=3D test_imask.asm.tst TESTS +=3D test_insert.asm.tst TESTS +=3D test_ld_bu.asm.tst diff --git a/tests/tcg/tricore/asm/test_ftou.S b/tests/tcg/tricore/asm/test= _ftou.S new file mode 100644 index 0000000000..10f106ad62 --- /dev/null +++ b/tests/tcg/tricore/asm/test_ftou.S @@ -0,0 +1,12 @@ +#include "macros.h" +.text +.global _start +_start: + TEST_D_D(ftou, 1, 0x00000000, 0x1733f6c2) + TEST_D_D(ftou, 2, 0x00000000, 0x2c9d9cdc) + TEST_D_D(ftou, 3, 0xffffffff, 0x56eb7395) + TEST_D_D(ftou, 4, 0x79900800, 0x4ef32010) + TEST_D_D(ftou, 5, 0x0353f510, 0x4c54fd44) + + TEST_PASSFAIL + --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 16958074470531017.4159425760232; Wed, 27 Sep 2023 02:37:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyB-0000sI-K3; Wed, 27 Sep 2023 05:36:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy0-0000lo-27 for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:25 -0400 Received: from collins.uni-paderborn.de ([2001:638:502:c003::14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQxt-0000h8-Ny for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=XlhIZu2wG5GEm8bOpyij8zG6k/JHGKk+P3CD/Q1HBjc=; b=sajlN6OAz81uasqxk/zT6x5HlS Ik8zxHP4pAxvC0vKlIhz+LKhhgRYd/DlXku8nj4cdLp/2/nji5bjw4uiREzLX3NHz1l3bObdMu0cL JRD7L7xEOUwZSGi/qYZfI1HF8SH7l6+42nWZpOs2MjPvKzzx/N/UkTu3lIuDT/qK1mp0=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL 05/21] target/tricore: Clarify special case for FTOUZ insn Date: Wed, 27 Sep 2023 11:35:36 +0200 Message-ID: <20230927093552.493279-6-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.27.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=9, da=183416438, mc=4, sc=0, hc=4, sp=0, fso=9, re=0, sd=0, hd=0 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::14; envelope-from=kbastian@mail.uni-paderborn.de; helo=collins.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807451190100004 Content-Type: text/plain; charset="utf-8" this is not something other ISAs do, so clarify it with a comment. Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-6-kbastian@mail.uni-paderborn.de> --- target/tricore/fpu_helper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/tricore/fpu_helper.c b/target/tricore/fpu_helper.c index 3aefeb776e..d0c474c5f3 100644 --- a/target/tricore/fpu_helper.c +++ b/target/tricore/fpu_helper.c @@ -475,6 +475,11 @@ uint32_t helper_ftouz(CPUTriCoreState *env, uint32_t a= rg) if (float32_is_any_nan(f_arg)) { result =3D 0; } + /* + * we need to check arg < 0.0 before rounding as TriCore needs to raise + * float_flag_invalid as well. For instance, when we have a negative + * exponent and sign, softfloat would only raise float_flat_inexact. + */ } else if (float32_lt_quiet(f_arg, 0, &env->fp_status)) { flags =3D float_flag_invalid; result =3D 0; --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807478443151.02264638839847; Wed, 27 Sep 2023 02:37:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyJ-0000vY-3U; Wed, 27 Sep 2023 05:36:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy1-0000mL-Im for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:25 -0400 Received: from doohan.uni-paderborn.de ([2001:638:502:c003::16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQxw-0000hO-Tj for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=lk+bO9MVpIZNBBvU6IHOGrEJ52+lL/4qTPNX6trxxgg=; b=jl51Xi44azBspstTqejZ3PUQGE gxkRZLBO5kSdyyHynZE7XqzCnlsaAPVzmNnZRiN1RxJ2J+pxHtrpgLxB7PpqJmkijbEbzpps/QyXP nhNPTO3NEHL6UFwpiGWtxltpBk1JerWQnySKR6++wcoxlAgiPQ/a4f/Wo7bN/RKWMwAs=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL 06/21] target/tricore: Implement ftohp insn Date: Wed, 27 Sep 2023 11:35:37 +0200 Message-ID: <20230927093552.493279-7-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: add header X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.26.602000 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::16; envelope-from=kbastian@mail.uni-paderborn.de; helo=doohan.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807480745100003 Content-Type: text/plain; charset="utf-8" reported in https://gitlab.com/qemu-project/qemu/-/issues/1667 Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-7-kbastian@mail.uni-paderborn.de> --- target/tricore/fpu_helper.c | 38 +++++++++++++++++++++++ target/tricore/helper.c | 1 + target/tricore/helper.h | 1 + target/tricore/translate.c | 7 +++++ target/tricore/tricore-opcodes.h | 1 + tests/tcg/tricore/Makefile.softmmu-target | 1 + tests/tcg/tricore/asm/test_ftohp.S | 14 +++++++++ 7 files changed, 63 insertions(+) create mode 100644 tests/tcg/tricore/asm/test_ftohp.S diff --git a/target/tricore/fpu_helper.c b/target/tricore/fpu_helper.c index d0c474c5f3..848c4a40a0 100644 --- a/target/tricore/fpu_helper.c +++ b/target/tricore/fpu_helper.c @@ -373,6 +373,44 @@ uint32_t helper_ftoi(CPUTriCoreState *env, uint32_t ar= g) return (uint32_t)result; } =20 +uint32_t helper_ftohp(CPUTriCoreState *env, uint32_t arg) +{ + float32 f_arg =3D make_float32(arg); + uint32_t result =3D 0; + int32_t flags =3D 0; + + /* + * if we have any NAN we need to move the top 2 and lower 8 input mant= issa + * bits to the top 2 and lower 8 output mantissa bits respectively. + * Softfloat on the other hand uses the top 10 mantissa bits. + */ + if (float32_is_any_nan(f_arg)) { + if (float32_is_signaling_nan(f_arg, &env->fp_status)) { + flags |=3D float_flag_invalid; + } + result =3D float16_set_sign(result, arg >> 31); + result =3D deposit32(result, 10, 5, 0x1f); + result =3D deposit32(result, 8, 2, extract32(arg, 21, 2)); + result =3D deposit32(result, 0, 8, extract32(arg, 0, 8)); + if (extract32(result, 0, 10) =3D=3D 0) { + result |=3D (1 << 8); + } + } else { + set_flush_to_zero(0, &env->fp_status); + result =3D float32_to_float16(f_arg, true, &env->fp_status); + set_flush_to_zero(1, &env->fp_status); + flags =3D f_get_excp_flags(env); + } + + if (flags) { + f_update_psw_flags(env, flags); + } else { + env->FPU_FS =3D 0; + } + + return result; +} + uint32_t helper_itof(CPUTriCoreState *env, uint32_t arg) { float32 f_result; diff --git a/target/tricore/helper.c b/target/tricore/helper.c index e615c3d6d4..7e5da3cb23 100644 --- a/target/tricore/helper.c +++ b/target/tricore/helper.c @@ -137,6 +137,7 @@ void fpu_set_state(CPUTriCoreState *env) =20 set_flush_inputs_to_zero(1, &env->fp_status); set_flush_to_zero(1, &env->fp_status); + set_float_detect_tininess(float_tininess_before_rounding, &env->fp_sta= tus); set_default_nan_mode(1, &env->fp_status); } =20 diff --git a/target/tricore/helper.h b/target/tricore/helper.h index 827fbaa692..dcc5a492b3 100644 --- a/target/tricore/helper.h +++ b/target/tricore/helper.h @@ -111,6 +111,7 @@ DEF_HELPER_4(fmsub, i32, env, i32, i32, i32) DEF_HELPER_3(fcmp, i32, env, i32, i32) DEF_HELPER_2(qseed, i32, env, i32) DEF_HELPER_2(ftoi, i32, env, i32) +DEF_HELPER_2(ftohp, i32, env, i32) DEF_HELPER_2(itof, i32, env, i32) DEF_HELPER_2(utof, i32, env, i32) DEF_HELPER_2(ftoiz, i32, env, i32) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 382ecf4775..d76b6475f1 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -6260,6 +6260,13 @@ static void decode_rr_divide(DisasContext *ctx) case OPC2_32_RR_DIV_F: gen_helper_fdiv(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1], cpu_gpr_d[r= 2]); break; + case OPC2_32_RR_FTOHP: + if (has_feature(ctx, TRICORE_FEATURE_162)) { + gen_helper_ftohp(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); + } else { + generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC); + } + break; case OPC2_32_RR_CMP_F: gen_helper_fcmp(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1], cpu_gpr_d[r= 2]); break; diff --git a/target/tricore/tricore-opcodes.h b/target/tricore/tricore-opco= des.h index f070571665..29e655a667 100644 --- a/target/tricore/tricore-opcodes.h +++ b/target/tricore/tricore-opcodes.h @@ -1152,6 +1152,7 @@ enum { OPC2_32_RR_ITOF =3D 0x14, OPC2_32_RR_CMP_F =3D 0x00, OPC2_32_RR_FTOIZ =3D 0x13, + OPC2_32_RR_FTOHP =3D 0x25, /* 1.6.2 only */ OPC2_32_RR_FTOQ31 =3D 0x11, OPC2_32_RR_FTOQ31Z =3D 0x18, OPC2_32_RR_FTOU =3D 0x12, diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/= Makefile.softmmu-target index 91ae129a83..fc545d45ae 100644 --- a/tests/tcg/tricore/Makefile.softmmu-target +++ b/tests/tcg/tricore/Makefile.softmmu-target @@ -14,6 +14,7 @@ TESTS +=3D test_dextr.asm.tst TESTS +=3D test_dvstep.asm.tst TESTS +=3D test_fadd.asm.tst TESTS +=3D test_fmul.asm.tst +TESTS +=3D test_ftohp.asm.tst TESTS +=3D test_ftoi.asm.tst TESTS +=3D test_ftou.asm.tst TESTS +=3D test_imask.asm.tst diff --git a/tests/tcg/tricore/asm/test_ftohp.S b/tests/tcg/tricore/asm/tes= t_ftohp.S new file mode 100644 index 0000000000..9e23141c1e --- /dev/null +++ b/tests/tcg/tricore/asm/test_ftohp.S @@ -0,0 +1,14 @@ +#include "macros.h" +.text +.global _start +_start: + TEST_D_D(ftohp, 1, 0xffff, 0xffffffff) + TEST_D_D(ftohp, 2, 0xfc00, 0xff800000) + TEST_D_D(ftohp, 3, 0x7c00, 0x7f800000) + TEST_D_D(ftohp, 4, 0x0, 0x0) + TEST_D_D(ftohp, 5, 0x5, 0x34a43580) + + #TEST_D_D_PSW(ftohp, 6, 0x400, 0x8c000b80, 0x387fee74) + + TEST_PASSFAIL + --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807447868559.78708497865; Wed, 27 Sep 2023 02:37:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyF-0000uE-ED; Wed, 27 Sep 2023 05:36:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy2-0000mR-8l for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:27 -0400 Received: from nylar.uni-paderborn.de ([2001:638:502:c003::18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQxz-0000hf-RY for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=7ddeiyD+Rt2vokEnGfPawfSGkhNaO2A0xv/Yktxt3n4=; b=Y0Qf8lJIXmow2BLFy/HP9DlqQ7 63d/nEZI2Zn5sZJxJcM6mn+02KtROMZC9WqvqxBNagqch0zTYSQIsnuT/YrH0IdirvPgIcMIjI2MW +fTnFNw6xlswyw8xLhzNcC2vog+DxsqtXM7kmXxuZLDbrEIAo9O5aPKRUKdJddlEjhR0=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL 07/21] target/tricore: Implement hptof insn Date: Wed, 27 Sep 2023 11:35:38 +0200 Message-ID: <20230927093552.493279-8-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: add header X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.93017, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.27.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=14, da=183416443, mc=6, sc=0, hc=6, sp=0, fso=14, re=0, sd=0, hd=0 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::18; envelope-from=kbastian@mail.uni-paderborn.de; helo=nylar.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807451180100003 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1667 Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-8-kbastian@mail.uni-paderborn.de> --- target/tricore/fpu_helper.c | 36 +++++++++++++++++++++++ target/tricore/helper.h | 1 + target/tricore/translate.c | 7 +++++ target/tricore/tricore-opcodes.h | 1 + tests/tcg/tricore/Makefile.softmmu-target | 1 + tests/tcg/tricore/asm/test_hptof.S | 12 ++++++++ 6 files changed, 58 insertions(+) create mode 100644 tests/tcg/tricore/asm/test_hptof.S diff --git a/target/tricore/fpu_helper.c b/target/tricore/fpu_helper.c index 848c4a40a0..5d38aea143 100644 --- a/target/tricore/fpu_helper.c +++ b/target/tricore/fpu_helper.c @@ -373,6 +373,42 @@ uint32_t helper_ftoi(CPUTriCoreState *env, uint32_t ar= g) return (uint32_t)result; } =20 +uint32_t helper_hptof(CPUTriCoreState *env, uint32_t arg) +{ + float16 f_arg =3D make_float16(arg); + uint32_t result =3D 0; + int32_t flags =3D 0; + + /* + * if we have any NAN we need to move the top 2 and lower 8 input mant= issa + * bits to the top 2 and lower 8 output mantissa bits respectively. + * Softfloat on the other hand uses the top 10 mantissa bits. + */ + if (float16_is_any_nan(f_arg)) { + if (float16_is_signaling_nan(f_arg, &env->fp_status)) { + flags |=3D float_flag_invalid; + } + result =3D 0; + result =3D float32_set_sign(result, f_arg >> 15); + result =3D deposit32(result, 23, 8, 0xff); + result =3D deposit32(result, 21, 2, extract32(f_arg, 8, 2)); + result =3D deposit32(result, 0, 8, extract32(f_arg, 0, 8)); + } else { + set_flush_inputs_to_zero(0, &env->fp_status); + result =3D float16_to_float32(f_arg, true, &env->fp_status); + set_flush_inputs_to_zero(1, &env->fp_status); + flags =3D f_get_excp_flags(env); + } + + if (flags) { + f_update_psw_flags(env, flags); + } else { + env->FPU_FS =3D 0; + } + + return result; +} + uint32_t helper_ftohp(CPUTriCoreState *env, uint32_t arg) { float32 f_arg =3D make_float32(arg); diff --git a/target/tricore/helper.h b/target/tricore/helper.h index dcc5a492b3..1d97d078b0 100644 --- a/target/tricore/helper.h +++ b/target/tricore/helper.h @@ -112,6 +112,7 @@ DEF_HELPER_3(fcmp, i32, env, i32, i32) DEF_HELPER_2(qseed, i32, env, i32) DEF_HELPER_2(ftoi, i32, env, i32) DEF_HELPER_2(ftohp, i32, env, i32) +DEF_HELPER_2(hptof, i32, env, i32) DEF_HELPER_2(itof, i32, env, i32) DEF_HELPER_2(utof, i32, env, i32) DEF_HELPER_2(ftoiz, i32, env, i32) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index d76b6475f1..c9823ee32a 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -6267,6 +6267,13 @@ static void decode_rr_divide(DisasContext *ctx) generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC); } break; + case OPC2_32_RR_HPTOF: + if (has_feature(ctx, TRICORE_FEATURE_162)) { + gen_helper_hptof(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); + } else { + generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC); + } + break; case OPC2_32_RR_CMP_F: gen_helper_fcmp(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1], cpu_gpr_d[r= 2]); break; diff --git a/target/tricore/tricore-opcodes.h b/target/tricore/tricore-opco= des.h index 29e655a667..60d2402b6e 100644 --- a/target/tricore/tricore-opcodes.h +++ b/target/tricore/tricore-opcodes.h @@ -1153,6 +1153,7 @@ enum { OPC2_32_RR_CMP_F =3D 0x00, OPC2_32_RR_FTOIZ =3D 0x13, OPC2_32_RR_FTOHP =3D 0x25, /* 1.6.2 only */ + OPC2_32_RR_HPTOF =3D 0x24, /* 1.6.2 only */ OPC2_32_RR_FTOQ31 =3D 0x11, OPC2_32_RR_FTOQ31Z =3D 0x18, OPC2_32_RR_FTOU =3D 0x12, diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/= Makefile.softmmu-target index fc545d45ae..258aeb40ae 100644 --- a/tests/tcg/tricore/Makefile.softmmu-target +++ b/tests/tcg/tricore/Makefile.softmmu-target @@ -17,6 +17,7 @@ TESTS +=3D test_fmul.asm.tst TESTS +=3D test_ftohp.asm.tst TESTS +=3D test_ftoi.asm.tst TESTS +=3D test_ftou.asm.tst +TESTS +=3D test_hptof.asm.tst TESTS +=3D test_imask.asm.tst TESTS +=3D test_insert.asm.tst TESTS +=3D test_ld_bu.asm.tst diff --git a/tests/tcg/tricore/asm/test_hptof.S b/tests/tcg/tricore/asm/tes= t_hptof.S new file mode 100644 index 0000000000..8adc5e5273 --- /dev/null +++ b/tests/tcg/tricore/asm/test_hptof.S @@ -0,0 +1,12 @@ +#include "macros.h" +.text +.global _start +_start: + TEST_D_D(hptof, 1, 0xba190000, 0xcc0e90c8) + TEST_D_D(hptof, 2, 0x3eaea000, 0x8be23575) + TEST_D_D(hptof, 3, 0xc33b8000, 0xcc48d9dc) + TEST_D_D(hptof, 4, 0x43e2a000, 0xaef95f15) + TEST_D_D(hptof, 5, 0x3d55e000, 0x04932aaf) + + TEST_PASSFAIL + --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807545852757.2656657942916; Wed, 27 Sep 2023 02:39:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyH-0000uu-LE; Wed, 27 Sep 2023 05:36:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy2-0000mX-Uy for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:27 -0400 Received: from doohan.uni-paderborn.de ([2001:638:502:c003::16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy0-0000iP-Hn for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To: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=M/io09zCH6e/JzGqO5oPLFD/0ZUgWFn1sY2e50095F0=; b=H6iSQyAJ/8VcqL9nrCP6O+vypa PnnPVQN328vCkJq2yRtQhK9IBnZLD1d28FgETS0vk17HH+Ni43a2wT8E2wxjOP0H48kARQvt9zVqN XZX7UkHQw6N/+iGuXjrvm4Lkxw0/NPoDlA0RnglQkFEkhAdF764MVNEnIVrjU/ThHscQ=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 08/21] target/tricore: Fix RCPW/RRPW_INSERT insns for width = 0 Date: Wed, 27 Sep 2023 11:35:39 +0200 Message-ID: <20230927093552.493279-9-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.26.602000 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::16; envelope-from=kbastian@mail.uni-paderborn.de; helo=doohan.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807547157100007 we would crash if width was 0 for these insns, as tcg_gen_deposit() is undefined for that case. For TriCore, width =3D 0 is a mov from the src reg to the dst reg, so we special case this here. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-9-kbastian@mail.uni-paderborn.de> --- target/tricore/translate.c | 10 ++++++++-- tests/tcg/tricore/asm/macros.h | 15 +++++++++++++++ tests/tcg/tricore/asm/test_insert.S | 9 +++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index c9823ee32a..3f950ae33b 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -5310,8 +5310,11 @@ static void decode_rcpw_insert(DisasContext *ctx) } break; case OPC2_32_RCPW_INSERT: + /* tcg_gen_deposit_tl() does not handle the case of width =3D 0 */ + if (width =3D=3D 0) { + tcg_gen_mov_tl(cpu_gpr_d[r2], cpu_gpr_d[r1]); /* if pos + width > 32 undefined result */ - if (pos + width <=3D 32) { + } else if (pos + width <=3D 32) { temp =3D tcg_constant_i32(const4); tcg_gen_deposit_tl(cpu_gpr_d[r2], cpu_gpr_d[r1], temp, pos, wi= dth); } @@ -6571,7 +6574,10 @@ static void decode_rrpw_extract_insert(DisasContext = *ctx) =20 break; case OPC2_32_RRPW_INSERT: - if (pos + width <=3D 32) { + /* tcg_gen_deposit_tl() does not handle the case of width =3D 0 */ + if (width =3D=3D 0) { + tcg_gen_mov_tl(cpu_gpr_d[r3], cpu_gpr_d[r1]); + } else if (pos + width <=3D 32) { tcg_gen_deposit_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r2], pos, width); } diff --git a/tests/tcg/tricore/asm/macros.h b/tests/tcg/tricore/asm/macros.h index b5087b5c97..51f6191ef2 100644 --- a/tests/tcg/tricore/asm/macros.h +++ b/tests/tcg/tricore/asm/macros.h @@ -161,6 +161,21 @@ test_ ## num: = \ insn DREG_CALC_RESULT, DREG_RS1, imm1, DREG_RS2, imm2; \ ) =20 +#define TEST_D_DDII(insn, num, result, rs1, rs2, imm1, imm2) \ + TEST_CASE(num, DREG_CALC_RESULT, result, \ + LI(DREG_RS1, rs1); \ + LI(DREG_RS2, rs2); \ + rstv; \ + insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, imm1, imm2; \ + ) + +#define TEST_D_DIII(insn, num, result, rs1, imm1, imm2, imm3)\ + TEST_CASE(num, DREG_CALC_RESULT, result, \ + LI(DREG_RS1, rs1); \ + rstv; \ + insn DREG_CALC_RESULT, DREG_RS1, imm1, imm2, imm3; \ + ) + #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/asm/test_insert.S b/tests/tcg/tricore/asm/te= st_insert.S index d5fd2237e1..3978810121 100644 --- a/tests/tcg/tricore/asm/test_insert.S +++ b/tests/tcg/tricore/asm/test_insert.S @@ -6,4 +6,13 @@ _start: # | | | | | | | TEST_D_DIDI(insert, 1, 0x7fffffff, 0xffffffff, 0xa, 0x10, 0x8) =20 +# insn num result rs1 imm1 imm2 imm3 +# | | | | | | | + TEST_D_DIII(insert, 2, 0xd38fe370, 0xd38fe370, 0x4, 0x4 , 0x0) + TEST_D_DIII(insert, 3, 0xd38fe374, 0xd38fe370, 0x4, 0x0 , 0x4) + +# insn num result rs1 rs2 pos width +# | | | | | | | + TEST_D_DDII(insert, 4, 0x03c1e53c, 0x03c1e53c, 0x45821385, 0x7 ,0x0) + TEST_PASSFAIL --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807488164785.6640034071298; Wed, 27 Sep 2023 02:38:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyD-0000sV-Ba; Wed, 27 Sep 2023 05:36:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy3-0000mm-U1 for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:28 -0400 Received: from doohan.uni-paderborn.de ([2001:638:502:c003::16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy0-0000if-Vl for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=imYeFgSVkPI88fieUmbPYNUtifTYEW4YKFSEwBH5gJI=; b=jqYl1NF3updIcA4wtYefpie1xJ k+h7ZQ82yb6yYvG9SxKFknXTsQ3hi9tN4/sf+eZuOAtVOgXdSOEeEDQVgJ0kWOUgHze658mTSCsQm EyvO6SpCxutttzsNLb/nw37NFntmwgelS9qvXHXllD4gQI2nl+ivSM3LzWDJLtvVCOi0=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL 09/21] target/tricore: Swap src and dst reg for RCRR_INSERT Date: Wed, 27 Sep 2023 11:35:40 +0200 Message-ID: <20230927093552.493279-10-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: add header X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.26.602000 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::16; envelope-from=kbastian@mail.uni-paderborn.de; helo=doohan.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807488829100011 Content-Type: text/plain; charset="utf-8" Acked-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-10-kbastian@mail.uni-paderborn.de> --- target/tricore/translate.c | 8 ++++---- tests/tcg/tricore/asm/macros.h | 9 +++++++++ tests/tcg/tricore/asm/test_insert.S | 5 +++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 3f950ae33b..7aba7b067c 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -8223,12 +8223,12 @@ static void decode_32Bit_opc(DisasContext *ctx) temp2 =3D tcg_temp_new(); /* width*/ temp3 =3D tcg_temp_new(); /* pos */ =20 - CHECK_REG_PAIR(r3); + CHECK_REG_PAIR(r2); =20 - tcg_gen_andi_tl(temp2, cpu_gpr_d[r3+1], 0x1f); - tcg_gen_andi_tl(temp3, cpu_gpr_d[r3], 0x1f); + tcg_gen_andi_tl(temp2, cpu_gpr_d[r2 + 1], 0x1f); + tcg_gen_andi_tl(temp3, cpu_gpr_d[r2], 0x1f); =20 - gen_insert(cpu_gpr_d[r2], cpu_gpr_d[r1], temp, temp2, temp3); + gen_insert(cpu_gpr_d[r3], cpu_gpr_d[r1], temp, temp2, temp3); break; /* RCRW Format */ case OPCM_32_RCRW_MASK_INSERT: diff --git a/tests/tcg/tricore/asm/macros.h b/tests/tcg/tricore/asm/macros.h index 51f6191ef2..17e696bef5 100644 --- a/tests/tcg/tricore/asm/macros.h +++ b/tests/tcg/tricore/asm/macros.h @@ -169,6 +169,15 @@ test_ ## num: = \ insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, imm1, imm2; \ ) =20 +#define TEST_D_DIE(insn, num, result, rs1, imm1, rs2_lo, rs2_hi)\ + TEST_CASE(num, DREG_CALC_RESULT, result, \ + LI(DREG_RS1, rs1); \ + LI(EREG_RS2_LO, rs2_lo); \ + LI(EREG_RS2_HI, rs2_hi); \ + rstv; \ + insn DREG_CALC_RESULT, DREG_RS1, imm1, EREG_RS2; \ + ) + #define TEST_D_DIII(insn, num, result, rs1, imm1, imm2, imm3)\ TEST_CASE(num, DREG_CALC_RESULT, result, \ LI(DREG_RS1, rs1); \ diff --git a/tests/tcg/tricore/asm/test_insert.S b/tests/tcg/tricore/asm/te= st_insert.S index 3978810121..223d7ce796 100644 --- a/tests/tcg/tricore/asm/test_insert.S +++ b/tests/tcg/tricore/asm/test_insert.S @@ -15,4 +15,9 @@ _start: # | | | | | | | TEST_D_DDII(insert, 4, 0x03c1e53c, 0x03c1e53c, 0x45821385, 0x7 ,0x0) =20 +# insn num result rs1 imm1 rs2_h rs2= _l +# | | | | | | | + TEST_D_DIE(insert, 5, 0xe30c308d, 0xe30c308d ,0x3 , 0x00000000 ,0x0000= 0000) + TEST_D_DIE(insert, 6, 0x669b0120, 0x669b2820 ,0x2 , 0x5530a1c7 ,0x3a2b= 0f67) + TEST_PASSFAIL --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807464802317.12771700776216; Wed, 27 Sep 2023 02:37:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyF-0000u1-87; Wed, 27 Sep 2023 05:36:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy7-0000r3-Hr for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:31 -0400 Received: from hoth.uni-paderborn.de ([2001:638:502:c003::19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy3-0000j0-31 for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=BW2JthvgwEqvznp0bOAz776apq7KePSWI1Irh0UoOYU=; b=HhXOxNDKZaL38WMCfexmRBIjcX h0C9E6LTd22N44amm/jHzYM+AH5qZebyYoe2+4P4ZKtVcuWtBfATkxHho7ocR8/6zobhh7jefdvVh RaeE3vhZRjsenJKtaoLX0CLJ7VACSeOjbeULCQOwElN2Sx509LpvCAcOhrYUMW/jINsg=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL 10/21] target/tricore: Replace cpu_*_code with translator_* Date: Wed, 27 Sep 2023 11:35:41 +0200 Message-ID: <20230927093552.493279-11-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.27.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=20, da=183416449, mc=8, sc=0, hc=8, sp=0, fso=20, re=0, sd=0, hd=0 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::19; envelope-from=kbastian@mail.uni-paderborn.de; helo=hoth.uni-paderborn.de X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807465790100001 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-11-kbastian@mail.uni-paderborn.de> --- target/tricore/translate.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 7aba7b067c..2107d1fdd4 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -8398,7 +8398,7 @@ static bool insn_crosses_page(CPUTriCoreState *env, D= isasContext *ctx) * 4 bytes from the page boundary, so we cross the page if the first * 16 bits indicate that this is a 32 bit insn. */ - uint16_t insn =3D cpu_lduw_code(env, ctx->base.pc_next); + uint16_t insn =3D translator_lduw(env, &ctx->base, ctx->base.pc_next); =20 return !tricore_insn_is_16bit(insn); } @@ -8411,14 +8411,15 @@ static void tricore_tr_translate_insn(DisasContextB= ase *dcbase, CPUState *cpu) uint16_t insn_lo; bool is_16bit; =20 - insn_lo =3D cpu_lduw_code(env, ctx->base.pc_next); + insn_lo =3D translator_lduw(env, &ctx->base, ctx->base.pc_next); is_16bit =3D tricore_insn_is_16bit(insn_lo); if (is_16bit) { ctx->opcode =3D insn_lo; ctx->pc_succ_insn =3D ctx->base.pc_next + 2; decode_16Bit_opc(ctx); } else { - uint32_t insn_hi =3D cpu_lduw_code(env, ctx->base.pc_next + 2); + uint32_t insn_hi =3D translator_lduw(env, &ctx->base, + ctx->base.pc_next + 2); ctx->opcode =3D insn_hi << 16 | insn_lo; ctx->pc_succ_insn =3D ctx->base.pc_next + 4; decode_32Bit_opc(ctx); --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807466016560.2586659799879; Wed, 27 Sep 2023 02:37:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyJ-0000wc-Nj; Wed, 27 Sep 2023 05:36:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy9-0000sN-TF for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:35 -0400 Received: from collins.uni-paderborn.de ([2001:638:502:c003::14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy8-0000jd-AZ for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=WUubD0ZJKTGpZfFwTqcmK2tbordUXESg+SoTC0LvCn0=; b=BavW3qzMZN1Y7Z0/Jy3S63YISM 8Zy9oLJit/bDTNtzOEAzXVEiITbWPH/1V5qNHUnH6e2MlHe7ncU2XD5MTLlj0LPU9rFXrVdvBE8Lr LcXOH0bECJQr8R5vBIVQ8P4t28jFe0tW0DMGM+DgoHkHQku42JZIjrxaCuEk4ZibM2to=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL 11/21] target/tricore: Fix FTOUZ being ISA v1.3.1 up Date: Wed, 27 Sep 2023 11:35:42 +0200 Message-ID: <20230927093552.493279-12-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.27.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=22, da=183416451, mc=10, sc=0, hc=10, sp=0, fso=22, re=0, sd=0, hd=0 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::14; envelope-from=kbastian@mail.uni-paderborn.de; helo=collins.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807467703100009 Content-Type: text/plain; charset="utf-8" Reviewed-by: Richard Henderson Signed-off-by: Bastian Koppelmann Message-ID: <20230828112651.522058-12-kbastian@mail.uni-paderborn.de> --- target/tricore/translate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 2107d1fdd4..7b53307eff 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -6290,7 +6290,11 @@ static void decode_rr_divide(DisasContext *ctx) gen_helper_ftou(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); break; case OPC2_32_RR_FTOUZ: - gen_helper_ftouz(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); + if (has_feature(ctx, TRICORE_FEATURE_131)) { + gen_helper_ftouz(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); + } else { + generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC); + } break; case OPC2_32_RR_UPDFL: gen_helper_updfl(cpu_env, cpu_gpr_d[r1]); --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807554894745.323444456091; Wed, 27 Sep 2023 02:39:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyH-0000un-H6; Wed, 27 Sep 2023 05:36:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy9-0000sO-TH for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:35 -0400 Received: from doohan.uni-paderborn.de ([2001:638:502:c003::16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy8-0000jk-Ac for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=Lx0pKQw/TW/kaIGCunsNAhOgP3Cy5yyfbtAHJigKPNQ=; b=svPwvdVHxUgcRukVFhVgdmyVXr HuRELGr9S/YvCaqSoLDYBAXGzZKEnYQzVeKNHvV/fdr/nagI2yUmTVzmwYruV6nOsfvZ8DnZfSFLW EKybIwFgacP4gzL1gV9A4X3iQqEkp+sLFfpMbHYNzvBtUtZLwfQyGBrB8cOlzS1kPgEc=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL 12/21] tests/tcg/tricore: Extended and non-extened regs now match Date: Wed, 27 Sep 2023 11:35:43 +0200 Message-ID: <20230927093552.493279-13-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.26.602000 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::16; envelope-from=kbastian@mail.uni-paderborn.de; helo=doohan.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807556758100001 Content-Type: text/plain; charset="utf-8" RSx for d regs and e regs now use the same numbering. This makes sure that mixing d and e registers in an insn test will not overwrite data between registers. Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-2-kbastian@mail.uni-paderborn.de> --- tests/tcg/tricore/asm/macros.h | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/tcg/tricore/asm/macros.h b/tests/tcg/tricore/asm/macros.h index 17e696bef5..0f349dbf1e 100644 --- a/tests/tcg/tricore/asm/macros.h +++ b/tests/tcg/tricore/asm/macros.h @@ -12,31 +12,31 @@ #define TESTDEV_ADDR 0xf0000000 /* Register definitions */ #define DREG_RS1 %d0 -#define DREG_RS2 %d1 -#define DREG_RS3 %d2 -#define DREG_CALC_RESULT %d3 -#define DREG_CALC_PSW %d4 -#define DREG_CORRECT_PSW %d5 -#define DREG_TEMP_LI %d10 -#define DREG_TEMP %d11 -#define DREG_TEST_NUM %d14 -#define DREG_CORRECT_RESULT %d15 -#define DREG_CORRECT_RESULT_2 %d13 +#define DREG_RS2 %d2 +#define DREG_RS3 %d4 +#define DREG_CALC_RESULT %d5 +#define DREG_CALC_PSW %d6 +#define DREG_CORRECT_PSW %d7 +#define DREG_TEMP_LI %d13 +#define DREG_TEMP %d14 +#define DREG_TEST_NUM %d8 +#define DREG_CORRECT_RESULT %d9 +#define DREG_CORRECT_RESULT_2 %d10 =20 #define AREG_ADDR %a0 #define AREG_CORRECT_RESULT %a3 =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_RS1 %e0 +#define EREG_RS1_LO %d0 +#define EREG_RS1_HI %d1 +#define EREG_RS2 %e2 +#define EREG_RS2_LO %d2 +#define EREG_RS2_HI %d3 +#define EREG_CALC_RESULT %e6 +#define EREG_CALC_RESULT_LO %d6 +#define EREG_CALC_RESULT_HI %d7 #define EREG_CORRECT_RESULT_LO %d0 #define EREG_CORRECT_RESULT_HI %d1 =20 --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807531776869.6119007752004; Wed, 27 Sep 2023 02:38:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyH-0000v3-Tt; Wed, 27 Sep 2023 05:36:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyC-0000sy-AP for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:37 -0400 Received: from collins.uni-paderborn.de ([2001:638:502:c003::14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQy8-0000k4-Vx for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=s3NiLOOQMm0nxp6YcmaHJ9kEmWXyanUeeZN5037TDLM=; b=XDaj1Gw+aq/HopwNxoJKxILwdy upyPSC2e/RZToxry2sf2XtfaF1HgPDtrrXGW8g7AHzuGk8kHHi2COfx4NKN5DGI2ecv9e22R/LZh9 CPCfK/IxgR1TTRPc9ZWpYA3YMyc/zmWFY6sm9FEzfwx6udpK2fbczACkk5bCHMZpoQls=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL 13/21] hw/tricore: Log failing test in testdevice Date: Wed, 27 Sep 2023 11:35:44 +0200 Message-ID: <20230927093552.493279-14-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: add header X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.27.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=26, da=183416455, mc=12, sc=0, hc=12, sp=0, fso=26, re=0, sd=0, hd=0 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::14; envelope-from=kbastian@mail.uni-paderborn.de; helo=collins.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807532959100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-3-kbastian@mail.uni-paderborn.de> --- hw/tricore/tricore_testdevice.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/tricore/tricore_testdevice.c b/hw/tricore/tricore_testdevic= e.c index a1563aa568..d0f8db9089 100644 --- a/hw/tricore/tricore_testdevice.c +++ b/hw/tricore/tricore_testdevice.c @@ -16,6 +16,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/log.h" #include "hw/sysbus.h" #include "hw/qdev-properties.h" #include "hw/tricore/tricore_testdevice.h" @@ -23,6 +24,9 @@ static void tricore_testdevice_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { + if (value !=3D 0) { + qemu_log_mask(LOG_GUEST_ERROR, "Test %ld failed!\n", value); + } exit(value); } =20 --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807498790498.42984051811914; Wed, 27 Sep 2023 02:38:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyK-0000ws-CH; Wed, 27 Sep 2023 05:36:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyE-0000ty-IU for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:39 -0400 Received: from nylar.uni-paderborn.de ([2001:638:502:c003::18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyC-0000lQ-3y for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=MRQZEvEYi+zUG4NJbvdJBGvfkg63AwExWzhbABBdHFw=; b=DI/tIKPUEbtNcfusmQ/yXm3kN8 WXP+ECfSTpxo+MPzULuYh+Jz4IVAWx+yI/OtpCtUbkbzU0FT1Pa7s0GrUWrJLf35zXu+FYPW9ATEL nmOj4Yst0DpC+n6H8ExEvUvW27sYhLBDTkUTD0Sb3JLCfQj11f87FMUNLvOAlltf6yrg=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL 14/21] tests/tcg: Reset result register after each test Date: Wed, 27 Sep 2023 11:35:45 +0200 Message-ID: <20230927093552.493279-15-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.25.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=28, da=183416457, mc=14, sc=0, hc=14, sp=0, fso=28, re=0, sd=0, hd=0 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::18; envelope-from=kbastian@mail.uni-paderborn.de; helo=nylar.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807500516100001 Content-Type: text/plain; charset="utf-8" some insns use the result register implicitly as an input. Thus, we could end up with data from the previous insn spilling over. Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-4-kbastian@mail.uni-paderborn.de> --- tests/tcg/tricore/asm/macros.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tcg/tricore/asm/macros.h b/tests/tcg/tricore/asm/macros.h index 0f349dbf1e..e831f73721 100644 --- a/tests/tcg/tricore/asm/macros.h +++ b/tests/tcg/tricore/asm/macros.h @@ -46,7 +46,8 @@ test_ ## num: \ code; \ LI(DREG_CORRECT_RESULT, correct) \ mov DREG_TEST_NUM, num; \ - jne testreg, DREG_CORRECT_RESULT, fail \ + jne testreg, DREG_CORRECT_RESULT, fail; \ + mov testreg, 0 =20 #define TEST_CASE_E(num, correct_lo, correct_hi, code...) \ test_ ## num: \ --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807485283650.3102298050289; Wed, 27 Sep 2023 02:38:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyN-0000yz-F6; Wed, 27 Sep 2023 05:36:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyG-0000uG-0q for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:41 -0400 Received: from doohan.uni-paderborn.de ([2001:638:502:c003::16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyD-0000mh-J4 for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=X5J/bNt9wHzTg3yH4vw4ZCMQExDQjR4VOZMLKYxJg5g=; b=X6srKKey/AowOVIotIbKHz2F8J x7Tl1tp66aehaHhlwOGyFF3/jtijD94RV+7hozM/yguOqrnIMP61mUjLcz3mxbNrT1OmPVLtYma93 hGkC5bwZfhNZaAseZfMSu+jdd6c09ZE0tQjNkT1esm3DXaP8BFvvAXygoOs+jH60byQQ=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL 15/21] tests/tcg/tricore: Add test for all arith insns up to addx Date: Wed, 27 Sep 2023 11:35:46 +0200 Message-ID: <20230927093552.493279-16-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: add header X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.26.602000 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::16; envelope-from=kbastian@mail.uni-paderborn.de; helo=doohan.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807486170100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-5-kbastian@mail.uni-paderborn.de> --- tests/tcg/tricore/Makefile.softmmu-target | 3 +- tests/tcg/tricore/asm/macros.h | 50 +++++++++++++++++++++++ tests/tcg/tricore/asm/sas.py | 21 ++++++++++ tests/tcg/tricore/asm/test_arith.S | 41 +++++++++++++++++++ 4 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/tricore/asm/sas.py create mode 100644 tests/tcg/tricore/asm/test_arith.S diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/= Makefile.softmmu-target index 258aeb40ae..82ed9fa7e2 100644 --- a/tests/tcg/tricore/Makefile.softmmu-target +++ b/tests/tcg/tricore/Makefile.softmmu-target @@ -6,6 +6,7 @@ LDFLAGS =3D -T$(TESTS_PATH)/link.ld --mcpu=3Dtc162 ASFLAGS =3D -mtc162 CFLAGS =3D -mtc162 -c -I$(TESTS_PATH) =20 +TESTS +=3D test_arith.asm.tst TESTS +=3D test_abs.asm.tst TESTS +=3D test_bmerge.asm.tst TESTS +=3D test_clz.asm.tst @@ -29,7 +30,7 @@ TESTS +=3D test_muls.asm.tst TESTS +=3D test_boot_to_main.c.tst TESTS +=3D test_context_save_areas.c.tst =20 -QEMU_OPTS +=3D -M tricore_testboard -cpu tc37x -nographic -kernel +QEMU_OPTS +=3D -M tricore_testboard -cpu tc37x -nographic -d guest_errors = -kernel =20 %.pS: $(ASM_TESTS_PATH)/%.S $(CC) -E -o $@ $< diff --git a/tests/tcg/tricore/asm/macros.h b/tests/tcg/tricore/asm/macros.h index e831f73721..8ed2249b0d 100644 --- a/tests/tcg/tricore/asm/macros.h +++ b/tests/tcg/tricore/asm/macros.h @@ -112,6 +112,11 @@ test_ ## num: = \ insn DREG_CORRECT_RESULT, DREG_RS1; \ ) =20 +#define TEST_D_I(insn, num, result, imm) \ + TEST_CASE(num, DREG_CALC_RESULT, result, \ + insn DREG_CALC_RESULT, imm; \ + ) + #define TEST_D_DDD(insn, num, result, rs1, rs2, rs3) \ TEST_CASE(num, DREG_CALC_RESULT, result, \ LI(DREG_RS1, rs1); \ @@ -129,6 +134,51 @@ test_ ## num: = \ insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2; \ ) =20 +#define TEST_D_DI(insn, num, result, rs1, imm1) \ + TEST_CASE(num, DREG_CALC_RESULT, result, \ + LI(DREG_RS1, rs1); \ + rstv; \ + insn DREG_CALC_RESULT, DREG_RS1, imm1; \ + ) + +#define TEST_D_D15I(insn, num, result, rs1, imm1) \ + TEST_CASE(num, DREG_CALC_RESULT, result, \ + LI(%d15, rs1); \ + rstv; \ + insn DREG_CALC_RESULT, %d15, imm1; \ + ) + +#define TEST_D15_DD(insn, num, result, rs1, rs2) \ + TEST_CASE(num, %d15, result, \ + LI(DREG_RS1, rs1); \ + LI(DREG_RS2, rs2); \ + rstv; \ + insn %d15, DREG_RS1, DREG_RS2; \ + ) + +#define TEST_D15_DI(insn, num, result, rs1, imm) \ + TEST_CASE(num, %d15, result, \ + LI(DREG_RS1, rs1); \ + rstv; \ + insn %d15, DREG_RS1, imm; \ + ) + +#define TEST_D_DD(insn, num, result, rs1, rs2) \ + TEST_CASE(num, DREG_CALC_RESULT, result, \ + LI(DREG_RS1, rs1); \ + LI(DREG_RS2, rs2); \ + rstv; \ + insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2; \ + ) + +#define TEST_D_D15D(insn, num, result, rs1, rs2) \ + TEST_CASE(num, DREG_CALC_RESULT, result, \ + LI(%d15, rs1); \ + LI(DREG_RS2, rs2); \ + rstv; \ + insn DREG_CALC_RESULT, %d15, 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); \ diff --git a/tests/tcg/tricore/asm/sas.py b/tests/tcg/tricore/asm/sas.py new file mode 100644 index 0000000000..ed6b8f3871 --- /dev/null +++ b/tests/tcg/tricore/asm/sas.py @@ -0,0 +1,21 @@ + +with open('test_arith.S', 'r') as f: + out =3D "" + lines =3D f.readlines() + num =3D 1 + start =3D False + for line in lines: + if start: + toks =3D line.split(",") + if len(toks) =3D=3D 1: + out +=3D line + continue + out +=3D toks[0] + ", " + str(num) + "," + ",".join(toks[2:]) + num +=3D 1 + else: + out +=3D line + + if line.startswith("_start:"): + start =3D True + + print(out) diff --git a/tests/tcg/tricore/asm/test_arith.S b/tests/tcg/tricore/asm/tes= t_arith.S new file mode 100644 index 0000000000..07c4b876e9 --- /dev/null +++ b/tests/tcg/tricore/asm/test_arith.S @@ -0,0 +1,41 @@ +#include "macros.h" +.text +.global _start +_start: + TEST_D_D(abs, 1, 0x778636a7, 0x778636a7 ) + TEST_D_D(abs.b, 2, 0x497a4902, 0xb786b702 ) + TEST_D_D(abs.h, 3, 0x48331698, 0xb7cde968 ) + TEST_D_DI(absdif, 4, 0x22a52402, 0xdd5adc1a ,0x1c ) + TEST_D_DD(absdif, 5, 0x1e106273, 0x56f0cea3 ,0x75013116 ) + TEST_D_DD(absdif.b, 6, 0xa650a3b, 0xa7ee8b2a ,0x9d899565 ) + TEST_D_DD(absdif.h, 7, 0x7dd06888, 0x88292922 ,0x5f9c09a ) + TEST_D_DI(absdifs, 8, 0x79adddf7, 0x865222d1 ,0xc8 ) + TEST_D_DD(absdifs, 9, 0x7fffffff, 0x2ac1008b ,0x80032055 ) + TEST_D_DD(absdifs.h, 10, 0x65ae7fff, 0xf70a7a05 ,0x915cc1b3 ) + TEST_D_D(abss, 11, 0x2a671868, 0xd598e798 ) + TEST_D_D(abss.h, 12, 0x60fc7ce5, 0x9f04831b ) + TEST_D_DI(add, 13, 0x951ce738, 0x951ce6b4 ,0x84 ) + TEST_D_DD(add, 14, 0x53975df5, 0xc003e25a ,0x93937b9b ) + TEST_D_I(add, 15, 0x5, 0x5 ) + TEST_D_D15I(add, 16, 0x3c330214, 0x3c33020f ,0x5 ) + TEST_D15_DI(add, 17, 0x55eb1b8, 0x55eb1b8 ,0x0 ) + TEST_D_D(add, 18, 0xe66ead54, 0xe66ead54 ) + TEST_D_D15D(add, 19, 0xe450f787, 0xc7100fee ,0x1d40e799 ) + TEST_D15_DD(add, 20, 0x73f6d886, 0x27ca8a80 ,0x4c2c4e06 ) + TEST_D_DD(add.b, 21, 0x631bd462, 0xf9702965 ,0x6aababfd ) + TEST_D_DD(add.h, 22, 0x76ce127a, 0xf5402796 ,0x818eeae4 ) + TEST_D_DI(addc, 23, 0xcf8399c3, 0xcf839920 ,0xa3 ) + TEST_D_DD(addc, 24, 0xa455054c, 0x85d0b9ed ,0x1e844b5f ) + TEST_D_DI(addi, 25, 0xbf202fe6, 0xbf1fd903 ,0x56e3 ) + TEST_D_DI(addih, 26, 0xf28a99cc, 0xc10499cc ,12678 ) + TEST_D_DI(adds, 27, 0x233892ad, 0x233892ad ,0x0 ) + TEST_D_DD(adds, 28, 0xc1b1184d, 0x100a2339 ,0xb1a6f514 ) + TEST_D_D(adds, 29, 0x19143e9a, 0x19143e9a ) + TEST_D_DD(adds.h, 30, 0x7fff9de3, 0x668ebcc8 ,0x7462e11b ) + TEST_D_DD(adds.hu, 31, 0xffffffff, 0xbe0776eb ,0x5d69b388 ) + TEST_D_DI(adds.u, 32, 0x84c176ba, 0x84c176a9 ,0x11 ) + TEST_D_DD(adds.u, 33, 0xffffffff, 0xd4a91e39 ,0x55b1baed ) + TEST_D_DI(addx, 34, 0x38f63b5, 0x38f632b ,0x8a ) + TEST_D_DD(addx, 35, 0x8b9da5a4, 0x16e32e7 ,0x8a2f72bd ) + + TEST_PASSFAIL --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 169580746627256.067742828400355; Wed, 27 Sep 2023 02:37:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyL-0000xJ-4B; Wed, 27 Sep 2023 05:36:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyH-0000um-DY for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:41 -0400 Received: from doohan.uni-paderborn.de ([2001:638:502:c003::16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyF-0000n8-OV for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=GQWNclsgNal5rnB1w9TaT4kvpYudBJGlCn/pvUQoht4=; b=ZIzNpFGIHFt9Ij5uIukH+kGtUu Ec2Sdh95jobxoGDJP29LwWA/4cVYmXLUJIZ4KOmv6oEZXyRL4OVAanRTp8ULnplgwi34z9IyhimLN hw7x+IdJ++oDaGSEePDsBxZR2qxH3wGUHUHnvoNR/TZxO3iR2uGrw7d0EFlbfygjKd5Q=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL 16/21] tests/tcg/tricore: Add test from 'and' to 'csub' Date: Wed, 27 Sep 2023 11:35:47 +0200 Message-ID: <20230927093552.493279-17-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.26.602000 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::16; envelope-from=kbastian@mail.uni-paderborn.de; helo=doohan.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807467727100010 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-6-kbastian@mail.uni-paderborn.de> --- tests/tcg/tricore/asm/macros.h | 11 +++++++ tests/tcg/tricore/asm/test_arith.S | 47 ++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/tests/tcg/tricore/asm/macros.h b/tests/tcg/tricore/asm/macros.h index 8ed2249b0d..3000e15590 100644 --- a/tests/tcg/tricore/asm/macros.h +++ b/tests/tcg/tricore/asm/macros.h @@ -117,6 +117,11 @@ test_ ## num: = \ insn DREG_CALC_RESULT, imm; \ ) =20 +#define TEST_D15_I(insn, num, result, imm) \ + TEST_CASE(num, %d15, result, \ + insn %d15, imm; \ + ) + #define TEST_D_DDD(insn, num, result, rs1, rs2, rs3) \ TEST_CASE(num, DREG_CALC_RESULT, result, \ LI(DREG_RS1, rs1); \ @@ -236,6 +241,12 @@ test_ ## num: = \ insn DREG_CALC_RESULT, DREG_RS1, imm1, imm2, imm3; \ ) =20 +#define TEST_E_D(insn, num, res_lo, res_hi, rs1) \ + TEST_CASE_E(num, res_lo, res_hi, \ + LI(DREG_RS1, rs1); \ + insn EREG_CALC_RESULT, DREG_RS1; \ + ) + #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/asm/test_arith.S b/tests/tcg/tricore/asm/tes= t_arith.S index 07c4b876e9..ec87413777 100644 --- a/tests/tcg/tricore/asm/test_arith.S +++ b/tests/tcg/tricore/asm/test_arith.S @@ -37,5 +37,52 @@ _start: TEST_D_DD(adds.u, 33, 0xffffffff, 0xd4a91e39 ,0x55b1baed ) TEST_D_DI(addx, 34, 0x38f63b5, 0x38f632b ,0x8a ) TEST_D_DD(addx, 35, 0x8b9da5a4, 0x16e32e7 ,0x8a2f72bd ) + TEST_D_DI(and, 36, 0x1, 0xf9683907 ,0x69 ) + TEST_D_DD(and, 37, 0x40102090, 0x48d86c91 ,0x511123d0 ) + TEST_D15_I(and, 38, 0x0, 0x1a ) + TEST_D_D(and, 39, 0x0, 0x551343d6 ) + TEST_D_DIDI(and.and.t, 40, 0x0, 0x60343d14 ,0x4 ,0x922020d8 ,0x3 ) + TEST_D_DIDI(and.andn.t, 41, 0x0, 0xd4f95dad ,0x5 ,0xb9fff576 ,0x3 ) + TEST_D_DI(and.eq, 42, 0x0, 0x9945aaf ,0xf ) + TEST_D_DD(and.eq, 43, 0x0, 0x32a94b38 ,0xf53b9463 ) + TEST_D_DI(and.ge, 44, 0x0, 0xe66d0f6e ,0x55 ) + TEST_D_DD(and.ge, 45, 0x0, 0x43ea87d0 ,0x5adacf4d ) + TEST_D_DI(and.ge.u, 46, 0x0, 0x4bef5bd1 ,0xb3 ) + TEST_D_DD(and.ge.u, 47, 0x0, 0x9b5504c2 ,0x3787f19 ) + TEST_D_DI(and.lt, 48, 0x0, 0x36daf216 ,0xc8 ) + TEST_D_DD(and.lt, 49, 0x0, 0x6bf175f7 ,0x769bc7db ) + TEST_D_DI(and.lt.u, 50, 0x0, 0xbef4b04a ,0x1d ) + TEST_D_DD(and.lt.u, 51, 0x0, 0xa89ea455 ,0x84dc9898 ) + TEST_D_DI(and.ne, 52, 0x0, 0xf3bb3559 ,0x5e ) + TEST_D_DD(and.ne, 53, 0x0, 0xa05258eb ,0x50c5b0e4 ) + TEST_D_DIDI(and.nor.t, 54, 0x0, 0xd7534767 ,0x1 ,0x5fac529f ,0x6 ) + TEST_D_DIDI(and.or.t, 55, 0x0, 0xa3dd1690 ,0x7 ,0xe25f7361 ,0x4 ) + TEST_D_DIDI(and.t, 56, 0x0, 0x9f6f71d5 ,0x1 ,0xe9dfe144 ,0x2 ) + TEST_D_DI(andn, 57, 0xb2ed0c01, 0xb2ed0cf1 ,0xfc ) + TEST_D_DD(andn, 58, 0x102d884, 0x494ad98c ,0xf87d077a ) + TEST_D_DIDI(andn.t, 59, 0x0, 0x24ef957a ,0x5 ,0xaf95e01e ,0x4 ) + TEST_D_DD(bmerge, 60, 0xbfe56f84, 0x2a0fc78 ,0xf7127bb2 ) + TEST_E_D(bsplit, 61, 0x1ae2, 0xef60, 0xa9ee7c04 ) + TEST_D_DDI(cadd, 62, 0x3ac01dec, 0x7770d9a ,0x3ac01d3d ,0xaf ) + TEST_D_DDD(cadd, 63, 0x48a771b4, 0xdf020dda ,0xb81cdead ,0x908a9307 ) + TEST_D_D15I(cadd, 64, 0x4, 0x6a766c11 ,0x4 ) + TEST_D_DDI(caddn, 65, 0xdc0cd85d, 0xfe1fbf45 ,0xdc0cd85d ,0x1c ) + TEST_D_DDD(caddn, 66, 0xd7bd5cb5, 0x70a930bd ,0xd7bd5cb5 ,0xb5dce80d ) + TEST_D_D15I(caddn, 67, 0x0, 0xb6051252 ,0x4 ) + TEST_D_D(clo, 68, 0x1, 0xa15f7ebc ) + TEST_D_D(clo.h, 69, 0x0, 0x2bf418ef ) + TEST_D_D(cls, 70, 0x1, 0xcbda5b50 ) + TEST_D_D(cls.h, 71, 0x10001, 0xd15ac540 ) + TEST_D_D(clz, 72, 0x1, 0x62ddf743 ) + TEST_D_D(clz.h, 73, 0x0, 0xa859df54 ) + TEST_D_D15I(cmov, 74, 0x5, 0x7d06b438 ,0x5 ) + TEST_D_D15D(cmov, 75, 0x4d24e162, 0xd07651a5 ,0x4d24e162 ) + TEST_D_D15I(cmovn, 76, 0x0, 0xea576d5 ,0x6 ) + TEST_D_D15D(cmovn, 77, 0x0, 0x6a1d2b48 ,0xb28bc831 ) + TEST_D_DD(crc32.b, 78, 0x3baca290, 0xcde828a2 ,0x869b2ea4 ) + TEST_D_DD(crc32b.w, 79, 0x7f9d8908, 0xdaf396a5 ,0xa9011cf2 ) + TEST_D_DD(crc32l.w, 80, 0x1707579b, 0x87572060 ,0x8cdfa395 ) + TEST_D_DDD(csub, 81, 0xf389f12f, 0xae9c7e04 ,0x63247211 ,0x6f9a80e2 ) + TEST_D_DDD(csubn, 82, 0x2a7dd20d, 0xc39caf46 ,0x2a7dd20d ,0xa8ab6269 ) =20 TEST_PASSFAIL --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807488665670.6474242990731; Wed, 27 Sep 2023 02:38:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyL-0000yI-S2; Wed, 27 Sep 2023 05:36:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyK-0000wx-Rb for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:44 -0400 Received: from hoth.uni-paderborn.de ([2001:638:502:c003::19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyJ-0000nQ-0X for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=aX8N1xTbcIH6Dg4T9j28Olre0/HXSrm76MvHnsOmx+8=; b=kIou98s8eahI3KlPH9r8T6edYP UZqCVuYlPVW9h39GufyNxqTj9YeJB2DAMKE3OlkNrQ2AixvB3C6MvvmZw2kfaJklxPe8fCZXLVAQM +BdT3HZwanTDUFnzze68tWeR0bxQ5OLVGvhgPzA996PCDvONeOwAV7+ckUvkxDU6gf9s=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL 17/21] tests/tcg/tricore: Add test from 'dextr' to 'lt' Date: Wed, 27 Sep 2023 11:35:48 +0200 Message-ID: <20230927093552.493279-18-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: add header X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.26.602001 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::19; envelope-from=kbastian@mail.uni-paderborn.de; helo=hoth.uni-paderborn.de X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807490968100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-7-kbastian@mail.uni-paderborn.de> --- tests/tcg/tricore/asm/macros.h | 51 ++++++++++++++++++++++++++-- tests/tcg/tricore/asm/test_arith.S | 53 ++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/tests/tcg/tricore/asm/macros.h b/tests/tcg/tricore/asm/macros.h index 3000e15590..92f0f7b22b 100644 --- a/tests/tcg/tricore/asm/macros.h +++ b/tests/tcg/tricore/asm/macros.h @@ -34,6 +34,9 @@ #define EREG_RS2 %e2 #define EREG_RS2_LO %d2 #define EREG_RS2_HI %d3 +#define EREG_RS3 %e4 +#define EREG_RS3_LO %d4 +#define EREG_RS3_HI %d5 #define EREG_CALC_RESULT %e6 #define EREG_CALC_RESULT_LO %d6 #define EREG_CALC_RESULT_HI %d7 @@ -131,6 +134,26 @@ test_ ## num: = \ insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, DREG_RS3; \ ) =20 +#define TEST_D_DDDI(insn, num, result, rs1, rs2, rs3, imm) \ + TEST_CASE(num, DREG_CALC_RESULT, result, \ + LI(DREG_RS1, rs1); \ + LI(DREG_RS2, rs2); \ + LI(DREG_RS3, rs3); \ + rstv; \ + insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, DREG_RS3, imm; \ + ) + + +#define TEST_D_DDE(insn, num, result, rs1, rs2, rs3_lo, rs3_hi) \ + TEST_CASE(num, DREG_CALC_RESULT, result, \ + LI(DREG_RS1, rs1); \ + LI(DREG_RS2, rs2); \ + LI(EREG_RS3_LO, rs3_lo); \ + LI(EREG_RS3_HI, rs3_hi); \ + rstv; \ + insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, EREG_RS3; \ + ) + #define TEST_D_DD_PSW(insn, num, result, psw, rs1, rs2) \ TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw, \ LI(DREG_RS1, rs1); \ @@ -209,6 +232,12 @@ test_ ## num: = \ insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, imm; \ ) =20 +#define TEST_E_DII(insn, num, res_lo, res_hi, rs1, imm1, imm2) \ + TEST_CASE_E(num, res_lo, res_hi, \ + LI(DREG_RS1, rs1); \ + insn EREG_CALC_RESULT, DREG_RS1, imm1, imm2; \ + ) + #define TEST_D_DIDI(insn, num, result, rs1, imm1, rs2, imm2) \ TEST_CASE(num, DREG_CALC_RESULT, result, \ LI(DREG_RS1, rs1); \ @@ -247,7 +276,7 @@ test_ ## num: = \ insn EREG_CALC_RESULT, DREG_RS1; \ ) =20 -#define TEST_E_ED(insn, num, res_hi, res_lo, rs1_hi, rs1_lo, rs2) \ +#define TEST_E_ED(insn, num, res_lo, res_hi, rs1_lo, rs1_hi, rs2) \ TEST_CASE_E(num, res_lo, res_hi, \ LI(EREG_RS1_LO, rs1_lo); \ LI(EREG_RS1_HI, rs1_hi); \ @@ -255,14 +284,32 @@ test_ ## num: = \ insn EREG_CALC_RESULT, EREG_RS1, DREG_RS2; \ ) =20 -#define TEST_E_IDI(insn, num, res_hi, res_lo, imm1, rs1, imm2) \ +#define TEST_E_IDI(insn, num, res_lo, res_hi, imm1, rs1, imm2) \ TEST_CASE_E(num, res_lo, res_hi, \ LI(DREG_RS1, rs1); \ rstv; \ insn EREG_CALC_RESULT, imm1, DREG_RS1, imm2; \ ) =20 +#define TEST_E_DD(insn, num, res_lo, res_hi, rs1, rs2) \ + TEST_CASE_E(num, res_lo, res_hi, \ + LI(DREG_RS1, rs1); \ + LI(DREG_RS2, rs2); \ + insn EREG_CALC_RESULT, DREG_RS1, DREG_RS2; \ + ) =20 +#define TEST_E_DDI(insn, num, res_lo, res_hi, rs1, rs2, imm) \ + TEST_CASE_E(num, res_lo, res_hi, \ + LI(DREG_RS1, rs1); \ + LI(DREG_RS2, rs2); \ + insn EREG_CALC_RESULT, DREG_RS1, DREG_RS2, imm; \ + ) + +#define TEST_E_III(insn, num, res_lo, res_hi, imm1, imm2, imm3) \ + TEST_CASE_E(num, res_lo, res_hi, \ + rstv; \ + insn EREG_CALC_RESULT, imm1, imm2, imm3; \ + ) =20 /* Pass/Fail handling part */ #define TEST_PASSFAIL \ diff --git a/tests/tcg/tricore/asm/test_arith.S b/tests/tcg/tricore/asm/tes= t_arith.S index ec87413777..68b6715cb9 100644 --- a/tests/tcg/tricore/asm/test_arith.S +++ b/tests/tcg/tricore/asm/test_arith.S @@ -84,5 +84,58 @@ _start: TEST_D_DD(crc32l.w, 80, 0x1707579b, 0x87572060 ,0x8cdfa395 ) TEST_D_DDD(csub, 81, 0xf389f12f, 0xae9c7e04 ,0x63247211 ,0x6f9a80e2 ) TEST_D_DDD(csubn, 82, 0x2a7dd20d, 0xc39caf46 ,0x2a7dd20d ,0xa8ab6269 ) + TEST_D_DDI(dextr, 83, 0x6b245592, 0x90d648ab ,0x2436a08d ,0x7 ) + TEST_D_DDD(dextr, 84, 0x4e9d8172, 0x6b8c6274 ,0xec0b9772 ,0x7ab0d8f5 ) + TEST_E_ED(dvadj, 85, 0xfb793929 ,0xf15f4ecc, 0xfb793928 ,0xf15f4ecc ,0= x5de9a7b4 ) + TEST_E_DD(dvinit, 86, 0xbbd99367 ,0xffffffff, 0xbbd99367 ,0xa248dff9 ) + TEST_E_DD(dvinit.b, 87, 0x58ffffff ,0x1f3f20, 0x1f3f2058 ,0xfed6c3ec ) + TEST_E_DD(dvinit.bu, 88, 0xa000000 ,0x8bbf54, 0x8bbf540a ,0xa0bcfdde ) + TEST_E_DD(dvinit.h, 89, 0xfe59ffff ,0x6d07, 0x6d07fe59 ,0xe4a6e12c ) + TEST_E_DD(dvinit.hu, 90, 0x8e5d0000 ,0x37bd, 0x37bd8e5d ,0x38c0be4c ) + TEST_E_DD(dvinit.u, 91, 0x613ca148 ,0x0, 0x613ca148 ,0x79e89e70 ) + TEST_E_ED(dvstep.u, 92, 0x90388180 ,0x356c3f47, 0x47903881 ,0xd5b131ef= ,0xa8f78b60 ) + TEST_D_DI(eq, 93, 0x0, 0x22cf24bc ,0x3c ) + TEST_D_DD(eq, 94, 0x0, 0x1b220983 ,0x60d6182 ) + TEST_D15_DI(eq, 95, 0x0, 0x66b1313e ,0x1 ) + TEST_D15_DD(eq, 96, 0x0, 0x3a6b6484 ,0xe1bdc794 ) + TEST_D_DD(eq.b, 97, 0x0, 0x1413e6a2 ,0x8237ab11 ) + TEST_D_DD(eq.h, 98, 0x0, 0xc2d2cdd3 ,0xfd8576be ) + TEST_D_DD(eq.w, 99, 0x0, 0x1b6f66d7 ,0x738035d1 ) + TEST_D_DI(eqany.b, 100, 0x0, 0xfb630c56 ,0x9f ) + TEST_D_DD(eqany.b, 101, 0x0, 0x5cdbbb44 ,0xf7911917 ) + TEST_D_DI(eqany.h, 102, 0x0, 0xd31af4d0 ,0xc ) + TEST_D_DD(eqany.h, 103, 0x0, 0x6bd800e2 ,0x8bea6be7 ) + TEST_D_DI(ge, 104, 0x1, 0x3d3d0f67 ,0x6d ) + TEST_D_DD(ge, 105, 0x1, 0x7238ba92 ,0x3d6d3327 ) + TEST_D_DI(ge.u, 106, 0x1, 0xc34402cb ,0xf2 ) + TEST_D_DD(ge.u, 107, 0x1, 0xf44ec751 ,0x42f3f12d ) + TEST_E_III(imask, 108, 0x1c0 ,0x1c0, 0x7 ,0x6 ,0x3 ) + TEST_E_IDI(imask, 109, 0x1 ,0x7f, 0x1 ,0xa7390380 ,0x7 ) + TEST_E_DII(imask, 110, 0x3fdaaa80 ,0x1fc0, 0x14ff6aaa ,0x6 ,0x7 ) + TEST_E_DDI(imask, 111, 0xfc8a94c0 ,0x1f0, 0xafc8a94c ,0x37ceafe4 ,0x5 ) + TEST_D_DIDI(ins.t, 112, 0x3991c755, 0x3991c755 ,0x2 ,0xa9b171ef ,0x4 ) + TEST_D_DIII(insert, 113, 0x9997e4d7, 0x9997e497 ,0x6 ,0x5 ,0x2 ) + TEST_D_DIE(insert, 114, 0x71169ed, 0xaf1169ed ,0x1 ,0xf5abe69a ,0xaef0= 9348 ) + TEST_D_DIDI(insert, 115, 0x8a228466, 0x8a2284e6 ,0x5 ,0x2c808a7f ,0x2 ) + TEST_D_DDII(insert, 116, 0xeffef7ec, 0xeffef7e8 ,0xaa92b4ce ,0x1 ,0x3 ) + TEST_D_DDE(insert, 117, 0x7948cba3, 0x818b7ba3 ,0x70bca465 ,0x47ede909= ,0xbf4f8afe ) + TEST_D_DDDI(insert, 118, 0x5e974875, 0x5b774875 ,0x27f33374 ,0x4b41713= 5 ,0x7 ) + TEST_D_DIDI(insn.t, 119, 0xcbbe860a, 0xcbbe860a ,0x4 ,0xd2f483d9 ,0x3 ) + TEST_E_ED(ixmax, 120, 0x48ef48f1 ,0x6e7e, 0x687e48ef ,0x9afdc6c8 ,0xbd= 066e7e ) + TEST_E_ED(ixmax.u, 121, 0xac97ac98 ,0xd968, 0x67b7ac96 ,0x55371874 ,0x= d968399e ) + TEST_E_ED(ixmin, 122, 0x957f9580 ,0xa9de, 0x8ed957e ,0x9519d426 ,0xa9d= e69e1 ) + TEST_E_ED(ixmin.u, 123, 0xde48de4a ,0x3660, 0x3dc4de48 ,0x1e5a559d ,0x= dbc53660 ) + TEST_D_DI(lt, 124, 0x1, 0xf156e5c0 ,0x40 ) + TEST_D_DD(lt, 125, 0x0, 0x51c83765 ,0x1aa7292 ) + TEST_D15_DI(lt, 126, 0x0, 0x31163fc9 ,0x5 ) + TEST_D15_DD(lt, 127, 0x1, 0xf9e43e50 ,0x22a3f8d5 ) + TEST_D_DD(lt.b, 128, 0xff0000, 0x4a374b04 ,0x4869ba92 ) + TEST_D_DD(lt.bu, 129, 0xff00, 0x4c5bb0c7 ,0x4c3bd2a3 ) + TEST_D_DD(lt.h, 130, 0xffff0000, 0x326e5bdc ,0x33e03761 ) + TEST_D_DD(lt.hu, 131, 0x0, 0xf53b8e9b ,0x53cc7810 ) + TEST_D_DI(lt.u, 132, 0x0, 0xf1f78a54 ,0x4d ) + TEST_D_DD(lt.u, 133, 0x1, 0x10fedada ,0x265af026 ) + TEST_D_DD(lt.w, 134, 0xffffffff, 0xbc8a0b22 ,0x3dd6d1a2 ) + TEST_D_DD(lt.wu, 135, 0x0, 0xcc92a312 ,0x133c8a9d ) =20 TEST_PASSFAIL --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807504744879.1525213226312; Wed, 27 Sep 2023 02:38:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyO-0000zP-6G; Wed, 27 Sep 2023 05:36:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyM-0000yX-G9 for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:46 -0400 Received: from doohan.uni-paderborn.de ([2001:638:502:c003::16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyK-0000nm-FZ for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=pgWWStEnT5TaoXfG+21I521mRJ3rDJ4ej/mgSWlwtKI=; b=ERaUyKSDK5a+yDxq/fHAiWnJOr yNA8yy5LtDIKmrNA7a82Gar528eG/aN0JzRLX4DnYrERtgpYaBRSN++cvg9MY/fkaGUWXAaUAcf16 R8lTfT+fJrtVoUWCFoa74rz+UyN3czrgTLmxlDIzplup2upK8rssnSj8yshULEErBZvI=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL 18/21] tests/tcg/tricore: Add test from 'max' to 'shas' Date: Wed, 27 Sep 2023 11:35:49 +0200 Message-ID: <20230927093552.493279-19-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: add header X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.26.602000 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::16; envelope-from=kbastian@mail.uni-paderborn.de; helo=doohan.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807506398100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-8-kbastian@mail.uni-paderborn.de> --- tests/tcg/tricore/asm/macros.h | 13 ++++ tests/tcg/tricore/asm/test_arith.S | 105 +++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) diff --git a/tests/tcg/tricore/asm/macros.h b/tests/tcg/tricore/asm/macros.h index 92f0f7b22b..5bba9dbbf6 100644 --- a/tests/tcg/tricore/asm/macros.h +++ b/tests/tcg/tricore/asm/macros.h @@ -143,6 +143,14 @@ test_ ## num: = \ insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, DREG_RS3, imm; \ ) =20 +#define TEST_D_ED(insn, num, result, rs1_lo, rs1_hi, rs2) \ + TEST_CASE(num, DREG_CALC_RESULT, result, \ + LI(EREG_RS1_LO, rs1_lo); \ + LI(EREG_RS1_HI, rs1_hi); \ + LI(DREG_RS2, rs2); \ + rstv; \ + insn DREG_CALC_RESULT, EREG_RS1, DREG_RS2; \ + ) =20 #define TEST_D_DDE(insn, num, result, rs1, rs2, rs3_lo, rs3_hi) \ TEST_CASE(num, DREG_CALC_RESULT, result, \ @@ -284,6 +292,11 @@ test_ ## num: = \ insn EREG_CALC_RESULT, EREG_RS1, DREG_RS2; \ ) =20 +#define TEST_E_I(insn, num, res_lo, res_hi, imm) \ + TEST_CASE_E(num, res_lo, res_hi, \ + insn EREG_CALC_RESULT, imm; \ + ) + #define TEST_E_IDI(insn, num, res_lo, res_hi, imm1, rs1, imm2) \ TEST_CASE_E(num, res_lo, res_hi, \ LI(DREG_RS1, rs1); \ diff --git a/tests/tcg/tricore/asm/test_arith.S b/tests/tcg/tricore/asm/tes= t_arith.S index 68b6715cb9..728509cfa9 100644 --- a/tests/tcg/tricore/asm/test_arith.S +++ b/tests/tcg/tricore/asm/test_arith.S @@ -137,5 +137,110 @@ _start: TEST_D_DD(lt.u, 133, 0x1, 0x10fedada ,0x265af026 ) TEST_D_DD(lt.w, 134, 0xffffffff, 0xbc8a0b22 ,0x3dd6d1a2 ) TEST_D_DD(lt.wu, 135, 0x0, 0xcc92a312 ,0x133c8a9d ) + TEST_D_DI(max, 136, 0xe0d4d31, 0xe0d4d31 ,0x58 ) + TEST_D_DD(max, 137, 0x787135d1, 0x787135d1 ,0x14c4da7b ) + TEST_D_DD(max.b, 138, 0x316b2c0f, 0x316bd4cb ,0x2b2c0f ) + TEST_D_DD(max.bu, 139, 0x5f88a94e, 0x4675a04e ,0x5f88a92b ) + TEST_D_DD(max.h, 140, 0x532f72fd, 0x532fad08 ,0x4b1272fd ) + TEST_D_DD(max.hu, 141, 0xeed88225, 0x116b7eea ,0xeed88225 ) + TEST_D_DI(max.u, 142, 0xf342d496, 0xf342d496 ,0x38 ) + TEST_D_DD(max.u, 143, 0xdd15066d, 0xdd15066d ,0xf556c66 ) + TEST_D_DI(min, 144, 0xdd, 0x731a9dec ,0xdd ) + TEST_D_DD(min, 145, 0x23ed2038, 0x2e3f1040 ,0x23ed2038 ) + TEST_D_DD(min.b, 146, 0xf1aba6b6, 0x26aba6b6 ,0xf17eb628 ) + TEST_D_DD(min.bu, 147, 0x3f500949, 0x8a500c52 ,0x3fe70949 ) + TEST_D_DD(min.h, 148, 0xad296b7, 0xe917617 ,0xad296b7 ) + TEST_D_DD(min.hu, 149, 0x859351e, 0xc6a351e ,0x8595c29 ) + TEST_D_DI(min.u, 150, 0x3, 0x8e14bfbf ,0x3 ) + TEST_D_DD(min.u, 151, 0x371cf628, 0x371cf628 ,0xe837ca8f ) + TEST_D_I(mov, 152, 0x391, 0x391 ) + TEST_E_I(mov, 153, 0x4612 ,0x0, 0x4612 ) + TEST_D_D(mov, 154, 0x57de4d85, 0x57de4d85 ) + TEST_E_D(mov, 155, 0x81fcfe47 ,0xffffffff, 0x81fcfe47 ) + TEST_E_DD(mov, 156, 0xa33b7b80 ,0x8a2a74b7, 0x8a2a74b7 ,0xa33b7b80 ) + TEST_D15_I(mov, 157, 0x3b, 0x3b ) + TEST_D_I(mov, 158, 0x2, 0x2 ) + TEST_E_I(mov, 159, 0x1 ,0x0, 0x1 ) + TEST_D_D(mov, 160, 0x1557688b, 0x1557688b ) + TEST_D_I(mov.u, 161, 0x502, 0x502 ) + TEST_D_I(movh, 162, 0x60ea0000, 0x60ea) + TEST_D_DI(nand, 163, 0xfffffffe, 0x291af609 ,0xd7 ) + TEST_D_DD(nand, 164, 0xfaffe4fe, 0x270e5faf ,0xcd613b01 ) + TEST_D_DIDI(nand.t, 165, 0x1, 0xe10d5151 ,0x1 ,0x84f18d6b ,0x7 ) + TEST_D_DI(ne, 166, 0x1, 0xed148b6 ,0x66 ) + TEST_D_DD(ne, 167, 0x1, 0x9b38284a ,0x25948edd ) + TEST_D_DI(nor, 168, 0x77f45c1a, 0x880ba324 ,0xe5 ) + TEST_D_DD(nor, 169, 0x2c8103c0, 0x93382c3f ,0x5266d42b ) + TEST_D_DIDI(nor.t, 170, 0x1, 0x3f964a10 ,0x7 ,0x54e26b8e ,0x3 ) + TEST_D_DI(or, 171, 0xbf29afdf, 0xbf29afd3 ,0x4e ) + TEST_D_DD(or, 172, 0xfbefe7cf, 0x2a896747 ,0xdb66a2ce ) + TEST_D15_I(or, 173, 0xb, 0xb ) + TEST_D_D(or, 174, 0x3ef404a0, 0x3ef404a0 ) + TEST_D_DIDI(or.and.t, 175, 0x1, 0x1e09424a ,0x3 ,0xe427b416 ,0x3 ) + TEST_D_DIDI(or.andn.t, 176, 0x0, 0x4a560efb ,0x1 ,0xf0596f84 ,0x3 ) + TEST_D_DI(or.eq, 177, 0x0, 0xee8c7017 ,0xcf ) + TEST_D_DD(or.eq, 178, 0x0, 0xc33e8cf0 ,0x139c3f75 ) + TEST_D_DI(or.ge, 179, 0x1, 0x4845ad04 ,0xf1 ) + TEST_D_DD(or.ge, 180, 0x1, 0x687040a1 ,0xf61bdd8c ) + TEST_D_DI(or.ge.u, 181, 0x1, 0x55edca06 ,0xa1 ) + TEST_D_DD(or.ge.u, 182, 0x0, 0x8c975e46 ,0xd26c95ea ) + TEST_D_DI(or.lt, 183, 0x1, 0xbcb87506 ,0x43 ) + TEST_D_DD(or.lt, 184, 0x0, 0x2c9ea431 ,0x1d1515 ) + TEST_D_DI(or.lt.u, 185, 0x0, 0x7bbfdf3b ,0xe7 ) + TEST_D_DD(or.lt.u, 186, 0x1, 0x2f71485e ,0xe9219409 ) + TEST_D_DI(or.ne, 187, 0x1, 0xc9b87ffc ,0x65 ) + TEST_D_DD(or.ne, 188, 0x1, 0xd5746862 ,0x72d5cbc1 ) + TEST_D_DIDI(or.nor.t, 189, 0x0, 0xa0d6cc1 ,0x7 ,0x38e6fc83 ,0x1 ) + TEST_D_DIDI(or.or.t, 190, 0x1, 0x85546ea7 ,0x4 ,0xffd58bc6 ,0x2 ) + TEST_D_DIDI(or.t, 191, 0x0, 0xd594ef27 ,0x3 ,0xdb878237 ,0x4 ) + TEST_D_DI(orn, 192, 0xffffffdf, 0xc8b4cb5d ,0x64 ) + TEST_D_DD(orn, 193, 0xf2ffd5eb, 0xe2ef556a ,0xaf6d3a3e ) + TEST_D_DIDI(orn.t, 194, 0x1, 0xb511c09 ,0x3 ,0x209bbd86 ,0x7 ) + TEST_D_ED(pack, 195, 0x803d04a8, 0x3d04a871 ,0x50637a2d ,0x86ec2f85 ) + TEST_D_D(parity, 196, 0x101, 0x6033fd4c ) + TEST_D_D(popcnt.w, 197, 0x15, 0xed7dcbc6 ) + TEST_D_DI(rsub, 198, 0x4ee91cd3, 0xb116e3bc ,0x8f ) + TEST_D_DI(rsubs, 199, 0x923eddd7, 0x6dc122fb ,0xd2 ) + TEST_D_DI(rsubs.u, 200, 0x0, 0xeea32363 ,0xae ) + TEST_D_D(sat.b, 201, 0xffffff80, 0x9933174e ) + TEST_D_D(sat.bu, 202, 0xff, 0x917808d7 ) + TEST_D_D(sat.h, 203, 0xffff8000, 0xa6d33749 ) + TEST_D_D(sat.hu, 204, 0xffff, 0x534af788 ) + TEST_D_DDI(sel, 205, 0x620aac73, 0xf617d4dc ,0x620aac73 ,0x53 ) + TEST_D_DDD(sel, 206, 0x133a028, 0xb8a3faae ,0x133a028 ,0x9042e62e ) + TEST_D_DDI(seln, 207, 0x8, 0x4a449741 ,0x5354950a ,0x8 ) + TEST_D_DDD(seln, 208, 0x4f8b1cda, 0x9e3173c3 ,0x4a6f65e9 ,0x4f8b1cda ) + TEST_D_DI(sh, 209, 0x97000000, 0x56ffbcb8 ,0xd5 ) + TEST_D_DD(sh, 210, 0x225, 0x112c2fff ,0x5f7f64ad ) + TEST_D_I(sh, 211, 0x0, 0x6 ) + TEST_D_DIDI(sh.and.t, 212, 0x1, 0xfba22cf9 ,0x5 ,0xfda859c ,0x6 ) + TEST_D_DIDI(sh.andn.t, 213, 0x1, 0xf22e1491 ,0x7 ,0x23ac3c36 ,0x3 ) + TEST_D_DI(sh.eq, 214, 0x0, 0xda3960 ,0x9d ) + TEST_D_DD(sh.eq, 215, 0x0, 0xf76d811e ,0x6eaa1a5e ) + TEST_D_DI(sh.ge, 216, 0x0, 0xbb006b34 ,0x4 ) + TEST_D_DD(sh.ge, 217, 0x0, 0xee02bc23 ,0xdaf2111 ) + TEST_D_DI(sh.ge.u, 218, 0x1, 0xc8909dce ,0x53 ) + TEST_D_DD(sh.ge.u, 219, 0x1, 0x5ebe1b63 ,0x2c380da6 ) + TEST_D_DI(sh.h, 220, 0x32002d00, 0x6032a92d ,0xc8 ) + TEST_D_DD(sh.h, 221, 0x780878, 0xc00fc10f ,0x670e07a3 ) + TEST_D_DI(sh.lt, 222, 0x1, 0xd55620a0 ,0x28 ) + TEST_D_DD(sh.lt, 223, 0x1, 0xbab4c4f8 ,0xd6b23303 ) + TEST_D_DI(sh.lt.u, 224, 0x0, 0x6d1e8ad ,0xbb ) + TEST_D_DD(sh.lt.u, 225, 0x1, 0xbdc4998 ,0x660a4b5f ) + TEST_D_DIDI(sh.nand.t, 226, 0x1, 0xfb3bb8d0 ,0x3 ,0x237800c5 ,0x3 ) + TEST_D_DI(sh.ne, 227, 0x1, 0x5e6bff56 ,0x83 ) + TEST_D_DD(sh.ne, 228, 0x1, 0x5f53e44b ,0x4aaa9437 ) + TEST_D_DIDI(sh.nor.t, 229, 0x0, 0x6ee37832 ,0x6 ,0x6296e652 ,0x5 ) + TEST_D_DIDI(sh.or.t, 230, 0x1, 0xc6079a4e ,0x6 ,0xa81b155a ,0x1 ) + TEST_D_DIDI(sh.orn.t, 231, 0x1, 0x188eb9ff ,0x6 ,0x35916e9 ,0x2 ) + TEST_D_DIDI(sh.xnor.t, 232, 0x1, 0x4babd924 ,0x1 ,0x6f28e657 ,0x6 ) + TEST_D_DIDI(sh.xor.t, 233, 0x0, 0x759dfc75 ,0x3 ,0xac541f56 ,0x3 ) + TEST_D_DI(sha, 234, 0xb69145c0, 0x62da4517 ,0x46 ) + TEST_D_DD(sha, 235, 0xccd8e400, 0x25333639 ,0xb4e65a0a ) + TEST_D_I(sha, 236, 0x0, 0x5 ) + TEST_D_DI(sha.h, 237, 0xf8404f80, 0x8fe1d53e ,0x6 ) + TEST_D_DD(sha.h, 238, 0x10006000, 0x84010b96 ,0xc20875ac ) + TEST_D_DI(shas, 239, 0x7fffffff, 0x539952ab ,0x1f ) + TEST_D_DD(shas, 240, 0x20b5a5, 0x416b4be8 ,0x11eb83b7 ) =20 TEST_PASSFAIL --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807485621898.9586232139825; Wed, 27 Sep 2023 02:38:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyP-0000zr-2V; Wed, 27 Sep 2023 05:36:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyN-0000z4-TS for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:47 -0400 Received: from nylar.uni-paderborn.de ([2001:638:502:c003::18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyM-0000o3-DG for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=9FzxQ660xnF7BoFssezDlWlw7/LTvj8icF1M+1lpFwA=; b=H1YJwFE6papDvQ3SoRW5TpaEx9 RWPZvp86s6IP2cVSjUDCMfCYLLbko6T9rZdW84lO5N3Ue/0gqmL60/AmcD5y3UG6ILHFkfDaq0++z qjU+6AQMNLPHD1FRQ6aYAEqy4Yy5TRzDMcGH76h/d/SPc3M2qQmTNH9yKHT9qxYEXVIY=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL 19/21] tests/tcg/tricore: Add test from 'shuffle' to 'xor.t' Date: Wed, 27 Sep 2023 11:35:50 +0200 Message-ID: <20230927093552.493279-20-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.93017, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.27.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=39, da=183416468, mc=16, sc=0, hc=16, sp=0, fso=39, re=0, sd=0, hd=0 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::18; envelope-from=kbastian@mail.uni-paderborn.de; helo=nylar.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807486468100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-9-kbastian@mail.uni-paderborn.de> --- tests/tcg/tricore/asm/test_arith.S | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/tcg/tricore/asm/test_arith.S b/tests/tcg/tricore/asm/tes= t_arith.S index 728509cfa9..02637f89f9 100644 --- a/tests/tcg/tricore/asm/test_arith.S +++ b/tests/tcg/tricore/asm/test_arith.S @@ -242,5 +242,39 @@ _start: TEST_D_DD(sha.h, 238, 0x10006000, 0x84010b96 ,0xc20875ac ) TEST_D_DI(shas, 239, 0x7fffffff, 0x539952ab ,0x1f ) TEST_D_DD(shas, 240, 0x20b5a5, 0x416b4be8 ,0x11eb83b7 ) + TEST_D_DI(shuffle, 241, 0xed28c9ed, 0x28e9edc9 ,0x71 ) + TEST_D_DD(sub, 242, 0x3806b676, 0x56f5e4bc ,0x1eef2e46 ) + TEST_D_D(sub, 243, 0xc98e16b7, 0x3671e949 ) + TEST_D_D15D(sub, 244, 0xf5bbbabd, 0x6a8db6c ,0x10ed20af ) + TEST_D15_DD(sub, 245, 0x5618f5a0, 0xa6342636 ,0x501b3096 ) + TEST_D_DD(sub.b, 246, 0x9ced6d25, 0x28dbb9ee ,0x8cee4cc9 ) + TEST_D_DD(sub.h, 247, 0xc80b12d0, 0xbe0897d3 ,0xf5fd8503 ) + TEST_D_DD(subc, 248, 0xbeeccedb, 0x2164d45a ,0x6278057e ) + TEST_D_DD(subs, 249, 0x90d370bc, 0x95060d13 ,0x4329c57 ) + TEST_D_D(subs, 250, 0xd89c4149, 0x2763beb7 ) + TEST_D_DD(subs.h, 251, 0xad93dfea, 0x2c97e0d1 ,0x7f0400e7 ) + TEST_D_DD(subs.hu, 252, 0x33f6, 0xa768372d ,0xc80b0337 ) + TEST_D_DD(subs.u, 253, 0x0, 0x7084c694 ,0x90c2f594 ) + TEST_D_DD(subx, 254, 0xd19a2948, 0x7c40dcf9 ,0xaaa6b3b1 ) + TEST_E_D(unpack, 255, 0x6405b000 ,0xffffffa5, 0x12480b60 ) + TEST_D_DI(xnor, 256, 0x83b45e8d, 0x7c4ba167 ,0x15 ) + TEST_D_DD(xnor, 257, 0x6808b995, 0x2fdb8402 ,0xb82cc268 ) + TEST_D_DIDI(xnor.t, 258, 0x1, 0x490ac395 ,0x6 ,0x6c41105b ,0x6 ) + TEST_D_DI(xor, 259, 0x2f27c804, 0x2f27c860 ,0x64 ) + TEST_D_DD(xor, 260, 0xa020af5b, 0x67f62bea ,0xc7d684b1 ) + TEST_D_D(xor, 261, 0xbc28874, 0xbc28874 ) + TEST_D_DI(xor.eq, 262, 0x0, 0xee9e03cc ,0x7b ) + TEST_D_DD(xor.eq, 263, 0x0, 0x74f79928 ,0x2d3ec476 ) + TEST_D_DI(xor.ge, 264, 0x0, 0xcf2296f1 ,0xf0 ) + TEST_D_DD(xor.ge, 265, 0x0, 0xf9915543 ,0x20cb6ab7 ) + TEST_D_DI(xor.ge.u, 266, 0x1, 0xaa8a78f6 ,0xce ) + TEST_D_DD(xor.ge.u, 267, 0x0, 0x94e9f87 ,0xab43f3ce ) + TEST_D_DI(xor.lt, 268, 0x0, 0x3412e315 ,0xcb ) + TEST_D_DD(xor.lt, 269, 0x1, 0x5571b703 ,0x6a9008a3 ) + TEST_D_DI(xor.lt.u, 270, 0x0, 0x66a0a3c0 ,0xe1 ) + TEST_D_DD(xor.lt.u, 271, 0x0, 0xa66deb02 ,0x7dd7b425 ) + TEST_D_DI(xor.ne, 272, 0x1, 0x147b3e3a ,0xfa ) + TEST_D_DD(xor.ne, 273, 0x1, 0x92147ec0 ,0xa697f601 ) + TEST_D_DIDI(xor.t, 274, 0x0, 0xed9ea075 ,0x7 ,0x13f5d03c ,0x7 ) =20 TEST_PASSFAIL --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807447053492.4741886954247; Wed, 27 Sep 2023 02:37:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyS-00010Z-0e; Wed, 27 Sep 2023 05:36:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyQ-00010I-Gr for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:50 -0400 Received: from doohan.uni-paderborn.de ([2001:638:502:c003::16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyO-0000oO-P2 for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=hMkyUXVp8h2jJ4GZTi4/xUA13br3tMc4WAUG2xhP9sM=; b=BL5gvT76elyZRjcAN/Z9oOA5rt Y7P1eySyoSrREa8I4yJJBOmI5rPUXDJQkuTQEXdRdaqNiIEKPH7fePuja7CGJ8OBhhS+6J4Q+Ry/A wIgIFT0CdqyLHnMKh7GjKxK6eHy2ZPILEN4RdRGEXKUXwmn8KeLuCp8JwbJmPxCDiujs=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL 20/21] target/tricore: Remove CSFRs from cpu.h Date: Wed, 27 Sep 2023 11:35:51 +0200 Message-ID: <20230927093552.493279-21-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.92417, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.26.602000 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::16; envelope-from=kbastian@mail.uni-paderborn.de; helo=doohan.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807451793100007 Content-Type: text/plain; charset="utf-8" these are already defined in 'csfr.h.inc'. We don't need to duplicate these registers. Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-10-kbastian@mail.uni-paderborn.de> --- target/tricore/cpu.h | 143 +++---------------------------------------- 1 file changed, 9 insertions(+), 134 deletions(-) diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index 3708405be8..1cace96b01 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -30,150 +30,25 @@ typedef struct CPUArchState { /* GPR Register */ uint32_t gpr_a[16]; uint32_t gpr_d[16]; - /* CSFR Register */ - uint32_t PCXI; /* Frequently accessed PSW_USB bits are stored separately for efficiency. This contains all the other bits. Use psw_{read,write} to access the whole PSW. */ uint32_t PSW; - - /* PSW flag cache for faster execution - */ + /* PSW flag cache for faster execution */ uint32_t PSW_USB_C; uint32_t PSW_USB_V; /* Only if bit 31 set, then flag is set */ uint32_t PSW_USB_SV; /* Only if bit 31 set, then flag is set */ uint32_t PSW_USB_AV; /* Only if bit 31 set, then flag is set. */ uint32_t PSW_USB_SAV; /* Only if bit 31 set, then flag is set. */ =20 - uint32_t PC; - uint32_t SYSCON; - uint32_t CPU_ID; - uint32_t CORE_ID; - uint32_t BIV; - uint32_t BTV; - uint32_t ISP; - uint32_t ICR; - uint32_t FCX; - uint32_t LCX; - uint32_t COMPAT; - - /* Mem Protection Register */ - uint32_t DPR0_0L; - uint32_t DPR0_0U; - uint32_t DPR0_1L; - uint32_t DPR0_1U; - uint32_t DPR0_2L; - uint32_t DPR0_2U; - uint32_t DPR0_3L; - uint32_t DPR0_3U; - - uint32_t DPR1_0L; - uint32_t DPR1_0U; - uint32_t DPR1_1L; - uint32_t DPR1_1U; - uint32_t DPR1_2L; - uint32_t DPR1_2U; - uint32_t DPR1_3L; - uint32_t DPR1_3U; - - uint32_t DPR2_0L; - uint32_t DPR2_0U; - uint32_t DPR2_1L; - uint32_t DPR2_1U; - uint32_t DPR2_2L; - uint32_t DPR2_2U; - uint32_t DPR2_3L; - uint32_t DPR2_3U; - - uint32_t DPR3_0L; - uint32_t DPR3_0U; - uint32_t DPR3_1L; - uint32_t DPR3_1U; - uint32_t DPR3_2L; - uint32_t DPR3_2U; - uint32_t DPR3_3L; - uint32_t DPR3_3U; - - uint32_t CPR0_0L; - uint32_t CPR0_0U; - uint32_t CPR0_1L; - uint32_t CPR0_1U; - uint32_t CPR0_2L; - uint32_t CPR0_2U; - uint32_t CPR0_3L; - uint32_t CPR0_3U; - - uint32_t CPR1_0L; - uint32_t CPR1_0U; - uint32_t CPR1_1L; - uint32_t CPR1_1U; - uint32_t CPR1_2L; - uint32_t CPR1_2U; - uint32_t CPR1_3L; - uint32_t CPR1_3U; - - uint32_t CPR2_0L; - uint32_t CPR2_0U; - uint32_t CPR2_1L; - uint32_t CPR2_1U; - uint32_t CPR2_2L; - uint32_t CPR2_2U; - uint32_t CPR2_3L; - uint32_t CPR2_3U; - - uint32_t CPR3_0L; - uint32_t CPR3_0U; - uint32_t CPR3_1L; - uint32_t CPR3_1U; - uint32_t CPR3_2L; - uint32_t CPR3_2U; - uint32_t CPR3_3L; - uint32_t CPR3_3U; - - uint32_t DPM0; - uint32_t DPM1; - uint32_t DPM2; - uint32_t DPM3; - - uint32_t CPM0; - uint32_t CPM1; - uint32_t CPM2; - uint32_t CPM3; - - /* Memory Management Registers */ - uint32_t MMU_CON; - uint32_t MMU_ASI; - uint32_t MMU_TVA; - uint32_t MMU_TPA; - uint32_t MMU_TPX; - uint32_t MMU_TFA; - /* {1.3.1 only */ - uint32_t BMACON; - uint32_t SMACON; - uint32_t DIEAR; - uint32_t DIETR; - uint32_t CCDIER; - uint32_t MIECON; - uint32_t PIEAR; - uint32_t PIETR; - uint32_t CCPIER; - /*} */ - /* Debug Registers */ - uint32_t DBGSR; - uint32_t EXEVT; - uint32_t CREVT; - uint32_t SWEVT; - uint32_t TR0EVT; - uint32_t TR1EVT; - uint32_t DMS; - uint32_t DCX; - uint32_t DBGTCR; - uint32_t CCTRL; - uint32_t CCNT; - uint32_t ICNT; - uint32_t M1CNT; - uint32_t M2CNT; - uint32_t M3CNT; +#define R(ADDR, NAME, FEATURE) uint32_t NAME; +#define A(ADDR, NAME, FEATURE) uint32_t NAME; +#define E(ADDR, NAME, FEATURE) uint32_t NAME; +#include "csfr.h.inc" +#undef R +#undef A +#undef E + /* Floating Point Registers */ float_status fp_status; =20 --=20 2.42.0 From nobody Tue May 21 14:11:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.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 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1695807494533801.1812356854874; Wed, 27 Sep 2023 02:38:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlQyT-00011B-OC; Wed, 27 Sep 2023 05:36:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyS-00010a-0E for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:52 -0400 Received: from nylar.uni-paderborn.de ([2001:638:502:c003::18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlQyQ-0000ow-FR for qemu-devel@nongnu.org; Wed, 27 Sep 2023 05:36:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=edtXR816u45JZWfizGurdb1dDkx8u9mYVgXLFCS83yg=; b=MiUGUT22v3r7hqt1wlhHjoHI7I kwnGyHSyks1b9pWCX55lYUdE5RHzkReh7fQKOmA/u3ctD/IGRaIAVJBu5QGde6i9MhXUxridqVVNT 43pZ6UMiP2jHVOdtt4ui7LtuBR99MZp2wYLPOBbCmzt/58Gv6AY9Qsly7pa13iaY9Jmg=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL 21/21] target/tricore: Change effective address (ea) to target_ulong Date: Wed, 27 Sep 2023 11:35:52 +0200 Message-ID: <20230927093552.493279-22-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> References: <20230927093552.493279-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-spamd-action: add header X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.27.93017, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.27.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=44, da=183416473, mc=18, sc=0, hc=18, sp=0, fso=44, re=0, sd=0, hd=0 X-IMT-Source: Intern X-IMT-Spam-Score: 0.0 () X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:638:502:c003::18; envelope-from=kbastian@mail.uni-paderborn.de; helo=nylar.uni-paderborn.de X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1695807496547100003 Content-Type: text/plain; charset="utf-8" as this is an effective address and those cannot be signed, it should not be a signed integer. Signed-off-by: Bastian Koppelmann Message-ID: <20230913105326.40832-11-kbastian@mail.uni-paderborn.de> --- target/tricore/op_helper.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c index 0cf8eb50bd..ba9c4444b3 100644 --- a/target/tricore/op_helper.c +++ b/target/tricore/op_helper.c @@ -2458,7 +2458,7 @@ static bool cdc_zero(target_ulong *psw) return count =3D=3D 0; } =20 -static void save_context_upper(CPUTriCoreState *env, int ea) +static void save_context_upper(CPUTriCoreState *env, target_ulong ea) { cpu_stl_data(env, ea, env->PCXI); cpu_stl_data(env, ea+4, psw_read(env)); @@ -2478,7 +2478,7 @@ static void save_context_upper(CPUTriCoreState *env, = int ea) cpu_stl_data(env, ea+60, env->gpr_d[15]); } =20 -static void save_context_lower(CPUTriCoreState *env, int ea) +static void save_context_lower(CPUTriCoreState *env, target_ulong ea) { cpu_stl_data(env, ea, env->PCXI); cpu_stl_data(env, ea+4, env->gpr_a[11]); @@ -2498,7 +2498,7 @@ static void save_context_lower(CPUTriCoreState *env, = int ea) cpu_stl_data(env, ea+60, env->gpr_d[7]); } =20 -static void restore_context_upper(CPUTriCoreState *env, int ea, +static void restore_context_upper(CPUTriCoreState *env, target_ulong ea, target_ulong *new_PCXI, target_ulong *ne= w_PSW) { *new_PCXI =3D cpu_ldl_data(env, ea); @@ -2519,7 +2519,7 @@ static void restore_context_upper(CPUTriCoreState *en= v, int ea, env->gpr_d[15] =3D cpu_ldl_data(env, ea+60); } =20 -static void restore_context_lower(CPUTriCoreState *env, int ea, +static void restore_context_lower(CPUTriCoreState *env, target_ulong ea, target_ulong *ra, target_ulong *pcxi) { *pcxi =3D cpu_ldl_data(env, ea); @@ -2763,26 +2763,26 @@ void helper_rfm(CPUTriCoreState *env) } } =20 -void helper_ldlcx(CPUTriCoreState *env, uint32_t ea) +void helper_ldlcx(CPUTriCoreState *env, target_ulong ea) { uint32_t dummy; /* insn doesn't load PCXI and RA */ restore_context_lower(env, ea, &dummy, &dummy); } =20 -void helper_lducx(CPUTriCoreState *env, uint32_t ea) +void helper_lducx(CPUTriCoreState *env, target_ulong ea) { uint32_t dummy; /* insn doesn't load PCXI and PSW */ restore_context_upper(env, ea, &dummy, &dummy); } =20 -void helper_stlcx(CPUTriCoreState *env, uint32_t ea) +void helper_stlcx(CPUTriCoreState *env, target_ulong ea) { save_context_lower(env, ea); } =20 -void helper_stucx(CPUTriCoreState *env, uint32_t ea) +void helper_stucx(CPUTriCoreState *env, target_ulong ea) { save_context_upper(env, ea); } --=20 2.42.0