From patchwork Thu Sep 28 08:52:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56373CE7B0C for ; Thu, 28 Sep 2023 08:54:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmlz-0006Vw-Lu; Thu, 28 Sep 2023 04:53:28 -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 1qlmlw-0006Vi-7p for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:24 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmlr-0004v3-Cz for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:23 -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=NYwF6/XYtJlAu7JdkDgt/H5kuE MgOtyI35ov5RHDDY1FjWciCA+vHgdlt1IKN3yQGjGMw2VfClCd+E3SvWjRm365wzkw3gp9U4Lob3y KiqY8/g88oMD67/WqUkJbAYgrWJ2yW/sMszngPC0oF6WeiAwIa1Pxkue7x3XxM7imUY4=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL v2 01/21] tests/tcg/tricore: Bump cpu to tc37x Date: Thu, 28 Sep 2023 10:52:43 +0200 Message-ID: <20230928085303.511518-2-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 += test_muls.asm.tst TESTS += test_boot_to_main.c.tst TESTS += test_context_save_areas.c.tst -QEMU_OPTS += -M tricore_testboard -cpu tc27x -nographic -kernel +QEMU_OPTS += -M tricore_testboard -cpu tc37x -nographic -kernel %.pS: $(ASM_TESTS_PATH)/%.S $(CC) -E -o $@ $< From patchwork Thu Sep 28 08:52:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402304 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0BDACE7B0C for ; Thu, 28 Sep 2023 08:54:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmm0-0006Wt-OS; Thu, 28 Sep 2023 04:53:28 -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 1qlmlx-0006Vu-JR for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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 1qlmlu-0004vB-2p for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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=5I3hxpXIo/Aj9WtZLitXsFXjv/wDHOVI3zcJt8ymVSQ=; b=Kv/6qw79kCtTIX5X1TOuh7s07F oGnRzdNuwfTTJsrv+Q4MufjbhHcTNWfWjVITwO8jFggtH11ENGLVA7gCGlwzOFYfeLIUOiHZ7eUsD B9GY54NHxsOIbIFJRIS061uWz/w8a5C2k/e3QJSbOXlnA9YuRskfuvFM0RXyfrkak2U4=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL v2 02/21] target/tricore: Implement CRCN insn Date: Thu, 28 Sep 2023 10:52:44 +0200 Message-ID: <20230928085303.511518-3-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.28.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=83833, da=183500262, mc=21, sc=0, hc=21, sp=0, fso=83833, 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 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 arg1) return crc32(arg1, buf, 4); } +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 = data << n; + for (i = 0; i < m; i++) { + if (crc_in & (1u << (n - 1))) { + crc_in <<= 1; + if (data & (1u << (m - 1))) { + crc_in++; + } + crc_in ^= gen; + } else { + crc_in <<= 1; + if (data & (1u << (m - 1))) { + crc_in++; + } + } + data <<= 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 = extract32(arg0, 12, 4) + 1; + uint32_t gen = extract32(arg0, 16, n); + uint32_t inv = extract32(arg0, 9, 1); + uint32_t le = extract32(arg0, 8, 1); + uint32_t m = extract32(arg0, 0, 3) + 1; + uint32_t data = extract32(arg1, 0, m); + uint32_t seed = extract32(arg2, 0, n); + + if (le == 1) { + if (m == 0) { + data = 0; + } else { + data = revbit32(data) >> (32 - m); + } + } + + if (inv == 1) { + seed = ~seed; + } + + if (m > n) { + crc_in = (data >> (m - n)) ^ seed; + } else { + crc_in = (data << (n - m)) ^ seed; + } + + crc_out = crc_div(crc_in, data, gen, n, m); + + if (inv) { + crc_out = ~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[r3]); break; diff --git a/target/tricore/tricore-opcodes.h b/target/tricore/tricore-opcodes.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 = 0x03, OPC2_32_RRR_MADD_F = 0x06, OPC2_32_RRR_MSUB_F = 0x07, + OPC2_32_RRR_CRCN = 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 = -mtc162 -c -I$(TESTS_PATH) TESTS += test_abs.asm.tst TESTS += test_bmerge.asm.tst TESTS += test_clz.asm.tst +TESTS += test_crcn.asm.tst TESTS += test_dextr.asm.tst TESTS += test_dvstep.asm.tst TESTS += 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 From patchwork Thu Sep 28 08:52:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02248CE7B0E for ; Thu, 28 Sep 2023 08:54:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmm1-0006XD-OD; Thu, 28 Sep 2023 04:53:29 -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 1qlmlx-0006Vv-MF for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:27 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmlu-0004vF-Gu for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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=0ZVKuipTJZZwnR/JF/GcM77eIVDauUJCXY9qIu7SUNg=; b=KbD59UfhxvzhqrtMBH5+6DUlEP fns+Jc2uXCP2NVYTOxYfRN5CsZxAPMxn/9f8yNeavnnvBrCeUwL6X7C/N8Gb5NbVqmhPmqxhgYv1G 5gEinOYko4/hob1EgQqatW2GWwZnnbff8Fgi+0zOHc6nVlC1xcSj9APdehJlkjn86CUQ=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL v2 03/21] target/tricore: Correctly handle FPU RM from PSW Date: Thu, 28 Sep 2023 10:52:45 +0200 Message-ID: <20230928085303.511518-4-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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) 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 &= 0x6ffffff; + env->PSW &= 0x7ffffff; /* now set them from the cache */ env->PSW |= ((env->PSW_USB_C != 0) << 31); env->PSW |= ((env->PSW_USB_V & (1 << 31)) >> 1); From patchwork Thu Sep 28 08:52:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17D20CE7B0E for ; Thu, 28 Sep 2023 08:57:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmm3-0006Y3-7z; Thu, 28 Sep 2023 04:53: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 1qlmly-0006W2-Gn for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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 1qlmlw-0004ve-Le for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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=ztyiR4O7yUKNMu62qAC5I6VE6EL6Xn2CyTtUB4FAoRc=; b=gc+P9yVkv3OyzpL1bcKJBXgq1s hHtOeaXM6meYmga67jSGu4XPLiWS9YTnCGADLaNEYdA85gk/Xd3smHPrSYSSqIz8RNCOe+lqoEcXy FtufgzfuRqygxpQuPjZXCsnqsftRq4ASrNeDbTCpjbwUDdy3RvNIsAJpB3eobG8oEIq4=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL v2 04/21] target/tricore: Implement FTOU insn Date: Thu, 28 Sep 2023 10:52:46 +0200 Message-ID: <20230928085303.511518-5-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.28.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=83838, da=183500267, mc=23, sc=0, hc=23, sp=0, fso=83838, 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 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 arg) return result; } +uint32_t helper_ftou(CPUTriCoreState *env, uint32_t arg) +{ + float32 f_arg = make_float32(arg); + uint32_t result; + int32_t flags = 0; + + result = float32_to_uint32(f_arg, &env->fp_status); + + flags = f_get_excp_flags(env); + if (flags & float_flag_invalid) { + flags &= ~float_flag_inexact; + if (float32_is_any_nan(f_arg)) { + result = 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 = float_flag_invalid; + result = 0; + } + + if (flags) { + f_update_psw_flags(env, flags); + } else { + env->FPU_FS = 0; + } + return result; +} + uint32_t helper_ftouz(CPUTriCoreState *env, uint32_t arg) { float32 f_arg = 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 += test_dvstep.asm.tst TESTS += test_fadd.asm.tst TESTS += test_fmul.asm.tst TESTS += test_ftoi.asm.tst +TESTS += test_ftou.asm.tst TESTS += test_imask.asm.tst TESTS += test_insert.asm.tst TESTS += 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 + From patchwork Thu Sep 28 08:52:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402320 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C757CE7B0E for ; Thu, 28 Sep 2023 08:57:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmm3-0006YN-Qm; Thu, 28 Sep 2023 04:53: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 1qlmm0-0006Wk-7A for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:28 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmly-0004xG-NH for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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=XlhIZu2wG5GEm8bOpyij8zG6k/JHGKk+P3CD/Q1HBjc=; b=LMN1ACBWvQlu2ND3jc5H8fjv7q 5uBdNQBG6hnfbTMWYDaHqI63WGYDoOrJtXqM3U4JolqhAM5KWqW5EEhes9u9MCQCHWxKE8IW6FeAD 2Zzul8F+a+vFLN/9AJcfhCFC7D7CYcGQhWEIiJ9woqu6CNxOWUjpe2NdSkh2f+XN01EY=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL v2 05/21] target/tricore: Clarify special case for FTOUZ insn Date: Thu, 28 Sep 2023 10:52:47 +0200 Message-ID: <20230928085303.511518-6-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 arg) if (float32_is_any_nan(f_arg)) { result = 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 = float_flag_invalid; result = 0; From patchwork Thu Sep 28 08:52:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402316 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5FA1CCE7B0E for ; Thu, 28 Sep 2023 08:57:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmm5-0006Yc-Ar; Thu, 28 Sep 2023 04:53:33 -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 1qlmm3-0006Y6-8n for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:31 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmm1-0004xi-57 for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:30 -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=ifyL1hUwguGTpBI/qWClqJ3W0W yYtal+aVq8CP60ZLEk0YYiZv8isBugbhIimut8in44o9m0Nd1KM4PYPCqfz0oPLHGmjATiWvF+3K1 sJVTVHk8FAc8FSKcBkR/0reHGXcOZV+PsZCkm6E6MXFCAaZz371pJ20GeZ7n7oM/sIVY=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL v2 06/21] target/tricore: Implement ftohp insn Date: Thu, 28 Sep 2023 10:52:48 +0200 Message-ID: <20230928085303.511518-7-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 arg) return (uint32_t)result; } +uint32_t helper_ftohp(CPUTriCoreState *env, uint32_t arg) +{ + float32 f_arg = make_float32(arg); + uint32_t result = 0; + int32_t flags = 0; + + /* + * if we have any NAN we need to move the top 2 and lower 8 input mantissa + * 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 |= float_flag_invalid; + } + result = float16_set_sign(result, arg >> 31); + result = deposit32(result, 10, 5, 0x1f); + result = deposit32(result, 8, 2, extract32(arg, 21, 2)); + result = deposit32(result, 0, 8, extract32(arg, 0, 8)); + if (extract32(result, 0, 10) == 0) { + result |= (1 << 8); + } + } else { + set_flush_to_zero(0, &env->fp_status); + result = float32_to_float16(f_arg, true, &env->fp_status); + set_flush_to_zero(1, &env->fp_status); + flags = f_get_excp_flags(env); + } + + if (flags) { + f_update_psw_flags(env, flags); + } else { + env->FPU_FS = 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) 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_status); set_default_nan_mode(1, &env->fp_status); } 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[r2]); 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[r2]); break; diff --git a/target/tricore/tricore-opcodes.h b/target/tricore/tricore-opcodes.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 = 0x14, OPC2_32_RR_CMP_F = 0x00, OPC2_32_RR_FTOIZ = 0x13, + OPC2_32_RR_FTOHP = 0x25, /* 1.6.2 only */ OPC2_32_RR_FTOQ31 = 0x11, OPC2_32_RR_FTOQ31Z = 0x18, OPC2_32_RR_FTOU = 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 += test_dextr.asm.tst TESTS += test_dvstep.asm.tst TESTS += test_fadd.asm.tst TESTS += test_fmul.asm.tst +TESTS += test_ftohp.asm.tst TESTS += test_ftoi.asm.tst TESTS += test_ftou.asm.tst TESTS += test_imask.asm.tst diff --git a/tests/tcg/tricore/asm/test_ftohp.S b/tests/tcg/tricore/asm/test_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 + From patchwork Thu Sep 28 08:52:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A3740CE7B0E for ; Thu, 28 Sep 2023 08:57:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmm7-0006ZB-U1; Thu, 28 Sep 2023 04:53:35 -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 1qlmm6-0006Ye-4r for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:34 -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 1qlmm4-0004y8-At for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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=7ddeiyD+Rt2vokEnGfPawfSGkhNaO2A0xv/Yktxt3n4=; b=e9NYW6RK9hnWWgn9jkuQDL1T71 Y8OaKj9tMMetS2E81NSvNqYuQch/VfLjUp5+lYAxsZM5hAFXcTjg4Pk0WEcN0B5uKJ1gynE6gNlDi Q9/pqiE4Paffw74J6Fr7COBodmO9Adgtb+9ZlagtVEPQUKRJKqhHlchN3GyrBGA7doLY=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL v2 07/21] target/tricore: Implement hptof insn Date: Thu, 28 Sep 2023 10:52:49 +0200 Message-ID: <20230928085303.511518-8-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.28.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=83844, da=183500273, mc=25, sc=0, hc=25, sp=0, fso=83844, 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 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 arg) return (uint32_t)result; } +uint32_t helper_hptof(CPUTriCoreState *env, uint32_t arg) +{ + float16 f_arg = make_float16(arg); + uint32_t result = 0; + int32_t flags = 0; + + /* + * if we have any NAN we need to move the top 2 and lower 8 input mantissa + * 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 |= float_flag_invalid; + } + result = 0; + result = float32_set_sign(result, f_arg >> 15); + result = deposit32(result, 23, 8, 0xff); + result = deposit32(result, 21, 2, extract32(f_arg, 8, 2)); + result = deposit32(result, 0, 8, extract32(f_arg, 0, 8)); + } else { + set_flush_inputs_to_zero(0, &env->fp_status); + result = float16_to_float32(f_arg, true, &env->fp_status); + set_flush_inputs_to_zero(1, &env->fp_status); + flags = f_get_excp_flags(env); + } + + if (flags) { + f_update_psw_flags(env, flags); + } else { + env->FPU_FS = 0; + } + + return result; +} + uint32_t helper_ftohp(CPUTriCoreState *env, uint32_t arg) { float32 f_arg = 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[r2]); break; diff --git a/target/tricore/tricore-opcodes.h b/target/tricore/tricore-opcodes.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 = 0x00, OPC2_32_RR_FTOIZ = 0x13, OPC2_32_RR_FTOHP = 0x25, /* 1.6.2 only */ + OPC2_32_RR_HPTOF = 0x24, /* 1.6.2 only */ OPC2_32_RR_FTOQ31 = 0x11, OPC2_32_RR_FTOQ31Z = 0x18, OPC2_32_RR_FTOU = 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 += test_fmul.asm.tst TESTS += test_ftohp.asm.tst TESTS += test_ftoi.asm.tst TESTS += test_ftou.asm.tst +TESTS += test_hptof.asm.tst TESTS += test_imask.asm.tst TESTS += test_insert.asm.tst TESTS += test_ld_bu.asm.tst diff --git a/tests/tcg/tricore/asm/test_hptof.S b/tests/tcg/tricore/asm/test_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 + From patchwork Thu Sep 28 08:52:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402318 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82888CE7B0C for ; Thu, 28 Sep 2023 08:57:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmm8-0006ZQ-Eu; Thu, 28 Sep 2023 04:53:36 -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 1qlmm6-0006Yq-Vi for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:34 -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 1qlmm5-0004yG-4x for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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: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=qJeJxVP49HVzmDMhU54JiknRtq cBU7og8mQ3FM3pOyI1JKmO4xD8sqbLICVbzSThM2BCVQej6rl9MPrA+4pumCl6rkoAHsHOl9enU7+ R7mKxpsOURna8EjZm221/fWhHOEPPtGWypMJ3QTNT3oYEGxFcGiHeNK+ylM+kI2blOlY=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL v2 08/21] target/tricore: Fix RCPW/RRPW_INSERT insns for width = 0 Date: Thu, 28 Sep 2023 10:52:50 +0200 Message-ID: <20230928085303.511518-9-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.28.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=83846, da=183500275, mc=27, sc=0, hc=27, sp=0, fso=83846, 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 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org we would crash if width was 0 for these insns, as tcg_gen_deposit() is undefined for that case. For TriCore, width = 0 is a mov from the src reg to the dst reg, so we special case this here. Reviewed-by: Philippe Mathieu-Daudé 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 = 0 */ + if (width == 0) { + tcg_gen_mov_tl(cpu_gpr_d[r2], cpu_gpr_d[r1]); /* if pos + width > 32 undefined result */ - if (pos + width <= 32) { + } else if (pos + width <= 32) { temp = tcg_constant_i32(const4); tcg_gen_deposit_tl(cpu_gpr_d[r2], cpu_gpr_d[r1], temp, pos, width); } @@ -6571,7 +6574,10 @@ static void decode_rrpw_extract_insert(DisasContext *ctx) break; case OPC2_32_RRPW_INSERT: - if (pos + width <= 32) { + /* tcg_gen_deposit_tl() does not handle the case of width = 0 */ + if (width == 0) { + tcg_gen_mov_tl(cpu_gpr_d[r3], cpu_gpr_d[r1]); + } else if (pos + width <= 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; \ ) +#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/test_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) +# 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 From patchwork Thu Sep 28 08:52:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402308 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2AB0CCE7B0C for ; Thu, 28 Sep 2023 08:55:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmB-0006a8-3o; Thu, 28 Sep 2023 04:53: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 1qlmm9-0006Zg-W3 for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:38 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmm7-0004yV-CN for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:37 -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=Ohw6zej8DzmpMGvPqOCLnwRvYC 6GhySQIeZNhj45QNlWbN39jmiJVhxdg7STO94SQ5Z3DzRmlLvRLLqkQHnuOiAqEVvEIgJNt/AlhPt 0X/78RicLXTuWsJkdXmUAyUiaVuAM3XEWYSJI4W3Ff1oUFdVlM1FzdioJ09GAOfyGYHo=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL v2 09/21] target/tricore: Swap src and dst reg for RCRR_INSERT Date: Thu, 28 Sep 2023 10:52:51 +0200 Message-ID: <20230928085303.511518-10-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 = tcg_temp_new(); /* width*/ temp3 = tcg_temp_new(); /* pos */ - CHECK_REG_PAIR(r3); + CHECK_REG_PAIR(r2); - 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); - 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; \ ) +#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/test_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) +# insn num result rs1 imm1 rs2_h rs2_l +# | | | | | | | + TEST_D_DIE(insert, 5, 0xe30c308d, 0xe30c308d ,0x3 , 0x00000000 ,0x00000000) + TEST_D_DIE(insert, 6, 0x669b0120, 0x669b2820 ,0x2 , 0x5530a1c7 ,0x3a2b0f67) + TEST_PASSFAIL From patchwork Thu Sep 28 08:52:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B5F4BCE7B0E for ; Thu, 28 Sep 2023 08:54:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmD-0006an-M9; Thu, 28 Sep 2023 04:53: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 1qlmmC-0006aQ-1v for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:40 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmmA-0004yn-Hc for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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=BW2JthvgwEqvznp0bOAz776apq7KePSWI1Irh0UoOYU=; b=CSaOZPcBkOKyrcErETIKW2q+GS tybQts2PdGbi+zhW7DYKRd52kXN2/6y3ih/xiNdsxeqOPSwdwv2neyLWKfURmAoA7q83Fj8IyQTrK hetPkwkhwpFkuSFJZBtouewjimqAQMshSDhvhiAx7ymEXJ7SEiwZiNIe5/+o9EtVKIe0=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL v2 10/21] target/tricore: Replace cpu_*_code with translator_* Date: Thu, 28 Sep 2023 10:52:52 +0200 Message-ID: <20230928085303.511518-11-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.28.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=83850, da=183500279, mc=29, sc=0, hc=29, sp=0, fso=83850, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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, DisasContext *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 = cpu_lduw_code(env, ctx->base.pc_next); + uint16_t insn = translator_lduw(env, &ctx->base, ctx->base.pc_next); return !tricore_insn_is_16bit(insn); } @@ -8411,14 +8411,15 @@ static void tricore_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) uint16_t insn_lo; bool is_16bit; - insn_lo = cpu_lduw_code(env, ctx->base.pc_next); + insn_lo = translator_lduw(env, &ctx->base, ctx->base.pc_next); is_16bit = tricore_insn_is_16bit(insn_lo); if (is_16bit) { ctx->opcode = insn_lo; ctx->pc_succ_insn = ctx->base.pc_next + 2; decode_16Bit_opc(ctx); } else { - uint32_t insn_hi = cpu_lduw_code(env, ctx->base.pc_next + 2); + uint32_t insn_hi = translator_lduw(env, &ctx->base, + ctx->base.pc_next + 2); ctx->opcode = insn_hi << 16 | insn_lo; ctx->pc_succ_insn = ctx->base.pc_next + 4; decode_32Bit_opc(ctx); From patchwork Thu Sep 28 08:52:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402313 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 20E4ACE7B0C for ; Thu, 28 Sep 2023 08:56:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmE-0006b4-Rd; Thu, 28 Sep 2023 04:53:42 -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 1qlmmD-0006af-8w for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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 1qlmmB-0004z0-PD for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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=WUubD0ZJKTGpZfFwTqcmK2tbordUXESg+SoTC0LvCn0=; b=RY3xUD0AicBxURv+S5g4V0QOBZ MAUeG6BKGVAW35zoxNprw0kRjSfRAuvo4XTtZPxFR4arNKtNeZH1RNtJhxO2NIZ1F0dVLx2Mtj7s2 LgqbZUM67dz9ob93uzZpmH7m3gavvweLoFdUsSORbVm5ydo2CdFwXHm4ddkkxGm6OpHk=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de, Richard Henderson Subject: [PULL v2 11/21] target/tricore: Fix FTOUZ being ISA v1.3.1 up Date: Thu, 28 Sep 2023 10:52:53 +0200 Message-ID: <20230928085303.511518-12-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.28.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=83853, da=183500282, mc=31, sc=0, hc=31, sp=0, fso=83853, 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 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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]); From patchwork Thu Sep 28 08:52:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3968CE7B0C for ; Thu, 28 Sep 2023 08:55:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmG-0006bS-8X; Thu, 28 Sep 2023 04:53: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 1qlmmF-0006b5-2r for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:43 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmmD-0004zV-Fj for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:42 -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=XS/b7KSIJGQ5/cfBc/pA6pXpy1 sM5++TKsqrrNs6iGj7INaee/IpE9aHBFR0i52jII8lvTsSmB1KdW4EHxmRfEutsSCA8PlfCbKVieM CrdVs5ClF9jc+tCjp1x9/QZht0bEhruKL2Ho6aR1aJkGzmrAEwoeoukEnVnWLdzzQq8c=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL v2 12/21] tests/tcg/tricore: Extended and non-extened regs now match Date: Thu, 28 Sep 2023 10:52:54 +0200 Message-ID: <20230928085303.511518-13-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 #define AREG_ADDR %a0 #define AREG_CORRECT_RESULT %a3 #define DREG_DEV_ADDR %a15 -#define EREG_RS1 %e6 -#define EREG_RS1_LO %d6 -#define EREG_RS1_HI %d7 -#define EREG_RS2 %e8 -#define EREG_RS2_LO %d8 -#define EREG_RS2_HI %d9 -#define EREG_CALC_RESULT %e8 -#define EREG_CALC_RESULT_HI %d9 -#define EREG_CALC_RESULT_LO %d8 +#define EREG_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 From patchwork Thu Sep 28 08:52:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402310 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37C62CE7B0E for ; Thu, 28 Sep 2023 08:55:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmI-0006cF-QO; Thu, 28 Sep 2023 04:53:46 -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 1qlmmG-0006bk-TW for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:44 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmmF-0004zm-GH for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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=s3NiLOOQMm0nxp6YcmaHJ9kEmWXyanUeeZN5037TDLM=; b=gszMgPqVrO2PaZpBU5gTLZysf8 mLUq2lZNXJ+5RMnxQT9LAC6ediSpLVDjxftPb7oMHz/On7o1XCYNZ4nGjiPePfF3S3qHAZhFhkO74 o2i9xlXeZQfW1Zx1dxVRu6W+TTHlhZSyM5DFvlXSRUxEf8ql4qRiWuw1n6TS7uhkYI7A=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL v2 13/21] hw/tricore: Log failing test in testdevice Date: Thu, 28 Sep 2023 10:52:55 +0200 Message-ID: <20230928085303.511518-14-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.28.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=83857, da=183500286, mc=33, sc=0, hc=33, sp=0, fso=83857, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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_testdevice.c index a1563aa568..d0f8db9089 100644 --- a/hw/tricore/tricore_testdevice.c +++ b/hw/tricore/tricore_testdevice.c @@ -16,6 +16,7 @@ */ #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 != 0) { + qemu_log_mask(LOG_GUEST_ERROR, "Test %ld failed!\n", value); + } exit(value); } From patchwork Thu Sep 28 08:52:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 941C2CE7B0C for ; Thu, 28 Sep 2023 08:54:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmK-0006cP-DG; Thu, 28 Sep 2023 04:53: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 1qlmmJ-0006cH-0t for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:47 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmmH-000501-IK for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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=MRQZEvEYi+zUG4NJbvdJBGvfkg63AwExWzhbABBdHFw=; b=leBYNj0QtPlK9pEBegAaJNFcRZ apu/HnlSszZVQLE9zSmJmnyvkEKUf2b1lnncbzvBnLOV8mvFTw6Vl4gmR1b29FoX2oTHVXV9Huihx /hLAY+0BBCfBhDr7gdDJ72QncZL0/VzmNVcR+cd7zlZmuXbO7KG16ktYv1LqpiOnD1T0=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL v2 14/21] tests/tcg: Reset result register after each test Date: Thu, 28 Sep 2023 10:52:56 +0200 Message-ID: <20230928085303.511518-15-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 #define TEST_CASE_E(num, correct_lo, correct_hi, code...) \ test_ ## num: \ From patchwork Thu Sep 28 08:52:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402317 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78278CE7B0C for ; Thu, 28 Sep 2023 08:57:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmN-0006d2-14; Thu, 28 Sep 2023 04:53:51 -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 1qlmmL-0006cg-EA for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:49 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmmJ-00050B-I3 for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:49 -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=+Wcna9OgRYTd2pdQBq3MY6gKWU4fZp/5KojGlYX42dk=; b=JthlqFMCQf07Esow1lWI00Gw6B 4CxDM3cBO8+Y2PAiTBeJ+a4GBaYgU16xE48YaEg/AqTemKpWurkr1sX6tafgJ5GPfDjAwCQiyBNV0 AGFemmDSZ4/WVS69TkZ9xA5hlaQHiQlItb4D49iIu0jH/jrCd9kGJ1Owc3h4uenoa4TM=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL v2 15/21] tests/tcg/tricore: Add test for all arith insns up to addx Date: Thu, 28 Sep 2023 10:52:57 +0200 Message-ID: <20230928085303.511518-16-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.28.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=83860, da=183500289, mc=35, sc=0, hc=35, sp=0, fso=83860, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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/test_arith.S | 41 +++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) 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 = -T$(TESTS_PATH)/link.ld --mcpu=tc162 ASFLAGS = -mtc162 CFLAGS = -mtc162 -c -I$(TESTS_PATH) +TESTS += test_arith.asm.tst TESTS += test_abs.asm.tst TESTS += test_bmerge.asm.tst TESTS += test_clz.asm.tst @@ -29,7 +30,7 @@ TESTS += test_muls.asm.tst TESTS += test_boot_to_main.c.tst TESTS += test_context_save_areas.c.tst -QEMU_OPTS += -M tricore_testboard -cpu tc37x -nographic -kernel +QEMU_OPTS += -M tricore_testboard -cpu tc37x -nographic -d guest_errors -kernel %.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; \ ) +#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; \ ) +#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/test_arith.S b/tests/tcg/tricore/asm/test_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 From patchwork Thu Sep 28 08:52:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402302 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9C4CCE7B0F for ; Thu, 28 Sep 2023 08:54:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmU-0006e7-Do; Thu, 28 Sep 2023 04:53:58 -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 1qlmmT-0006dl-0J for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:57 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmmL-00050N-CZ for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53: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=GQWNclsgNal5rnB1w9TaT4kvpYudBJGlCn/pvUQoht4=; b=T0x9DHxpqvMxJxHiAeSxiuYp0S v1Ol3RIDqvDP/zE+AI2zQPBiHocu1NpkJeFGh9pdJuXDIugPKE6wk34Or3PFDLvwgGfUTyu77FQzY uy/UMypEvO1Z7MTvuuTgc8IHf7kvi3gfO465dVvlPoKN+nA1O+sYMP6XrCVJLsxd+Siw=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL v2 16/21] tests/tcg/tricore: Add test from 'and' to 'csub' Date: Thu, 28 Sep 2023 10:52:58 +0200 Message-ID: <20230928085303.511518-17-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.28.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=83862, da=183500291, mc=37, sc=0, hc=37, sp=0, fso=83862, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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; \ ) +#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; \ ) +#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/test_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 ) TEST_PASSFAIL From patchwork Thu Sep 28 08:52:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E969CE7B0E for ; Thu, 28 Sep 2023 08:55:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmh-0006gv-VS; Thu, 28 Sep 2023 04:54:12 -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 1qlmmd-0006er-BX for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:54:07 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmmb-00050Y-FZ for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:54:07 -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=RPjyREz/dDNb+hMADmzUi99rXF KgwbeV48DGhTATTisuQbQLlNR3NsgXSi+g7fz+uW9i07gN9H4ccxoeVjKzgXjoVo08lTgnLlEctI4 R4u0qaAq/wn/EXVS5ezQ0nh9Oym6o0SL0QGPYjkJPfWcJTtcud4d/J2ymEomLbQXOsZE=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL v2 17/21] tests/tcg/tricore: Add test from 'dextr' to 'lt' Date: Thu, 28 Sep 2023 10:52:59 +0200 Message-ID: <20230928085303.511518-18-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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; \ ) +#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; \ ) +#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; \ ) -#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; \ ) -#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; \ ) +#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; \ + ) +#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; \ + ) /* Pass/Fail handling part */ #define TEST_PASSFAIL \ diff --git a/tests/tcg/tricore/asm/test_arith.S b/tests/tcg/tricore/asm/test_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 ,0x5de9a7b4 ) + 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 ,0xaef09348 ) + 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 ,0x4b417135 ,0x7 ) + TEST_D_DIDI(insn.t, 119, 0xcbbe860a, 0xcbbe860a ,0x4 ,0xd2f483d9 ,0x3 ) + TEST_E_ED(ixmax, 120, 0x48ef48f1 ,0x6e7e, 0x687e48ef ,0x9afdc6c8 ,0xbd066e7e ) + TEST_E_ED(ixmax.u, 121, 0xac97ac98 ,0xd968, 0x67b7ac96 ,0x55371874 ,0xd968399e ) + TEST_E_ED(ixmin, 122, 0x957f9580 ,0xa9de, 0x8ed957e ,0x9519d426 ,0xa9de69e1 ) + TEST_E_ED(ixmin.u, 123, 0xde48de4a ,0x3660, 0x3dc4de48 ,0x1e5a559d ,0xdbc53660 ) + 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 ) TEST_PASSFAIL From patchwork Thu Sep 28 08:53:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402314 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E33C3CE7B0C for ; Thu, 28 Sep 2023 08:56:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmj-0006hZ-52; Thu, 28 Sep 2023 04:54:13 -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 1qlmme-0006f4-Mf for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:54:08 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmmc-00050l-Pl for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:54:08 -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=DGlJASECemiHBCG0TLuxi6mNT3 iOAD1hyrr/uzZv7PCNEKG3toC7rfk8+aMV22Bv/p0aBdJuhNVqo3/CBOBNM0ZyiEMg0FJ6g0FLOn7 bpIHBJbejm+R3Kfxamn+62La2al8O2M55NpYK0TZHnMkhXVt55Y5drMQBaF++9AeeM7o=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL v2 18/21] tests/tcg/tricore: Add test from 'max' to 'shas' Date: Thu, 28 Sep 2023 10:53:00 +0200 Message-ID: <20230928085303.511518-19-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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; \ ) +#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; \ + ) #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; \ ) +#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/test_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 ) TEST_PASSFAIL From patchwork Thu Sep 28 08:53:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402315 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B8A7CE7B11 for ; Thu, 28 Sep 2023 08:57:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmj-0006jQ-Lf; Thu, 28 Sep 2023 04:54:13 -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 1qlmme-0006f3-LI for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:54:08 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmmc-000513-Pu for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:54:08 -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=S/ya3fdsGUmRaMg1GvFusA7AqA djn3AQ6dnNh/hfgzE52PTrhAcmrrQMYhdFm18PIU5UNIS0Nr8I0Gxf3ifTr0CPUl+HlnffQQxJjbA vmEKZcC4Igjo3U3k64LiKGlsCILVIp+Od/IPNZ1yOaQrj8i1GzZzgVqZZpb4y/awVmwU=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL v2 19/21] tests/tcg/tricore: Add test from 'shuffle' to 'xor.t' Date: Thu, 28 Sep 2023 10:53:01 +0200 Message-ID: <20230928085303.511518-20-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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/test_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 ) TEST_PASSFAIL From patchwork Thu Sep 28 08:53:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402306 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE34ECE7B0E for ; Thu, 28 Sep 2023 08:54:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmW-0006eO-2O; Thu, 28 Sep 2023 04:54:00 -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 1qlmmV-0006eA-4v for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:59 -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 1qlmmT-000517-Fk for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:53:58 -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=jI4CX0T3SGjD6W18uFOBdArT7W Ca7FQsnoaGGGYguq1IXOEnK3GazogLmYqApivpNc5z+5TnmpaJPmHvD7AI1MO3Y96tDnlFLKgFQYn oZ2iLIGK8p2P/7y+sYnUtXEt7nH635ZLYmpSwLWrNUsnPSsvyD+wyN1XIO0VosVgKte8=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL v2 20/21] target/tricore: Remove CSFRs from cpu.h Date: Thu, 28 Sep 2023 10:53:02 +0200 Message-ID: <20230928085303.511518-21-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.28.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=83871, da=183500300, mc=39, sc=0, hc=39, sp=0, fso=83871, 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 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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. */ - 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; From patchwork Thu Sep 28 08:53:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 13402312 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4EF43CE7B0E for ; Thu, 28 Sep 2023 08:55:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlmmk-0006kR-FJ; Thu, 28 Sep 2023 04:54:14 -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 1qlmmj-0006ha-Bd for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:54:13 -0400 Received: from zuban.uni-paderborn.de ([2001:638:502:c003::17]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlmmf-00051M-Af for qemu-devel@nongnu.org; Thu, 28 Sep 2023 04:54:13 -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=HXijQLFrXjPzi0QbMP+yf6ohSZ W+TWbZHGhSz+5xE+90J29JMlq6rcK9ATPom2cmDrM4yzhDMhdWbRMHEn1m1WeJkSAsPvatFpn8aeQ dHT6FQ3Pqbtm1o4FpbH45U/x8ocAqa5VMSZtK7900VhjKU+QTxzxBTI0p8oKdrvQIYhI=; X-Envelope-From: From: Bastian Koppelmann To: qemu-devel@nongnu.org Cc: kbastian@mail.uni-paderborn.de Subject: [PULL v2 21/21] target/tricore: Change effective address (ea) to target_ulong Date: Thu, 28 Sep 2023 10:53:03 +0200 Message-ID: <20230928085303.511518-22-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> References: <20230928085303.511518-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 X-IMT-spamd-action: no action X-PMX-Version: 6.4.9.2830568, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2023.9.28.84518, AntiVirus-Engine: 6.0.2, AntiVirus-Data: 2023.9.28.602000 X-Sophos-SenderHistory: ip=79.202.213.239, fs=83872, da=183500301, mc=41, sc=0, hc=41, sp=0, fso=83872, 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 client-ip=2001:638:502:c003::17; envelope-from=kbastian@mail.uni-paderborn.de; helo=zuban.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 == 0; } -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]); } -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]); } -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 *new_PSW) { *new_PCXI = cpu_ldl_data(env, ea); @@ -2519,7 +2519,7 @@ static void restore_context_upper(CPUTriCoreState *env, int ea, env->gpr_d[15] = cpu_ldl_data(env, ea+60); } -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 = cpu_ldl_data(env, ea); @@ -2763,26 +2763,26 @@ void helper_rfm(CPUTriCoreState *env) } } -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); } -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); } -void helper_stlcx(CPUTriCoreState *env, uint32_t ea) +void helper_stlcx(CPUTriCoreState *env, target_ulong ea) { save_context_lower(env, ea); } -void helper_stucx(CPUTriCoreState *env, uint32_t ea) +void helper_stucx(CPUTriCoreState *env, target_ulong ea) { save_context_upper(env, ea); }