From patchwork Tue Oct 17 06:12:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 734316 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp325639wro; Mon, 16 Oct 2023 23:25:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGskNvsPePeyy21m8vFd7CfqP5MUrmUUUNuXfml5hOKioBhMcDsWdy55seWrrQGXpHF4uK7 X-Received: by 2002:a05:6214:1d0b:b0:658:9565:9736 with SMTP id e11-20020a0562141d0b00b0065895659736mr1897769qvd.56.1697523924692; Mon, 16 Oct 2023 23:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697523924; cv=none; d=google.com; s=arc-20160816; b=PcLoZIm8VUh16D6I0PsDJgM4QfaKIjdF9LndLjr7ZFI9/9lC05FlJ91y/sc1lkOx95 crRzCCUByAsjy4w/eNeMk59ttIQNox6TvHatrvxfg3D9AG3SkFDaCNVvnanoLgGq9OHx RTd+o4Toh2FMjvJB7eqrzQoU6CMVtPG+t0ZCG+naUi8WhsZPfCqjPt9mNILBwMzDw5sS /3/FsYeE/0lt9K/60hP7rgW33LySAXOM+AstCMNW+DtAe/Gp547PIC7Su1I2KvdvFL/v HOR0f07s5acJw7+Q00nyLw9J/nUK2/Jp6Rkd0ZzVoXiUjkuFit85XHe88fOWi4CXwj2d kGew== 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=np6wyp9H5bwq/rv3no32dfOhOOOhfjRybO2Ph28cMbc=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=sPu5JaA27ropkkQ7WdMjuZrYCUtFxvxN32x2NyPSjN/sU6e76rFp8ImRJRZkUAU8/9 A/HBoPMhjMXNYzVTt74ca9QS4vwGEHOk/8Q9e2l1D70ssc/jj/JXT2yTjX6L6h0A1yd1 xgTBsP4yssfGMYszvHlSWJVrecJ80R4lHCejohac1GzgEj4mEJ7gxh9ewicR2sqIINh9 8dWvnIwmsuHxQ4lhMGqyqZ/HyDbBtvB2HaIJbbhI4JYIx09jgto/bQ960PmUQFazxvxm gMPdDxfAFRyzc7xmSrIk8lv/qCnVdhH9pymhpkaMOp4Z7kEezr4wAtXM3mxihjUReqps mGvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yH0Dn3hU; 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 g14-20020a0cf84e000000b0065afb72d696si530828qvo.454.2023.10.16.23.25.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2023 23:25:24 -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=yH0Dn3hU; 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 1qsdRx-0006SO-Bv; Tue, 17 Oct 2023 02:21:05 -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 1qsdR2-0003hj-D6 for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:20:12 -0400 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qsdQp-0005Bo-LC for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:19:57 -0400 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3af609c3e74so3555398b6e.2 for ; Mon, 16 Oct 2023 23:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697523594; x=1698128394; 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=np6wyp9H5bwq/rv3no32dfOhOOOhfjRybO2Ph28cMbc=; b=yH0Dn3hUN3GfrEMRc3x+yLYG40Q1yYrwLfxWJKF2ZlZ+jmKPNIhhc1zGjKYvMR2Bxc NTVKzc1378bW5ghBlGc7njdc4UoN9OHMio0C0gigbER6mgUVMqCuYLJlLc/DCQIIbPpv waagnnyj9596Ttox+xskDUk5B97w6suf7cHQV7bG/wRPwSL3ySWJO/UDGIefYfCCIVdY 5u8UaEqeMWB6+a7iYzQzn/0wL/AS/znwODgYcbHm+d47gmoJ5Q3lZY0lEm91Cx2IufKO RVTplWNOpNG64f//e2APdG7k4g5gZuoc0IkG3kmM2gDT0PuRD4mN9P/5anHgLd58laZi 34qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697523594; x=1698128394; 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=np6wyp9H5bwq/rv3no32dfOhOOOhfjRybO2Ph28cMbc=; b=dWySW5FPOlnB2ex/F1pBfgA92LALZbnjqtOdYRQcToqO8S2qUOND6FFCoATufd/AbT 3VeYmW1rb91kYHy8KvG7WXPSsTJLilC/OX5lDZ/uE49EaUsGQXXa6CK6+DLRJk+McOeU YBbxIeySr2SZVv2Gh+hTJT0cx4HlpnD4HHjjVbqRDQfE1xFP1wux+IlCvnAd2Zj6CY8d JgakKdPCecXJzMWmYDOLQrxypJoEvh0u92/rtkLtLBcRMR6+mwI1Z+G860vyvls8oN/w bsW4Vr3MbUXiK3rVLe7aCvt1qslCiFKIwJG317/3MsoZOErYKrf8JdVmwNmq0VUBV423 SiAQ== X-Gm-Message-State: AOJu0Ywd9KBxtnPnLAz1Jp+MFqlKxsbcQokB8pLU6M+rVOmeWE9cOyax rILOm4ChzI6cjUHdyoumhn24mz8o9xOnAxnPMKU= X-Received: by 2002:a54:4103:0:b0:3a7:30cb:c092 with SMTP id l3-20020a544103000000b003a730cbc092mr1481350oic.48.1697523594051; Mon, 16 Oct 2023 23:19:54 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id by2-20020a056a02058200b00588e8421fa8sm550331pgb.84.2023.10.16.23.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:19:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 80/90] target/sparc: Move FqTOs, FqTOi to decodetree Date: Mon, 16 Oct 2023 23:12:34 -0700 Message-Id: <20231017061244.681584-81-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::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.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 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 1965084fb8..d890d97f12 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -261,10 +261,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 395674d901..3d073c8b22 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1626,20 +1626,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)) { @@ -4869,6 +4855,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)) { @@ -5150,11 +5160,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); @@ -5171,10 +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 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);