From patchwork Sun Oct 22 23:29:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737079 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1284409wrl; Sun, 22 Oct 2023 16:40:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7D6mz+2uxAWsYPU1wNAZCeVfyftXpZJj9hnxR5KxoBuj30jYJ5wvNZ44BMC7h4VbkVaZV X-Received: by 2002:a05:622a:1a98:b0:41c:bd2c:ab80 with SMTP id s24-20020a05622a1a9800b0041cbd2cab80mr8424216qtc.51.1698018022700; Sun, 22 Oct 2023 16:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698018022; cv=none; d=google.com; s=arc-20160816; b=lX3oaeVL/WpbFEcH+Ke+6MhSTPYWBrT1FstsNnq4jm7m8MAttr2+m0jm+uCXsH4elA 66dHpk3wBy8n+DR/D/YglmBkJ4JS4iY422/6Jr4Xd4XMV7MtLpTykhB3vWf/2qHtvLGs UcUeiEHNX6UZcGGu4Xb78KJKlHhhUvai0QloPB+WaxesfuYivPQI1pwdpo7d7lMjSHxa 7Zo6H3hvhcGSZFqNCiXt5dkmoA2bbQAvXaFjSTEbyZSyoDtVgtl3wHrQLqQNk8sfX8tn eoJSKNKvTbctf6TgniUTdPnDiOjZ7pTCPu/xdWAo0Y2TkTl4C4chlBNxhMhJdG4zm9CJ f7pQ== 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=KLyabSgE8U/XwGJlHQuTE85aIrKbGKyJfPtiri+csiA=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=x+bl76lMBqtvRchjyfuMKUZf0zPhxeqUnccLNbclyaq7oM7dnQt5OgwLl6beSOHyR2 4v6PN5d+EJC6ucc4v/5Q7C3L9JIsFGLh8kDXQpc5Itpcb6w2wU8TdOqivWORUzuasEFy m8g+rxDnWjscmJlt/vjaPrD4tdwL1H6j0wcIM5bd5suGbPGZa/AiDdD6DdEisnMlqUcf 66FIaZ+HedocRg2cjBTib2qx5rGBBvnwgdZ6dLE0HfkXf4MNN1N5h8AmO82J3Ctrypu0 6mG4TE/wrwgywICLZjXGNPuvhjViRm1Cv3cA6TjkbihiER5Yg5bh2T5BLicTZXme6Pei VBoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H5Q1QPZZ; 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 e2-20020ac84e42000000b00403dd3f7113si4496519qtw.322.2023.10.22.16.40.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2023 16:40:22 -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=H5Q1QPZZ; 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 1qui0E-0007ws-BJ; Sun, 22 Oct 2023 19:37:02 -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 1qui08-0007ej-Oq for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:36:56 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qui06-0008TA-1G for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:36:56 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6bd0e1b1890so1903548b3a.3 for ; Sun, 22 Oct 2023 16:36:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698017812; x=1698622612; 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=KLyabSgE8U/XwGJlHQuTE85aIrKbGKyJfPtiri+csiA=; b=H5Q1QPZZYx0iJsqiZiAmEzYViLzh9+gGP0ckwWdCGphEtxZkD4EMdfCeup1G9qCgt0 GOzVMGqhzD9dOMUzOiaA3t0ufaZtAS01KgiYxhN8GITOxJf/TwEDV31xEbwjwlGBeJEQ APLjo4iPXPNDLELkYK6GksDbrUlmQ42detKnvAgi+dsf9ErllHk//3RiyOjrcJilXpA8 0yphV7WpLTTDNGL8GPBAkDzuMPA1UT89NDEMBrRYsjskVbmLwBWg02dmdLhCsAEpvDY6 op57tWMW7eqjsj+SyWwO93WXebSHrCkIeBvMIRfzKLYExyHebER/20ZgIppbij5KAj0C hVAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698017812; x=1698622612; 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=KLyabSgE8U/XwGJlHQuTE85aIrKbGKyJfPtiri+csiA=; b=ZTtZRfhfVG2G4UKP1WFWp0v7SGFwQVfzZgXeTei4hE5FSii84tf01imYjMqZbhf2p+ 2Jt2HjQfW7wEZ0dgwDV+G15oBElN/DxusY6tTueIihhwAFx58+h1eaCIpEKZiI1VYny7 51z2BOFuitq8OtYH9NhIGNkQmpG8smlGNBT09vbsAit+idr+ZNuUcDGUeVxU8NRKQ+Bb +HVejT51FtZpxLBgusygP3mcmFbgI2KKHwafGQ8IxJ6T22FGlTvyud9X1s3+gguW6opF 5M7WLgoXPFQL6doXKR42QodCSsI7yFoVMA0m5Gy+vu4WWuQtQ30z3Q0E8RQu1xAXCaJz UTpA== X-Gm-Message-State: AOJu0YyggzhUlb3AXka0GIc+9Tii4toPJwKg/AIWCT5xIcnrpV9pwRwF hyPyE3067uVafAyJR4efo7vxHTQr1k7P37oA5Ps= X-Received: by 2002:a05:6a00:b8e:b0:6be:4789:97ba with SMTP id g14-20020a056a000b8e00b006be478997bamr6003523pfj.3.1698017812367; Sun, 22 Oct 2023 16:36:52 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k26-20020a63ba1a000000b005b25a04cf8bsm4026861pgf.12.2023.10.22.16.36.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 16:36:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v5 92/94] target/sparc: Move FPACK16, FPACKFIX to decodetree Date: Sun, 22 Oct 2023 16:29:30 -0700 Message-Id: <20231022232932.80507-93-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022232932.80507-1-richard.henderson@linaro.org> References: <20231022232932.80507-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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 | 55 ++++++++++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 781c3cd7f7..18a840709f 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -344,6 +344,8 @@ FCMPEq 10 000 cc:2 110101 rs1:5 0 0101 0111 rs2:5 FMULD8SUx16 10 ..... 110110 ..... 0 0011 1000 ..... @r_r_r FMULD8ULx16 10 ..... 110110 ..... 0 0011 1001 ..... @r_r_r FPACK32 10 ..... 110110 ..... 0 0011 1010 ..... @r_r_r + FPACK16 10 ..... 110110 00000 0 0011 1011 ..... @r_r2 + FPACKFIX 10 ..... 110110 00000 0 0011 1101 ..... @r_r2 PDIST 10 ..... 110110 ..... 0 0011 1110 ..... @r_r_r FALIGNDATAg 10 ..... 110110 ..... 0 0100 1000 ..... @r_r_r diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 42347ac8c0..36d916943d 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -756,6 +756,24 @@ static void gen_op_array32(TCGv dst, TCGv src1, TCGv src2) tcg_gen_shli_tl(dst, dst, 2); } +static void gen_op_fpack16(TCGv_i32 dst, TCGv_i64 src) +{ +#ifdef TARGET_SPARC64 + gen_helper_fpack16(dst, cpu_gsr, src); +#else + g_assert_not_reached(); +#endif +} + +static void gen_op_fpackfix(TCGv_i32 dst, TCGv_i64 src) +{ +#ifdef TARGET_SPARC64 + gen_helper_fpackfix(dst, cpu_gsr, src); +#else + g_assert_not_reached(); +#endif +} + static void gen_op_fpack32(TCGv_i64 dst, TCGv_i64 src1, TCGv_i64 src2) { #ifdef TARGET_SPARC64 @@ -4586,6 +4604,26 @@ 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_fd(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i32, TCGv_i64)) +{ + TCGv_i32 dst; + TCGv_i64 src; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + dst = gen_dest_fpr_F(dc); + src = gen_load_fpr_D(dc, a->rs); + func(dst, src); + gen_store_fpr_F(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(FPACK16, VIS1, do_fd, a, gen_op_fpack16) +TRANS(FPACKFIX, VIS1, do_fd, a, gen_op_fpackfix) + static bool do_env_ff(DisasContext *dc, arg_r_r *a, void (*func)(TCGv_i32, TCGv_env, TCGv_i32)) { @@ -5262,10 +5300,9 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) } else if (xop == 0x36) { #ifdef TARGET_SPARC64 /* VIS */ - TCGv_i64 cpu_src1_64, cpu_dst_64; + TCGv_i64 cpu_dst_64; TCGv_i32 cpu_dst_32; int opf = GET_FIELD_SP(insn, 5, 13); - int rs2 = GET_FIELD(insn, 27, 31); int rd = GET_FIELD(insn, 2, 6); if (gen_trap_ifnofpu(dc)) { @@ -5348,21 +5385,9 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x02a: /* VIS I fcmpeq16 */ case 0x02c: /* VIS I fcmpgt32 */ case 0x02e: /* VIS I fcmpeq32 */ - g_assert_not_reached(); /* in decodetree */ case 0x03b: /* VIS I fpack16 */ - CHECK_FPU_FEATURE(dc, VIS1); - cpu_src1_64 = gen_load_fpr_D(dc, rs2); - cpu_dst_32 = gen_dest_fpr_F(dc); - gen_helper_fpack16(cpu_dst_32, cpu_gsr, cpu_src1_64); - gen_store_fpr_F(dc, rd, cpu_dst_32); - break; case 0x03d: /* VIS I fpackfix */ - CHECK_FPU_FEATURE(dc, VIS1); - cpu_src1_64 = gen_load_fpr_D(dc, rs2); - cpu_dst_32 = gen_dest_fpr_F(dc); - gen_helper_fpackfix(cpu_dst_32, cpu_gsr, cpu_src1_64); - gen_store_fpr_F(dc, rd, cpu_dst_32); - break; + g_assert_not_reached(); /* in decodetree */ case 0x060: /* VIS I fzero */ CHECK_FPU_FEATURE(dc, VIS1); cpu_dst_64 = gen_dest_fpr_D(dc, rd);