From nobody Fri May 3 16:24:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de ARC-Seal: i=1; a=rsa-sha256; t=1561469428; cv=none; d=zoho.com; s=zohoarc; b=aaazUvWBpKbbRL63Ve9lBgwrhxbe74XS+OgBwi8A+lNdcyy3aW/ox40TxtAPb+TI6OLMzgnXnAGtbAOz4WS8AFxTAFN7t5OyFlsZd8DEW2EfMG8y2ZlxniBl6nTd3HxD5M0RxH8L4rPIJNAmNbbSobHDj/qaMh4xXu9EoQ1OKRo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561469428; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=6Km5mnnJTNxAqdc3WDVjMnfm+q6og2AMP+Yvh7bmX+g=; b=mOJT/GoI9M1IZVNe63ECRLna7P9ubmzVHu/tunSwd57ChjSgxfDH79TZoKBduaKZMNa4Pb2zcXdviUQZF7qpEaxAcJ5p1iS8ih8sD9hr62rRWxMy35uSz9j2AcsYbNIpAe9XxzjxV6XR1mv3eWhra4+EJ09YmQtVUfzpQZ7k4fc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561469428250492.22974148732715; Tue, 25 Jun 2019 06:30:28 -0700 (PDT) Received: from localhost ([::1]:60243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hflWi-0000Ti-RO for importer@patchew.org; Tue, 25 Jun 2019 09:30:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50897) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hflAL-0001CT-0p for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hflAH-0007hJ-7o for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:15 -0400 Received: from telepax.uni-paderborn.de ([131.234.189.14]:50734) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hflAD-0007cr-HD for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:11 -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=6Km5mnnJTNxAqdc3WDVjMnfm+q6og2AMP+Yvh7bmX+g=; b=simB5cLDZCu+K9rtPKnaZ087IZ ZqqLsmkFoXiCan4iYHvDHzYQXo5ClBPrnhPezTjhIiul/3D+g23S8p+3MyuqYwzvpfaDiCsliaEEr YkOzbSYAccirsFrsmDWMpCwkcR2paUFl1F5XL+7Ts9d70xIKD96kpvEGgPeQ+Pi1MRt8=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 15:06:54 +0200 Message-Id: <20190625130658.24895-2-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190625130658.24895-1-kbastian@mail.uni-paderborn.de> References: <20190625130658.24895-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.6.2792898, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2019.6.25.125716, AntiVirus-Engine: 5.63.0, AntiVirus-Data: 2019.6.18.5630002 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 131.234.189.14 Subject: [Qemu-devel] [PULL 1/5] tricore: add FTOIZ instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Lars Biermanski , Georg Hofstetter , David Brenken , Robert Rasche , Andreas Konopik Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: David Brenken Signed-off-by: Andreas Konopik Signed-off-by: David Brenken Signed-off-by: Georg Hofstetter Signed-off-by: Robert Rasche Signed-off-by: Lars Biermanski Reviewed-by: Bastian Koppelmann Message-Id: <20190624070339.4408-2-david.brenken@efs-auto.org> Signed-off-by: Bastian Koppelmann --- target/tricore/fpu_helper.c | 25 +++++++++++++++++++++++++ target/tricore/helper.h | 1 + target/tricore/translate.c | 3 +++ 3 files changed, 29 insertions(+) diff --git a/target/tricore/fpu_helper.c b/target/tricore/fpu_helper.c index d8a6c0d25b..f079d9e939 100644 --- a/target/tricore/fpu_helper.c +++ b/target/tricore/fpu_helper.c @@ -303,6 +303,31 @@ uint32_t helper_itof(CPUTriCoreState *env, uint32_t ar= g) return (uint32_t)f_result; } =20 +uint32_t helper_ftoiz(CPUTriCoreState *env, uint32_t arg) +{ + float32 f_arg =3D make_float32(arg); + uint32_t result; + int32_t flags; + + result =3D float32_to_int32_round_to_zero(f_arg, &env->fp_status); + + flags =3D f_get_excp_flags(env); + if (flags & float_flag_invalid) { + flags &=3D ~float_flag_inexact; + if (float32_is_any_nan(f_arg)) { + result =3D 0; + } + } + + if (flags) { + f_update_psw_flags(env, flags); + } else { + env->FPU_FS =3D 0; + } + + return result; +} + uint32_t helper_ftouz(CPUTriCoreState *env, uint32_t arg) { float32 f_arg =3D make_float32(arg); diff --git a/target/tricore/helper.h b/target/tricore/helper.h index f60e81096b..16b62edf7f 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(ftoi, i32, env, i32) DEF_HELPER_2(itof, i32, env, i32) +DEF_HELPER_2(ftoiz, 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 06c4485e55..5e1c4f54b9 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -6747,6 +6747,9 @@ static void decode_rr_divide(CPUTriCoreState *env, Di= sasContext *ctx) case OPC2_32_RR_UPDFL: gen_helper_updfl(cpu_env, cpu_gpr_d[r1]); break; + case OPC2_32_RR_FTOIZ: + gen_helper_ftoiz(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); + break; default: generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC); } --=20 2.22.0 From nobody Fri May 3 16:24:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de ARC-Seal: i=1; a=rsa-sha256; t=1561468545; cv=none; d=zoho.com; s=zohoarc; b=XOE4f2NtNBUq5n2DJSuKqpCNDXyucwvCMUiS3tDkPTzccdeBN10T3Xa5SgOhbvZBMuItJ12ZXhueqmNkCCHdsUD5SmswDpKbe7/wxYdoLTlmTvrYR0dlHjtNTWjgBu/c5QMhHPvCvayYAVZwqZuHUShv2vZAD+L7LjN+mvrJkaU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561468545; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=708RpPXa2IUo7RUFoWejwd4pEMIalApEbAkil0e53M4=; b=UHSGooeBoHixOW/We2KwrJia87Vl7VpcSAzxRsVECO0tZwXUG5HdUSFALclMlCeZ2+uVwKNRB1dtPcF22NwaIT+fiIIij8qpGNaH93lR/dtQd0kq5fsjmSY5ADD8FNUbwMTVkXd41CzReGiDmmz8RtGvAUAO8ZVbKLruRszDggM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561468545109766.2757025295368; Tue, 25 Jun 2019 06:15:45 -0700 (PDT) Received: from localhost ([::1]:60092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hflIV-0006zV-03 for importer@patchew.org; Tue, 25 Jun 2019 09:15:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50898) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hflAL-0001CU-0r for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hflAH-0007hT-7y for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:15 -0400 Received: from telepax.uni-paderborn.de ([131.234.189.14]:50752) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hflAD-0007ds-Ek for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:11 -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=708RpPXa2IUo7RUFoWejwd4pEMIalApEbAkil0e53M4=; b=mMSadSgHTaoQ5qV4/XV14b0ojP OQox13LiIXjXPBUrLZnHpaANsBZLBeoZTGgLW7h1JK0tBMQ5mj+2bOgIhmR+VnBaiFHdl5PIpLQlj C0cdZ1ZGTnJQtNH5DCR2vIVSCsaePbBFQJwnEL3pL2gr5c8NPg6kzYq5z/ZKL7rokggk=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 15:06:55 +0200 Message-Id: <20190625130658.24895-3-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190625130658.24895-1-kbastian@mail.uni-paderborn.de> References: <20190625130658.24895-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.6.2792898, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2019.6.25.125716, AntiVirus-Engine: 5.63.0, AntiVirus-Data: 2019.6.18.5630002 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 131.234.189.14 Subject: [Qemu-devel] [PULL 2/5] tricore: add UTOF instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Lars Biermanski , Georg Hofstetter , David Brenken , Robert Rasche , Andreas Konopik Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: David Brenken Signed-off-by: Andreas Konopik Signed-off-by: David Brenken Signed-off-by: Georg Hofstetter Signed-off-by: Robert Rasche Signed-off-by: Lars Biermanski Reviewed-by: Bastian Koppelmann Message-Id: <20190624070339.4408-3-david.brenken@efs-auto.org> Signed-off-by: Bastian Koppelmann --- target/tricore/fpu_helper.c | 16 ++++++++++++++++ target/tricore/helper.h | 1 + target/tricore/translate.c | 3 +++ 3 files changed, 20 insertions(+) diff --git a/target/tricore/fpu_helper.c b/target/tricore/fpu_helper.c index f079d9e939..432079c8e2 100644 --- a/target/tricore/fpu_helper.c +++ b/target/tricore/fpu_helper.c @@ -303,6 +303,22 @@ uint32_t helper_itof(CPUTriCoreState *env, uint32_t ar= g) return (uint32_t)f_result; } =20 +uint32_t helper_utof(CPUTriCoreState *env, uint32_t arg) +{ + float32 f_result; + uint32_t flags; + + f_result =3D uint32_to_float32(arg, &env->fp_status); + + flags =3D f_get_excp_flags(env); + if (flags) { + f_update_psw_flags(env, flags); + } else { + env->FPU_FS =3D 0; + } + return (uint32_t)f_result; +} + uint32_t helper_ftoiz(CPUTriCoreState *env, uint32_t arg) { float32 f_arg =3D make_float32(arg); diff --git a/target/tricore/helper.h b/target/tricore/helper.h index 16b62edf7f..f1a5cb367e 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(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(ftouz, i32, env, i32) DEF_HELPER_2(updfl, void, env, i32) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 5e1c4f54b9..bd913d71a1 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -6747,6 +6747,9 @@ static void decode_rr_divide(CPUTriCoreState *env, Di= sasContext *ctx) case OPC2_32_RR_UPDFL: gen_helper_updfl(cpu_env, cpu_gpr_d[r1]); break; + case OPC2_32_RR_UTOF: + gen_helper_utof(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); + break; case OPC2_32_RR_FTOIZ: gen_helper_ftoiz(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); break; --=20 2.22.0 From nobody Fri May 3 16:24:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de ARC-Seal: i=1; a=rsa-sha256; t=1561468311; cv=none; d=zoho.com; s=zohoarc; b=FXjGl1SumTluXybWE1twBy79Q81r1aFhegaFiQYuEhGyFyXoUCwM0BpUAHckkqdwHQlX5usNw8vbaNPQIcR4lX16U5JaicXbqStlQZ/kr6p2LryqfaGYvUEtsbehapTUUAz8Q9s+obls00+DisYBq+VuO0hTzbuiCxOFdiWqtb0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561468311; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=/qFG3mD2W0Qhl1cjRE0qltS4XbcDV/9BfLnaosA5+ug=; b=DtjbW4vjQuVDR/aNyxx4Ckl29TA4nA545RrbgMcbeYx4s4agzYuVqEAH9Ao3TpBZ67ISfE5caem8kNi97pX3YCnl3gldovWSUQIRkeKOFNkpgLVRTkPpRcWGU3ECk8TDvJhztP9GOYscQYX7ZXKo3lNQSvykW7pOCWayemPORUQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561468309880538.1790864085273; Tue, 25 Jun 2019 06:11:49 -0700 (PDT) Received: from localhost ([::1]:60046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hflEX-0003MW-OZ for importer@patchew.org; Tue, 25 Jun 2019 09:11:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50927) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hflAQ-0001D3-SK for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hflAM-0007l9-Mh for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:20 -0400 Received: from telepax.uni-paderborn.de ([131.234.189.14]:50772) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hflAJ-0007ew-51 for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:15 -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=/qFG3mD2W0Qhl1cjRE0qltS4XbcDV/9BfLnaosA5+ug=; b=CrzJii7NnxWaG/7S5S5EH/nOt/ XPamJMDaDQpGc+BNRBhLLwXrW1hSQuK30qlkfqZ+4I2zcd4A0jJGVfv837GSoWyhqMJfodb++5wF8 pcMxvFVzaRwMlHYYp4ZZXX7yaKIMIkLbcInHeToL2UARbkH5barQpysz9OP7Z92zG2ME=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 15:06:56 +0200 Message-Id: <20190625130658.24895-4-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190625130658.24895-1-kbastian@mail.uni-paderborn.de> References: <20190625130658.24895-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.6.2792898, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2019.6.25.125716, AntiVirus-Engine: 5.63.0, AntiVirus-Data: 2019.6.18.5630002 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 131.234.189.14 Subject: [Qemu-devel] [PULL 3/5] tricore: fix RRPW_INSERT instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Lars Biermanski , Georg Hofstetter , David Brenken , Robert Rasche , Andreas Konopik Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: David Brenken Signed-off-by: Andreas Konopik Signed-off-by: David Brenken Signed-off-by: Georg Hofstetter Signed-off-by: Robert Rasche Signed-off-by: Lars Biermanski Reviewed-by: Bastian Koppelmann Message-Id: <20190624070339.4408-4-david.brenken@efs-auto.org> Signed-off-by: Bastian Koppelmann --- target/tricore/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index bd913d71a1..5d4febf1c0 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -7025,9 +7025,9 @@ static void decode_rrpw_extract_insert(CPUTriCoreStat= e *env, DisasContext *ctx) } break; case OPC2_32_RRPW_INSERT: - if (pos + width <=3D 31) { + if (pos + width <=3D 32) { tcg_gen_deposit_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r2], - width, pos); + pos, width); } break; default: --=20 2.22.0 From nobody Fri May 3 16:24:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de ARC-Seal: i=1; a=rsa-sha256; t=1561468487; cv=none; d=zoho.com; s=zohoarc; b=ohOWpBUSdjSGuXWMidwJUCyv4jc3yOTxMFxjeOtRxfydq1p81xaIyYAHdVevaesW7s+Gx3NmE2MMFnmVcSaKAK+nAD4dc/nKGINjglHGBeciJxwJ6e8bXf7jTWxuAV7Au/SMhLOxEVpmzTyjryfVf9j+gFmoi7soFo2Sv1KQmew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561468487; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=W8OiDWXvhhBXnBnezRJGstX02qXPlNoorrxhyjQkvts=; b=a5rPFaOcXKKTLNAcBGLCah6vEHy1G15V4cPRTsn+dbOCRKc4IG3CJr/E3y7gs4YuuZ1bLK/C6hyKEiHqaGx7rzNinOQAJYz2aI8D9HuTvCA3J1sondwUDTxJ+PTug6aB2rqMqLou6l4KjFcLaNEgTkxBZUskIW0uhXtoX0jSPxs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561468487608157.20062707765896; Tue, 25 Jun 2019 06:14:47 -0700 (PDT) Received: from localhost ([::1]:60084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hflHa-0006DY-LF for importer@patchew.org; Tue, 25 Jun 2019 09:14:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50926) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hflAQ-0001D2-SJ for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hflAN-0007ld-4E for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:20 -0400 Received: from telepax.uni-paderborn.de ([131.234.189.14]:50786) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hflAJ-0007g5-C6 for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:17 -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=W8OiDWXvhhBXnBnezRJGstX02qXPlNoorrxhyjQkvts=; b=LggFfnaJVroXNDyfu93FVG06eL tLzyx5dPyoRUTsCf2rRvmXNvZAlE9FeeDM//qDeNjPjV5HlY+DT04g2z0rbxkNCwoE5C6nlxgElsJ q/JAgq0Igjaa3AX9XAzmV1M1nzQjtJFqQQXcwZUmc87eAj5VVIh28eeziKL4jHm3UhZA=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 15:06:57 +0200 Message-Id: <20190625130658.24895-5-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190625130658.24895-1-kbastian@mail.uni-paderborn.de> References: <20190625130658.24895-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.6.2792898, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2019.6.25.125716, AntiVirus-Engine: 5.63.0, AntiVirus-Data: 2019.6.4.5630002 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 131.234.189.14 Subject: [Qemu-devel] [PULL 4/5] tricore: sync ctx.hflags with tb->flags X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Lars Biermanski , Georg Hofstetter , David Brenken , Robert Rasche , Andreas Konopik Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Georg Hofstetter Signed-off-by: Andreas Konopik Signed-off-by: David Brenken Signed-off-by: Georg Hofstetter Signed-off-by: Robert Rasche Signed-off-by: Lars Biermanski Reviewed-by: Bastian Koppelmann Message-Id: <20190624070339.4408-5-david.brenken@efs-auto.org> Signed-off-by: Bastian Koppelmann --- target/tricore/translate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 5d4febf1c0..c79566e56a 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -8810,6 +8810,7 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock *tb, int max_insns) ctx.singlestep_enabled =3D cs->singlestep_enabled; ctx.bstate =3D BS_NONE; ctx.mem_idx =3D cpu_mmu_index(env, false); + ctx.hflags =3D (uint32_t)tb->flags; =20 tcg_clear_temp_count(); gen_tb_start(tb); --=20 2.22.0 From nobody Fri May 3 16:24:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=mail.uni-paderborn.de ARC-Seal: i=1; a=rsa-sha256; t=1561468871; cv=none; d=zoho.com; s=zohoarc; b=IBMYuiMMzDiKuQzwfnGTJ2LYi5hSv8XU2snXm+jJODN0P9xf3LVwbxWogaxLInqW5SDK/GsfhpjYAewmJIIwhEI4Ro3k6lJMdAn/UmYnKzbqYNwuG2bTeCcZhKt6PftR9ymk4UlTxlbcD/mGBZbKbKnMwAlwsJeLDHymfGyo/fI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561468871; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=sX1mU8mDb7NpK39AZ1baVGHeDU9x5UyiX+zE47nhvKs=; b=jSMbJd05iMU3MkJaa9v3ZsPMhpqeGT+kPrM3WwSlA+oNVLrQ+k54UCYJqQJRo2YOk1+hAAYtX33hdXolTCkEUK8s1xLTyTACC+SU5O5S+8JnT7LdVGtDCi4tftKXXl3LOKwRDc7WiGWzgCAJWIaqiP6o+N39Hpl7US58HpoqmXM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561468871460797.4988380867094; Tue, 25 Jun 2019 06:21:11 -0700 (PDT) Received: from localhost ([::1]:60116 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hflNj-0001Xk-CX for importer@patchew.org; Tue, 25 Jun 2019 09:21:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50953) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hflAU-0001DA-Oz for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hflAQ-0007ny-TA for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:24 -0400 Received: from telepax.uni-paderborn.de ([131.234.189.14]:50808) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hflAN-0007gu-9p for qemu-devel@nongnu.org; Tue, 25 Jun 2019 09:07:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=sX1mU8mDb7NpK39AZ1baVGHeDU9x5UyiX+zE47nhvKs=; b=LERcHrdOzIVEr6uqyV/Kf5kNub hYPzDrdcyIeqxgyniae466zMK1tGcmjUno5eJZiaPt6LPgjRpDMlDi2opVPW4Qkn3unTRO0MtdXJ8 SuoZwJ+GdekuH0/Bzck5q8hVR1xNnr02ilVPboMYaCYqw92SRMO2Jp1o/pYAbrsPL4yo=; From: Bastian Koppelmann To: qemu-devel@nongnu.org Date: Tue, 25 Jun 2019 15:06:58 +0200 Message-Id: <20190625130658.24895-6-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190625130658.24895-1-kbastian@mail.uni-paderborn.de> References: <20190625130658.24895-1-kbastian@mail.uni-paderborn.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.6.2792898, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2019.6.25.125716, AntiVirus-Engine: 5.63.0, AntiVirus-Data: 2019.6.18.5630002 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 131.234.189.14 Subject: [Qemu-devel] [PULL 5/5] tricore: add QSEED instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Lars Biermanski , Andreas Konopik , Georg Hofstetter , David Brenken , Robert Rasche , Andreas Konopik Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Andreas Konopik Signed-off-by: Andreas Konopik Signed-off-by: David Brenken Signed-off-by: Georg Hofstetter Signed-off-by: Robert Rasche Signed-off-by: Lars Biermanski Reviewed-by: Bastian Koppelmann Message-Id: <20190624070339.4408-6-david.brenken@efs-auto.org> Signed-off-by: Bastian Koppelmann [BK: Added fp_status arg to float32_is_signaling_nan()] --- target/tricore/fpu_helper.c | 85 +++++++++++++++++++++++++++++++++++++ target/tricore/helper.h | 1 + target/tricore/translate.c | 3 ++ 3 files changed, 89 insertions(+) diff --git a/target/tricore/fpu_helper.c b/target/tricore/fpu_helper.c index 432079c8e2..cb7ee7dd35 100644 --- a/target/tricore/fpu_helper.c +++ b/target/tricore/fpu_helper.c @@ -24,6 +24,7 @@ =20 #define QUIET_NAN 0x7fc00000 #define ADD_NAN 0x7fc00001 +#define SQRT_NAN 0x7fc00004 #define DIV_NAN 0x7fc00008 #define MUL_NAN 0x7fc00002 #define FPU_FS PSW_USB_C @@ -32,6 +33,9 @@ #define FPU_FZ PSW_USB_AV #define FPU_FU PSW_USB_SAV =20 +#define float32_sqrt_nan make_float32(SQRT_NAN) +#define float32_quiet_nan make_float32(QUIET_NAN) + /* we don't care about input_denormal */ static inline uint8_t f_get_excp_flags(CPUTriCoreState *env) { @@ -166,6 +170,87 @@ uint32_t helper_fmul(CPUTriCoreState *env, uint32_t r1= , uint32_t r2) =20 } =20 +/* + * Target TriCore QSEED.F significand Lookup Table + * + * The QSEED.F output significand depends on the least-significant + * exponent bit and the 6 most-significant significand bits. + * + * IEEE 754 float datatype + * partitioned into Sign (S), Exponent (E) and Significand (M): + * + * S E E E E E E E E M M M M M M ... + * | | | + * +------+------+-------+-------+ + * | | + * for lookup table + * calculating index for + * output E output M + * + * This lookup table was extracted by analyzing QSEED output + * from the real hardware + */ +static const uint8_t target_qseed_significand_table[128] =3D { + 253, 252, 245, 244, 239, 238, 231, 230, 225, 224, 217, 216, + 211, 210, 205, 204, 201, 200, 195, 194, 189, 188, 185, 184, + 179, 178, 175, 174, 169, 168, 165, 164, 161, 160, 157, 156, + 153, 152, 149, 148, 145, 144, 141, 140, 137, 136, 133, 132, + 131, 130, 127, 126, 123, 122, 121, 120, 117, 116, 115, 114, + 111, 110, 109, 108, 103, 102, 99, 98, 93, 92, 89, 88, 83, + 82, 79, 78, 75, 74, 71, 70, 67, 66, 63, 62, 59, 58, 55, + 54, 53, 52, 49, 48, 45, 44, 43, 42, 39, 38, 37, 36, 33, + 32, 31, 30, 27, 26, 25, 24, 23, 22, 19, 18, 17, 16, 15, + 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2 +}; + +uint32_t helper_qseed(CPUTriCoreState *env, uint32_t r1) +{ + uint32_t arg1, S, E, M, E_minus_one, m_idx; + uint32_t new_E, new_M, new_S, result; + + arg1 =3D make_float32(r1); + + /* fetch IEEE-754 fields S, E and the uppermost 6-bit of M */ + S =3D extract32(arg1, 31, 1); + E =3D extract32(arg1, 23, 8); + M =3D extract32(arg1, 17, 6); + + if (float32_is_any_nan(arg1)) { + result =3D float32_quiet_nan; + } else if (float32_is_zero_or_denormal(arg1)) { + if (float32_is_neg(arg1)) { + result =3D float32_infinity | (1 << 31); + } else { + result =3D float32_infinity; + } + } else if (float32_is_neg(arg1)) { + result =3D float32_sqrt_nan; + } else if (float32_is_infinity(arg1)) { + result =3D float32_zero; + } else { + E_minus_one =3D E - 1; + m_idx =3D ((E_minus_one & 1) << 6) | M; + new_S =3D S; + new_E =3D 0xBD - E_minus_one / 2; + new_M =3D target_qseed_significand_table[m_idx]; + + result =3D 0; + result =3D deposit32(result, 31, 1, new_S); + result =3D deposit32(result, 23, 8, new_E); + result =3D deposit32(result, 15, 8, new_M); + } + + if (float32_is_signaling_nan(arg1, &env->fp_status) + || result =3D=3D float32_sqrt_nan) { + env->FPU_FI =3D 1 << 31; + env->FPU_FS =3D 1; + } else { + env->FPU_FS =3D 0; + } + + return (uint32_t) result; +} + uint32_t helper_fdiv(CPUTriCoreState *env, uint32_t r1, uint32_t r2) { uint32_t flags; diff --git a/target/tricore/helper.h b/target/tricore/helper.h index f1a5cb367e..b64780c37d 100644 --- a/target/tricore/helper.h +++ b/target/tricore/helper.h @@ -109,6 +109,7 @@ DEF_HELPER_3(fdiv, i32, env, i32, i32) DEF_HELPER_4(fmadd, i32, env, i32, i32, i32) 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(itof, i32, env, i32) DEF_HELPER_2(utof, i32, env, i32) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index c79566e56a..dc2a65f3f9 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -6753,6 +6753,9 @@ static void decode_rr_divide(CPUTriCoreState *env, Di= sasContext *ctx) case OPC2_32_RR_FTOIZ: gen_helper_ftoiz(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); break; + case OPC2_32_RR_QSEED_F: + gen_helper_qseed(cpu_gpr_d[r3], cpu_env, cpu_gpr_d[r1]); + break; default: generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC); } --=20 2.22.0