From patchwork Sat Oct 21 05:31:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736659 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp634565wrl; Fri, 20 Oct 2023 22:45:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEJNBrYBzOEhKjo9y+oyU5RfXBmNFGcZ9iWNQCO5U4bMLXCnVt8Cp2cT1VlZVFILiZnfwn X-Received: by 2002:a05:6214:486:b0:66d:33e1:e480 with SMTP id pt6-20020a056214048600b0066d33e1e480mr4743556qvb.59.1697867151717; Fri, 20 Oct 2023 22:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697867151; cv=none; d=google.com; s=arc-20160816; b=NkJ0vmXYdQbUI1KoxJR34SjT5EsUJNZ7onYsB+aP+uu0xDKtZqTPIw5NkuMVrhia0P k4S44M9YPjmSOVz8duaWEXXwX61UrqGAtpRTZBxB5OSrohOlgtiNhoe9qdd0IVQixFr8 Iqmpc5mfCZbF++kJDiK/ylJ3Og/LB5lN1GVPJNOdtNR9tKs44oZOtwQxqgXnbAObfH4M zfWcHRzTBQu7fCbXygrrxU/VOqZ2gtbqo3NKY+F/Rayc5Yj7xbhLZ2fRalL/qmM8Xcvm Rikcm0/nQy57AH5Pnw6StEUBpnLGgxAECaA98J8tuTLdWUhAzXNGCXL3Nu9TeooZsyQ/ /MUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=q9RlYjd39ntouf7hPUOdyU/Qywc9Z9jeRpzjr/dBnsc=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=fUglRiONv7h2/Lpp+ncyRsARPHbfbQXuwGQ3pK2V7L/hA4bVMsFTT0XWnoYXLTYU2n lp0owSr+cS3wRkXDRzX59jQQmSWmpbUNY35LKT6P0yqrr9hHoC2RsppU+k+qLtC4ll9c I6lq1MhTddBzBF+gLJhnWcg0heuvREVpyg9RKeomOnw/vUmGQtriicPuhk/qzlo1GeqT qh6o4YDjPIKNAQs+NnpfgMhht3b4upHeOS5Vrdb4AOt6LlYaOohDkwbFUb5kJBMvjKmE AaqRQXTSa9ltGaFxnYmNWwFk/Y58mQtSFmtTbnPdiYOfEKhWajs/Wilp6yCMAZ/cYWi/ +p+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MYWhB/fJ"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id eh14-20020a056214186e00b0064cd41b2cf3si2481261qvb.25.2023.10.20.22.45.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 22:45:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MYWhB/fJ"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qu4ec-0003Mw-Pk; Sat, 21 Oct 2023 01:36:06 -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 1qu4eY-0003KE-Ps for qemu-devel@nongnu.org; Sat, 21 Oct 2023 01:36:02 -0400 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qu4eW-0001AW-BS for qemu-devel@nongnu.org; Sat, 21 Oct 2023 01:36:02 -0400 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3af609c4dfeso1054178b6e.1 for ; Fri, 20 Oct 2023 22:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697866558; x=1698471358; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=q9RlYjd39ntouf7hPUOdyU/Qywc9Z9jeRpzjr/dBnsc=; b=MYWhB/fJfXEiRMpfby7j2V6ECBEMxV3MT4rQU+zgKRQx2XvjdanKY1Murkk/UnflhP bvdi5odMObkjR1hzjjcNptqp0EvIjaO9hbadnw4LlqAxva4uUO7XX/ZmT6H0N6XNh5/a +hd+qxPWLsdo59LPT8NyiSz/zvtd773uveUah9w2EMa9xxIWx3DWnxMR0LHVxWA8QEuQ tIyr7WiBefwAwWYJQQFxXsnj/49R927zaplv8uYa8x5Fq//rPnStdSdwlBppcqPkNNJ9 o9q9e0A8erCCdkKe3HkEjBfnTtU5GCMYpt/IFXJewNOHIL27c7h7Qg0+DDx+di9HvGu9 uBEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697866558; x=1698471358; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q9RlYjd39ntouf7hPUOdyU/Qywc9Z9jeRpzjr/dBnsc=; b=M8fLoZtb6LN4sgfmNXtVrZgHLtAiI7KVHDmnM9ZA7kdWEYHZyAlwcTYYEPGZFNO4p0 GE1L0E/fmLE5HVtLgST4h6l5jo4iN5OtuStDoZV5W/9TNHnoIEk235qIlqFAXpnO3r2k gPGneXpSYjHK5VboHobU5SiwRtEJAstJYa6GgDtvB0eAUOWoxGSxuJ9/ONnGpxTX+8Vt P2OTRDj3sXnIcIqahGatrk4e2mrPyb07HAK/EMkhgzZaDmkxlY5HUKD4nvGpN9AOkeR3 S8zIwNtoIM0xyzIEcHqPqZ2CnqLNICRp68WU8tWzzLYnP1b71Cl3gQLRypmY0RZTjOBa 9LWQ== X-Gm-Message-State: AOJu0Yz8LPuqDgPHO6X2r0dAG5b87sgKFXHNCAAY9vZSkDsqtH86Omyq rEjrCEsjAfYmbrRQfz6J38rEhjEQWa63qbJeDko= X-Received: by 2002:a05:6808:1141:b0:3ab:870d:2d49 with SMTP id u1-20020a056808114100b003ab870d2d49mr5342120oiu.8.1697866557976; Fri, 20 Oct 2023 22:35:57 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id h1-20020a62b401000000b00690d255b5a1sm2427978pfn.217.2023.10.20.22.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 22:35:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 70/90] target/sparc: Move gen_fop_FF insns to decodetree Date: Fri, 20 Oct 2023 22:31:38 -0700 Message-Id: <20231021053158.278135-71-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231021053158.278135-1-richard.henderson@linaro.org> References: <20231021053158.278135-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22c; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Move FSQRTs, FiTOs, FsTOi. Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 3 +++ target/sparc/translate.c | 47 ++++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 4e15bfacfb..76186bddf0 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -245,6 +245,9 @@ FNEGs 10 ..... 110100 00000 0 0000 0101 ..... @r_r2 FNEGd 10 ..... 110100 00000 0 0000 0110 ..... @r_r2 FABSs 10 ..... 110100 00000 0 0000 1001 ..... @r_r2 FABSd 10 ..... 110100 00000 0 0000 1010 ..... @r_r2 +FSQRTs 10 ..... 110100 00000 0 0010 1001 ..... @r_r2 +FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2 +FsTOi 10 ..... 110100 00000 0 1101 0001 ..... @r_r2 { [ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index fccfe1d53e..f6d6e8b746 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1650,20 +1650,6 @@ static int gen_trap_ifnofpu(DisasContext *dc) return 0; } -static void gen_fop_FF(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_i32, TCGv_ptr, TCGv_i32)) -{ - TCGv_i32 dst, src; - - src = gen_load_fpr_F(dc, rs); - dst = gen_dest_fpr_F(dc); - - gen(dst, tcg_env, src); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_store_fpr_F(dc, rd, dst); -} - static void gen_fop_FFF(DisasContext *dc, int rd, int rs1, int rs2, void (*gen)(TCGv_i32, TCGv_ptr, TCGv_i32, TCGv_i32)) { @@ -4923,6 +4909,27 @@ TRANS(FABSs, ALL, do_ff, a, gen_op_fabss) TRANS(FSRCs, VIS1, do_ff, a, tcg_gen_mov_i32) TRANS(FNOTs, VIS1, do_ff, a, tcg_gen_not_i32) +static bool do_env_ff(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i32, TCGv_env, TCGv_i32)) +{ + TCGv_i32 tmp; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + tmp = gen_load_fpr_F(dc, a->rs); + func(tmp, tcg_env, tmp); + gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); + gen_store_fpr_F(dc, a->rd, tmp); + return advance_pc(dc); +} + +TRANS(FSQRTs, ALL, do_env_ff, a, gen_helper_fsqrts) +TRANS(FiTOs, ALL, do_env_ff, a, gen_helper_fitos) +TRANS(FsTOi, ALL, do_env_ff, a, gen_helper_fstoi) + static bool do_dd(DisasContext *dc, arg_r_r *a, void (*func)(TCGv_i64, TCGv_i64)) { @@ -5084,10 +5091,10 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x2: /* V9 fmovd */ case 0x6: /* V9 fnegd */ case 0xa: /* V9 fabsd */ - g_assert_not_reached(); /* in decodetree */ case 0x29: /* fsqrts */ - gen_fop_FF(dc, rd, rs2, gen_helper_fsqrts); - break; + case 0xc4: /* fitos */ + case 0xd1: /* fstoi */ + g_assert_not_reached(); /* in decodetree */ case 0x2a: /* fsqrtd */ gen_fop_DD(dc, rd, rs2, gen_helper_fsqrtd); break; @@ -5143,9 +5150,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QDD(dc, rd, rs1, rs2, gen_helper_fdmulq); break; - case 0xc4: /* fitos */ - gen_fop_FF(dc, rd, rs2, gen_helper_fitos); - break; case 0xc6: /* fdtos */ gen_fop_FD(dc, rd, rs2, gen_helper_fdtos); break; @@ -5175,9 +5179,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_ne_fop_QD(dc, rd, rs2, gen_helper_fdtoq); break; - case 0xd1: /* fstoi */ - gen_fop_FF(dc, rd, rs2, gen_helper_fstoi); - break; case 0xd2: /* fdtoi */ gen_fop_FD(dc, rd, rs2, gen_helper_fdtoi); break;