From patchwork Mon Dec 19 22:29:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13077206 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 853EAC4332F for ; Mon, 19 Dec 2022 22:30:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7Odh-00089J-NM; Mon, 19 Dec 2022 17:29:41 -0500 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 1p7Odg-00088n-B0 for qemu-devel@nongnu.org; Mon, 19 Dec 2022 17:29:40 -0500 Received: from mout.gmx.net ([212.227.17.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7Ode-0007E3-IL for qemu-devel@nongnu.org; Mon, 19 Dec 2022 17:29:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1671488976; bh=U8DC5Fd6BpgVxj/XU1DU03+aQGVtmjh4bK8voYGFtfk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=HElbOQ4uk9vXA1TZanJPY/FZuoi9KhOb8wfzcBvrr9eYCanFImPB6sqHisfw/N/CV 5mQRRu+PHK2N3vbtuWEKBd0amNOk5n7gYD1PyeQNsDuQcukvmBhPdru2xQyfizmRd4 jJbINVToWyjwVt8iMBRBpggKEtZtGcaiVHjUZxe/LxIFhlr7YnDgG369gTjPGbFHID VhVZhICtPjlB54ELbOooOEuPT2IT1wFpDr1VfehSsPJkZLqXt+xP6+rytZf12yYif5 JlakDakqRxZzsfGSbis/IbLTJDMnpYOW1QHaY2TBYxYZeWsJleFtdrAxYCK+oM0pD0 p5OW/Xk8UFQZA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100.fritz.box ([92.116.151.196]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MXp9Y-1pNoVA1I9E-00Y6Ae; Mon, 19 Dec 2022 23:29:36 +0100 From: Helge Deller To: qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: Richard Henderson , Helge Deller Subject: [PULL 2/2] target/hppa: Fix fid instruction emulation Date: Mon, 19 Dec 2022 23:29:35 +0100 Message-Id: <20221219222935.284704-3-deller@gmx.de> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221219222935.284704-1-deller@gmx.de> References: <20221219222935.284704-1-deller@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:p20dXiVCopYrwaoFqtQEiUhlayW+0jXae5n3de9QVr70o7X2ybB AxiIsRmdKtm+GDSjvCMm8xaURYQnLZ7yxj7rLMYiIo74xHZ5q1Jg55AxUYt8fMk+DwWVkJs N6AMhcsGLdpMgtRSucy2sdzRgkCC+cga8qaBbjSfHcFACchbW3xMjOo3B0a1mvOnuIufYi4 ZzP2JvNolEBkJh0gmMo5A== UI-OutboundReport: notjunk:1;M01:P0:ZQVw3/5UfHQ=;sIp1jtXqcO/hB8f+z1FK11YjzOK 79es0Vpj6OYh8dsYwC4vZ7xZNnB3TXMqStsKS0v/uPC6/q0ijD7gfdb5uT9NvGpXx+l3UUH6F MCUI2V1MNlvPn4fSKpgbcypqGMrTmJtysL0VM9+meocuf59ZnRk34DhMwufjH9yCcJZ40bKEx kpNsrOqepFnEskH449y9IOR0mA55bHYz8hiiG3N3nVXhNKCBFQKgpMG5hS8GPFpofLue6ByLr 85nymi4auWeh9tZpzG2QrgBooWZ1xXAMF0qvpNP5ZTpRR452SyNRuxLpls+rVefHYdw7eB6jX e1LmrQoZXn9cLVg1tRyxj2qFfv4Cmkz0PIRptk6mFnlT07ZI6Vvp4DPXj5nSVxMw3hp2U+GGR sOKfonXYcNN/XPSMaUMofc1mxfYGl0rSKDnvBjvqd/ADDLcYlAJ+oHpr+H4kBA55YTcGEotmn QnX7HoaVhqzKtmqudh8Qo73zPsGGV4GnvX+bgQc8OG+d3qqqOr0zkPedYTouri49GJCXt6kiH ClbRV5mrlHn3Lah5vUjq4tBvAtTKadqzwNKmXODzPLa7BfyioTAtjLgBuPLjqv8sBKcpk9F3L t65CHB0HSWgTLIMDVqsvq42H/n9f3e2SK6BuQDicX8AGdvsfSEybA8nYfsxdUFyBOId12awoI UWIxRJpCwBgioydjkUYwJgaG4bLSJxrNABaQnYBxmwOFj2PguDrgeVKH8JJdzjD48pJvlm7T5 29vplHQloI7ZQ4CNbZQTa4h6v+GJRyEAnBEUsxDKg0ukva1gsFF0dcE9Fprkj5bplH4RkYiSN chUtR5Pj/J7Eo8ubC46mOhD+8uqDXI+45i/mn17xme/0DcGxpOs5ztBOnXBgGZ2HFt+IFEeVF Tm1LhXO02vZw3W3CoL65mnNGT5UNvwYdAmZj2Kxg93CtyIMWQQg6lNH9dDUSFDp0wsO47R8Oz CSVQ3g== Received-SPF: pass client-ip=212.227.17.21; envelope-from=deller@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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 The fid instruction (Floating-Point Identify) puts the FPU model and revision into the Status Register. Since those values shouldn't be 0, store values there which a PCX-L2 (for 32-bit) or a PCX-W2 (for 64-bit) would return. Noticed while trying to install MPE/iX. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson --- target/hppa/insns.decode | 5 +---- target/hppa/translate.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) -- 2.38.1 diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode index c7a7e997f9..27341d27b2 100644 --- a/target/hppa/insns.decode +++ b/target/hppa/insns.decode @@ -388,10 +388,7 @@ fmpyfadd_d 101110 rm1:5 rm2:5 ... 0 1 ..0 0 0 neg:1 t:5 ra3=%rc32 # Floating point class 0 -# FID. With r = t = 0, which via fcpy puts 0 into fr0. -# This is machine/revision = 0, which is reserved for simulator. -fcpy_f 001100 00000 00000 00000 000000 00000 \ - &fclass01 r=0 t=0 +fid_f 001100 00000 00000 000 00 000000 00000 fcpy_f 001100 ..... ..... 010 00 ...... ..... @f0c_0 fabs_f 001100 ..... ..... 011 00 ...... ..... @f0c_0 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index d15b9e27c7..981f8ee03d 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3622,6 +3622,17 @@ static void gen_fcpy_f(TCGv_i32 dst, TCGv_env unused, TCGv_i32 src) tcg_gen_mov_i32(dst, src); } +static bool trans_fid_f(DisasContext *ctx, arg_fid_f *a) +{ + nullify_over(ctx); +#if TARGET_REGISTER_BITS == 64 + save_frd(0, tcg_const_i64(0x13080000000000ULL)); /* PA8700 (PCX-W2) */ +#else + save_frd(0, tcg_const_i64(0x0f080000000000ULL)); /* PA7300LC (PCX-L2) */ +#endif + return nullify_end(ctx); +} + static bool trans_fcpy_f(DisasContext *ctx, arg_fclass01 *a) { return do_fop_wew(ctx, a->t, a->r, gen_fcpy_f);