From patchwork Tue Oct 17 06:12:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 734327 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp326322wro; Mon, 16 Oct 2023 23:27:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFA4GlPN2lBzJ6OdZo65IU0OHwjbCZSySrmmPmxAVAtssMc732/Z4T728TF/z70FossPjj X-Received: by 2002:a05:622a:1006:b0:417:b901:91a7 with SMTP id d6-20020a05622a100600b00417b90191a7mr2043724qte.24.1697524061481; Mon, 16 Oct 2023 23:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697524061; cv=none; d=google.com; s=arc-20160816; b=tv7pJlCWFzww7tFASUeiLHq0JJB22AuKnl2ifu9jZXWOUCjv+2++00Z1iOXhmV/QmQ 8IBxKRGZY21VO5NqhckOp8twu3+VHB2sC0J8uH2zKNEmpz81RntA/brQy121MGcYk4XM dyGtm9EzA7nx6tKrf1FW+5ttRObMhiG9cqezTMgbwkQ0kziVyynKWQxrPp4wPWavisMR Ww3vRFBDv9FPxpeVFBS+t8bmyGJtrvzocqyQwnfKrCIYudng1X3IVHMm6ckNoBnmkVmp +IJibfL2vapMS15xGGwYET3htvIGuu1vyj4ZoBIMcPqUtf/EXEuuT7QT+7hyAQ2KDHb5 dN6A== 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=fwVmSHeYexn71dvX+8E6usFelzw3up8bbDGmKt8+qZ4=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=ZrQXK6E4dyNR7RVBGwkvHbBPjAovJoDlxGuVDr5o/jvqlBILYF5kRxFnBAcjl6J2O8 8n1H0blx+Q/OVeIh+tRyqjIGyKKqMMRJcru/7Zbw8k3nlGCYMIGh1ETJgCKWzPfce0ss fcYG6qYbvz+8gPk0RnWi3IdQihrBJzcfY6KwTsrVJNjOj2eRcMvUWT4nzQ0eIFAcclvM M9Sd4jCUWQ3npOF5gxTA4IxGJu12iitOGp/LCTZn+YOmBAzm3Hwa8vh1vvHDm1di+oDo VzqfjNP5MF++ixBOCNGsUTjc6o8V5hcB61taez+4FtVr6zg3YCMHwAlG4TVvTvSpp1Xn q4sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dntQXuWF; 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 y3-20020a05622a004300b0041b7773ee44si684135qtw.443.2023.10.16.23.27.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2023 23:27:41 -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=dntQXuWF; 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 1qsdNu-0003fD-UW; Tue, 17 Oct 2023 02:16:54 -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 1qsdNq-0003T9-8i for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:16:50 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qsdNm-0004nR-Qo for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:16:49 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6be0277c05bso1395169b3a.0 for ; Mon, 16 Oct 2023 23:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697523405; x=1698128205; 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=fwVmSHeYexn71dvX+8E6usFelzw3up8bbDGmKt8+qZ4=; b=dntQXuWFDPWlreCAU6lzkMjiFOCQVudOkHA4LIptVHuuAOqWVbqQU3jcG/G9V00yCM OW5nDihy9ja+iTibpw2whwxdik7gCGbXfCd1dw/hRetwN8LsXWAFbjtXttFizP68ymws DWIgQ7w+aj2bkt+8CHeWJ3U2DwEwa+Q1P0/qi/+CrmDf+jyzaD5CDkCe+Yw8dHhEnzrA HumxSsflnCLUg2v5lHNueX9ckHaaK5dxM3y70aWUI4g0YU8DF9BhzsXEXTW3H2sJgNI4 UJoHkE4W7qoP3GnxyyEMP3BcqTFbNbywcxzBKClA29wYfWVFzHRjMrhpV/ILzcEyvt3D t3Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697523405; x=1698128205; 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=fwVmSHeYexn71dvX+8E6usFelzw3up8bbDGmKt8+qZ4=; b=hknqXpF+QPx9VsmKkleSBpwPFLxkDsUjBSYzhD9klZzzD8ZgDfUxCVlwKf4YBBnIJ2 EhOoqxuCZWwIStjErkLtETUypRWgu2FcANoRE4OS5EYfJJm07XKszZNubGEkU9tJM3dY /T+wv8Jw0F1AcXWQ8VQurps3QUc48r6ec7VBkBCrcbYrYGMo2gvTmMdcvIGbu8DXeap7 cSkBYiISsLkTFbgTBDLUpWc1ved1Za6zagnn+VzB767jP/i4uaSdTXEKd7/Fo3FN0ZUV Evd33nM/E64cv0KxNtBXN4pHbS5M4eHZs287jrtnFa1NPk60/9V8PIZCgtdtkcQtYb5H bIVg== X-Gm-Message-State: AOJu0Yy2wcxGUd5HpmCPmECRAa4Wk+j8dVVzsgM8eEr6xvni1mqRKIZR SnpMUUQXDBcjrz9hBB4oVTtCJbeQ3h7Sk6G7ZdE= X-Received: by 2002:a05:6a00:1827:b0:6be:2e07:5c5c with SMTP id y39-20020a056a00182700b006be2e075c5cmr1397372pfa.20.1697523405296; Mon, 16 Oct 2023 23:16:45 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id m10-20020a056a00080a00b00690ca4356f1sm579280pfk.198.2023.10.16.23.16.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:16:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 70/90] target/sparc: Move gen_fop_FF insns to decodetree Date: Mon, 16 Oct 2023 23:12:24 -0700 Message-Id: <20231017061244.681584-71-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017061244.681584-1-richard.henderson@linaro.org> References: <20231017061244.681584-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 966cda6680..4f10809e98 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -238,6 +238,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 cd585b77bc..6707164207 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1608,20 +1608,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)) { @@ -4892,6 +4878,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)) { @@ -5053,10 +5060,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; @@ -5112,9 +5119,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; @@ -5144,9 +5148,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;