From patchwork Thu Oct 26 00:15:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738281 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp559252wrq; Wed, 25 Oct 2023 17:38:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4yXK606cl26iI93hFPwCpE79wttxggkgUWsNuRg6TOIn57v87CdQf8VR5hTvqfXTryiQC X-Received: by 2002:a5d:548c:0:b0:32d:9395:dec2 with SMTP id h12-20020a5d548c000000b0032d9395dec2mr11885205wrv.71.1698280724052; Wed, 25 Oct 2023 17:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698280724; cv=none; d=google.com; s=arc-20160816; b=hdhqp61di1veUA1bT3Th1hNxwEl2DdCP1Ey/pR3wllDDu72h20i1LrujrRx7kTiMIm ZUjcfWxlmWDMQsEQ7iyxoZpVmKJW1q0xhGSfBXZwBlOOmCauNORkQkEktLFX0hRHc3EX eIm2DTsyyavWz/pOJAZPxIO0xabrOYTOYhkxUAwSq1ipdWntLizS+B90LaESNtzc+A57 QFbaUfSptbBMw1AWtxtRgPgAY/OCRRjJwUHGLJcAAu4xD5kXvw+OYH2Y4b06GkndCZgr Ntlddepe0zIHlEcF1v/n5vdKuOa9/Ypt1aPSGhaiaS6DmoJd9fTC0jICCWj8KPJj44kW 8LMw== 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=2Vu8uE4u91cXAtlNEMc67KwdFgVsES8vkFmIj+yngHw=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=pUEUHEC/JxaDPxWg6/MLwKRByFeAtLasUDMYGZ3APKEbufjaIRau0D4uC32sgp/7Wc jfoJUGSv8AJPZ584ma77KoC0IZ4HaIyZkh50FS+zrtgUWiCIV0eyBamS3qQOZsk+LdPf +T801DbBZZcXo9jMDUzp/M+EN8zCZbIoCmWE08CmZVZ1Frfn5RzMTibxPAZcmztqvW8W EBmsYNUP34SyznMLrrJOJlDbGE9NFfue6whN46NFgPwEPaBq3mRwevbGsPtKpNBiQSeu KKtRUO3s0JzmlOOaatLl4wQnNT5XHjNeO+hTjoTTLoyQNUnHYnaDjUpi11CtUYFyHOHL hKOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iFbAkQmY; 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 l2-20020adfe9c2000000b0032d9ef6ce33si8111483wrn.752.2023.10.25.17.38.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:38:44 -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=iFbAkQmY; 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 1qvoAc-0006s3-4a; Wed, 25 Oct 2023 20:24:18 -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 1qvo9b-0002mi-03 for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:23:16 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo9X-0008FL-Qq for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:23:14 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-27d0a173e61so248479a91.0 for ; Wed, 25 Oct 2023 17:23:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279790; x=1698884590; 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=2Vu8uE4u91cXAtlNEMc67KwdFgVsES8vkFmIj+yngHw=; b=iFbAkQmYiTlvqNfnQCGrSTy8wkXUqpb/oPDad81H8CTUs/2mbT1vAnkuoCNfjZwzdZ 4ZTFFJVJ8gU6hPoj5IfyZ3hq1DjHw7nRUMR/hnMwfNmpYEwXMVm+dre/fpovFqta0jCi 5FcN4wd8dSpchBNXYVyQ55jyPQJ4HDfpHQHg5Ugxg+x0PdbOXUJ0JUwI2O10nbVoefrO yX1lm3k7ntWo8OmvSEK647tFuoJV6kOuKIT+LYHRSdSN2vAYgzzLHg2LdJuYocdocWo/ 2fiME/CSn5l6MeC6kcqKHLC/iJlZl03qjuLFEl6jPayziJe0R4yMPAsKGsF7ONZqaOnC +SXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279790; x=1698884590; 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=2Vu8uE4u91cXAtlNEMc67KwdFgVsES8vkFmIj+yngHw=; b=o2xzNJrflODygXigyY85Qe0D5mZ+CSHqyBgr+XcgjKq6Yb5JiIUp5wfegSgAN3DLJa HKUbHKH2cauqz+VzVLwq7pOG8FMxVnwPPWSPJ9kmNlsDs9di51NPiQWQEaCds0nXgvST dY44KpKZin9gjSQXitFaVZlF6slANqlqw/R98VA3ZLdfQbez+kbvjByYEJf4JiN9HBjO 9zz2Tx6tJpl3bDU4Ebolo24YN8USvDWUoqxes8sTTorn7z2IxFdtoRCVdnxtIuHOL2ds Cvll/U/SS7qbYqDgNEplBIYbJPJBa0IuMNgLWWlxIo92usle3vGXKg+pwU9xmWF5D0rY ZHkg== X-Gm-Message-State: AOJu0YwRIIUbRe2zNWLFmeUg8O+FO2eVT1lXOPMnjJi2LKtVHD6B6qUP JzpYlVlwvD5JzgcrzF4fuJfLUlMhB5+BynWDOr0= X-Received: by 2002:a17:90a:194b:b0:27d:1ea0:bc84 with SMTP id 11-20020a17090a194b00b0027d1ea0bc84mr13636473pjh.34.1698279790409; Wed, 25 Oct 2023 17:23:10 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id 9-20020a17090a0cc900b0027463889e72sm499870pjt.55.2023.10.25.17.23.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:23:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 77/94] target/sparc: Move gen_fop_FFF insns to decodetree Date: Wed, 25 Oct 2023 17:15:25 -0700 Message-Id: <20231026001542.1141412-107-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026001542.1141412-1-richard.henderson@linaro.org> References: <20231026001542.1141412-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 FADDs, FSUBs, FMULs, FDIVs. Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 4 +++ target/sparc/translate.c | 54 +++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 4cb250265d..09444e313f 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -248,6 +248,10 @@ FABSd 10 ..... 110100 00000 0 0000 1010 ..... @r_r2 FSQRTs 10 ..... 110100 00000 0 0010 1001 ..... @r_r2 FSQRTd 10 ..... 110100 00000 0 0010 1010 ..... @r_r2 FSQRTq 10 ..... 110100 00000 0 0010 1011 ..... @r_r2 +FADDs 10 ..... 110100 ..... 0 0100 0001 ..... @r_r_r +FSUBs 10 ..... 110100 ..... 0 0100 0101 ..... @r_r_r +FMULs 10 ..... 110100 ..... 0 0100 1001 ..... @r_r_r +FDIVs 10 ..... 110100 ..... 0 0100 1101 ..... @r_r_r FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_r2 FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @r_r2 FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 93efdf3383..d2205f7e7d 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1656,21 +1656,6 @@ static int gen_trap_ifnofpu(DisasContext *dc) return 0; } -static void gen_fop_FFF(DisasContext *dc, int rd, int rs1, int rs2, - void (*gen)(TCGv_i32, TCGv_ptr, TCGv_i32, TCGv_i32)) -{ - TCGv_i32 dst, src1, src2; - - src1 = gen_load_fpr_F(dc, rs1); - src2 = gen_load_fpr_F(dc, rs2); - dst = gen_dest_fpr_F(dc); - - gen(dst, tcg_env, src1, src2); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_store_fpr_F(dc, rd, dst); -} - static void gen_fop_DDD(DisasContext *dc, int rd, int rs1, int rs2, void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i64, TCGv_i64)) { @@ -4883,6 +4868,29 @@ TRANS(FXNORs, VIS1, do_fff, a, tcg_gen_eqv_i32) TRANS(FORNOTs, VIS1, do_fff, a, tcg_gen_orc_i32) TRANS(FORs, VIS1, do_fff, a, tcg_gen_or_i32) +static bool do_env_fff(DisasContext *dc, arg_r_r_r *a, + void (*func)(TCGv_i32, TCGv_env, TCGv_i32, TCGv_i32)) +{ + TCGv_i32 src1, src2; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + src1 = gen_load_fpr_F(dc, a->rs1); + src2 = gen_load_fpr_F(dc, a->rs2); + func(src1, tcg_env, src1, src2); + gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); + gen_store_fpr_F(dc, a->rd, src1); + return advance_pc(dc); +} + +TRANS(FADDs, ALL, do_env_fff, a, gen_helper_fadds) +TRANS(FSUBs, ALL, do_env_fff, a, gen_helper_fsubs) +TRANS(FMULs, ALL, do_env_fff, a, gen_helper_fmuls) +TRANS(FDIVs, ALL, do_env_fff, a, gen_helper_fdivs) + static bool do_ddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64)) { @@ -5000,10 +5008,11 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x82: /* V9 fdtox */ case 0x88: /* V9 fxtod */ case 0x2b: /* fsqrtq */ - g_assert_not_reached(); /* in decodetree */ case 0x41: /* fadds */ - gen_fop_FFF(dc, rd, rs1, rs2, gen_helper_fadds); - break; + case 0x45: /* fsubs */ + case 0x49: /* fmuls */ + case 0x4d: /* fdivs */ + g_assert_not_reached(); /* in decodetree */ case 0x42: /* faddd */ gen_fop_DDD(dc, rd, rs1, rs2, gen_helper_faddd); break; @@ -5011,9 +5020,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_faddq); break; - case 0x45: /* fsubs */ - gen_fop_FFF(dc, rd, rs1, rs2, gen_helper_fsubs); - break; case 0x46: /* fsubd */ gen_fop_DDD(dc, rd, rs1, rs2, gen_helper_fsubd); break; @@ -5021,9 +5027,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fsubq); break; - case 0x49: /* fmuls */ - gen_fop_FFF(dc, rd, rs1, rs2, gen_helper_fmuls); - break; case 0x4a: /* fmuld */ gen_fop_DDD(dc, rd, rs1, rs2, gen_helper_fmuld); break; @@ -5031,9 +5034,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fmulq); break; - case 0x4d: /* fdivs */ - gen_fop_FFF(dc, rd, rs1, rs2, gen_helper_fdivs); - break; case 0x4e: /* fdivd */ gen_fop_DDD(dc, rd, rs1, rs2, gen_helper_fdivd); break;