From patchwork Thu Oct 26 00:15:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738301 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp560425wrq; Wed, 25 Oct 2023 17:42:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGN9A9pBxnhjbkuCAezhX4fc5SJFxsuFLlybRQSpWDp+4M7k1B97V/wxQArp9NhbVS1c6pp X-Received: by 2002:a05:622a:134d:b0:41c:c692:e3ed with SMTP id w13-20020a05622a134d00b0041cc692e3edmr22847093qtk.34.1698280968680; Wed, 25 Oct 2023 17:42:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698280968; cv=none; d=google.com; s=arc-20160816; b=kGbbwE0D1d+eYcQTvfKGfmFnYVeq3c/GTqOuzshi4a52WOgf6BIKo3+syVqZckd4sR E9dexAdzUCCMk+SJMPHVNZCfk218SyghmPgvT01Qy55gyux63aPM1Fhi60sF7CxRTXPn Aga/COMQxNYnVuQnTGjZwSWji5KoCUDLK86q6YVYWJGauH5Nyup0Lfj+daLZccbvI4Qi 5KM/MBDTKj0mwB9/dAFn/yZbnRiOksF4JHyCX8Jby8zTBNnIHBkBZs5F8sMP4XjIQWdt blLmWoppY0MjSr5N5wv7h8g+ny5Yms/sOTeQhy7q4ncktDMUgF6KRqrpxXFPKTkGKE5D uM5A== 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=z6FFXra1EildNrILVO+FVSvaerCZUInRPG0JCvbw9Rk=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=GpudYrv+qLv8A2aAM/DxMjX6dXfHJMdGYwmOkFbc8eDa8XWpsJEQLpkfFTawsEl/at HMoZI/n2DzEPkb9BTU1Vvkb01orgKk07alTjkva34LgMGCypbJ9RNjyLanjqe3WoZv6/ ROEtR7VmovCMUtJT+qkAbc8+778ydSBLncQiDX4NWDquePyjeer4Cl2Hd4tycLZ2uM7N goQEi7tOxE1PZnG1qd9ztuWjpolA2nsvITseGgeXfWqxpEFaXPxtacvbne5pTYtFohEH 8Pwmva7YbufQ1hQhVIgVSrNhr0mjydLMqpKAklYk8JQNBxqvyIBu23OxOMi0pJq9aCtR YrxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MwY3RNX0; 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 b2-20020a05622a020200b00403b84a6bbasi8668234qtx.385.2023.10.25.17.42.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:42:48 -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=MwY3RNX0; 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 1qvo9x-0003kz-Uz; Wed, 25 Oct 2023 20:23:38 -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 1qvo9j-0003Dr-1r for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:23:24 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo9d-0008Gj-3G for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:23:22 -0400 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-27cefb5ae1fso224188a91.3 for ; Wed, 25 Oct 2023 17:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279795; x=1698884595; 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=z6FFXra1EildNrILVO+FVSvaerCZUInRPG0JCvbw9Rk=; b=MwY3RNX0fdf65PHEhMfgC7D+OKpP85IHYq618u7fhfxFz7wug8jqHn5yVPMbZ2KgfQ kOv/3OSrfKxmcZVthX3fAuEP/EklN1FC8ci6YDPOQyWGhRDEt2zsYDR+WGjZ5RG+IlPe ccElCcTU3JYSDfZhGalDN6JIKcok9bS5hwwIQ3+2LPpS2YiI3SCYNNKks42+2t2/rstJ eq4rK7o8oUPklPQoo7U5zLNcE3RXNZDEg92l6778dBOIjL04MdjSq6Pos2DlhgoABkR0 iXVQQ2QBw+pvU+gRb5T6Da4h9JXwF0RIlAHF/EQeI/mtwBXQX/Ry5Hu6UMOb++6oiLa1 CSog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279795; x=1698884595; 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=z6FFXra1EildNrILVO+FVSvaerCZUInRPG0JCvbw9Rk=; b=uuWaUVNTimHh8YUer7lNmRhfoyF/fjaUb8cFD873jBMmkVu5J1scmBPX1GEkd+BUiy tgg9lGzW9Y6JwU2NQxxIWfBwAYS/dV4oOsFFsvOSVaBAhnnsHed71RXEW9Wsy88q+gy+ UboRDs0bVnIjDzBTspLwoqbPIa1bfnx8Lm6q1eGdyqWO3NFh6q5jtVuksS/34cSzQ1My UuQ8imfKRV8w/RUa4+3GDNRGSKOcBHvf1LV5MsptUKSw5uAtf5wc5UBpd0I2X3pnEhZz HI9cait4Ljrsz9nzeHHjNiramZNzSm7WhqYJo5rqVxCL3M5D+mrLv5TmeVPi/tQe+Gro +fKA== X-Gm-Message-State: AOJu0YwdrweWhQUHqPk0syZPdNNytfyiFJCq2Henwftvub/+hpO/3oa2 ZvJp23iNemhkEMw30LLQDi6LK8JNLWZLq1HPWqM= X-Received: by 2002:a17:90b:2311:b0:27e:3ae3:eae0 with SMTP id mt17-20020a17090b231100b0027e3ae3eae0mr10131883pjb.16.1698279795584; Wed, 25 Oct 2023 17:23:15 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id 9-20020a17090a0cc900b0027463889e72sm499870pjt.55.2023.10.25.17.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:23:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 84/94] target/sparc: Move FqTOs, FqTOi to decodetree Date: Wed, 25 Oct 2023 17:15:32 -0700 Message-Id: <20231026001542.1141412-114-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::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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 Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 2 ++ target/sparc/translate.c | 48 +++++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index ee9262061b..33f0c738e6 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -268,10 +268,12 @@ FxTOs 10 ..... 110100 00000 0 1000 0100 ..... @r_r2 FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @r_r2 FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2 FdTOs 10 ..... 110100 00000 0 1100 0110 ..... @r_r2 +FqTOs 10 ..... 110100 00000 0 1100 0111 ..... @r_r2 FiTOd 10 ..... 110100 00000 0 1100 1000 ..... @r_r2 FsTOd 10 ..... 110100 00000 0 1100 1001 ..... @r_r2 FsTOi 10 ..... 110100 00000 0 1101 0001 ..... @r_r2 FdTOi 10 ..... 110100 00000 0 1101 0010 ..... @r_r2 +FqTOi 10 ..... 110100 00000 0 1101 0011 ..... @r_r2 { [ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index e71b41e196..37405df926 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1671,20 +1671,6 @@ static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs, } #endif -static void gen_fop_FQ(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_i32, TCGv_ptr)) -{ - TCGv_i32 dst; - - gen_op_load_fpr_QT1(QFPREG(rs)); - dst = gen_dest_fpr_F(dc); - - gen(dst, tcg_env); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_store_fpr_F(dc, rd, dst); -} - static void gen_fop_DQ(DisasContext *dc, int rd, int rs, void (*gen)(TCGv_i64, TCGv_ptr)) { @@ -4782,6 +4768,30 @@ static bool do_env_qq(DisasContext *dc, arg_r_r *a, TRANS(FSQRTq, ALL, do_env_qq, a, gen_helper_fsqrtq) +static bool do_env_fq(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i32, TCGv_env)) +{ + TCGv_i32 dst; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + if (gen_trap_float128(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + gen_op_load_fpr_QT1(QFPREG(a->rs)); + dst = gen_dest_fpr_F(dc); + func(dst, tcg_env); + gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); + gen_store_fpr_F(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(FqTOs, ALL, do_env_fq, a, gen_helper_fqtos) +TRANS(FqTOi, ALL, do_env_fq, a, gen_helper_fqtoi) + static bool do_fff(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i32, TCGv_i32, TCGv_i32)) { @@ -5063,11 +5073,9 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0xc8: /* fitod */ case 0xc9: /* fstod */ case 0x81: /* V9 fstox */ - g_assert_not_reached(); /* in decodetree */ case 0xc7: /* fqtos */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_fop_FQ(dc, rd, rs2, gen_helper_fqtos); - break; + case 0xd3: /* fqtoi */ + g_assert_not_reached(); /* in decodetree */ case 0xcb: /* fqtod */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_DQ(dc, rd, rs2, gen_helper_fqtod); @@ -5084,10 +5092,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 0xd3: /* fqtoi */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_fop_FQ(dc, rd, rs2, gen_helper_fqtoi); - break; #ifdef TARGET_SPARC64 case 0x3: /* V9 fmovq */ CHECK_FPU_FEATURE(dc, FLOAT128);