From patchwork Sat Oct 21 05:31:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736646 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp633897wrl; Fri, 20 Oct 2023 22:42:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJQt6AIswh1bLOZqhkxbBDknAbl7A0x/3wIgZugbdFnejKXQN39uJBM1Ut8nXXcD85AUBZ X-Received: by 2002:a37:c20a:0:b0:777:ee89:c03a with SMTP id i10-20020a37c20a000000b00777ee89c03amr3721410qkm.77.1697866940607; Fri, 20 Oct 2023 22:42:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697866940; cv=none; d=google.com; s=arc-20160816; b=bSeIjw01B8qXiZUtbOj6e1XvngNysc74fUWBgEDf8AqHRuqvOvyakmwUGqnOxK80gX JmOK5LcAn6IGAZmTzlMwcs8yQ6pV8FNO3Jzg3sNUm/WlPkeKWGS83N3Xte0p4bONJSo+ Dms957KSh+OR1X0WaC7UlLigS7QSoPG7XV4PD1KNr6a5LtnvkzLXK34QyS6KQ2VU+OG9 rQbzrVYcx2ceXa1APxb/RmpLWwECH22jjmB93ro9zmrvQ7fKUvItqMPrB5wUFRsb9Ne/ 2EQ3SUSgtksdUaIZQwkgmywVapfBlbHqhMls2cvmOvB86zPSkWDi9JIVLV5W9KIj+TmB /wWw== 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=OpzCpTAfXMeNZscs008Ujd7Y40lT8n7ROAIAfLgRoYg=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=QLK+8xlA6UwuBaSwk8htecSooxAhpevqTBaxk4E3jXtrOrQiq1fbqsEAXXbM5lEvV9 14kUHbUK+9YfGqodABjKnfa15zEJpqhe6jzgzjXAJxT39fS2LHTH2iKWHt8k7RS04TuL A8C/ndsrXLr5JZGij6j4VQcoC8BY7S9dHi73R7NDUmGn88Nz8jhvri179RmnYQyp7VQW b9f5XOK8dxUR81hWmgmhzmQyXhE98rlhrN1F/Jnst7m42Ks0EMGz+XHghEvK0Xc3xrdC P5lyOpthj+gjOWvkJDXbW+/yOBdUIy35mhblHvHTaQSVitQd8yc+lGg5LAGRewxxIe4X +HIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bRH8c3HB; 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 i7-20020a05620a144700b007749dc7ce32si2326382qkl.123.2023.10.20.22.42.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 22:42:20 -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=bRH8c3HB; 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 1qu4ht-0007bg-5U; Sat, 21 Oct 2023 01:39:29 -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 1qu4hd-00077R-93 for qemu-devel@nongnu.org; Sat, 21 Oct 2023 01:39:16 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qu4hb-0001WN-KU for qemu-devel@nongnu.org; Sat, 21 Oct 2023 01:39:13 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-5ac88d2cfaaso1177803a12.2 for ; Fri, 20 Oct 2023 22:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697866750; x=1698471550; 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=OpzCpTAfXMeNZscs008Ujd7Y40lT8n7ROAIAfLgRoYg=; b=bRH8c3HB4ODSPIKta1dkGlNyC8VSplk214fcrRP7MlBqtlqfVl0jCPRy2RjLlMFQya pmZWa82QSvziwupo4hRpSigpWdqN/7V2dVVC6CP+bfHl/ZoEem6P5l2ZUbepItQ3o+Bl 7Ny9EmKlbqLyJt9mUZfMo6F8lb07AlF9bpysheVvG+3gcX7GEqVoXdjW0SYvOlkWxVgp BCBB1foDVytGRKusUfmuMFcnh0cuBUO39WSY2QCQ2TYaDO0bY3TCgg5p0enBlVke4oW7 pu/umdEyWNch2cw/1tOCcboh90jqFKhISDdUJ160T/ytj+s+/hbx96w1QtYOGHNuR/Kb rb+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697866750; x=1698471550; 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=OpzCpTAfXMeNZscs008Ujd7Y40lT8n7ROAIAfLgRoYg=; b=dGVV6eDk/6CAZRfOwsXrd0ivVzFY62BbPzQXPXRlKVjWQPqZXuy9wA6uoqisOClR1d rj3hoyP+K8k5jc4eTORZMebrCN0fF2Vi0Fyb/jhuCuECmWAUKFCHNVEt1KzXhJ2kBw+C /uH/Jz/dm7zpfe0lV38UWV++xd2VXnvv5+K6kd2GKDULG7cSIh3YjixULc+Ah4cWvYit m1oCum0ATFdGbOqJ3pkhzonF4KIi6WsQRuNAV48l5RtRpCmzCza4yDgFN+S+MhZ/Pk2P Qt2YhF/XVUBWqyu4veOxflrN/DKSza1GKtZYyCRt7HjS10q4XRD86vJXWltx+Ohw399t DkSg== X-Gm-Message-State: AOJu0Yz9WQik999KwWnXjtgkhbE5QJC+aDMECzAhj4B3uBpcn7HKMbCh Nf7rYVyj86g64Gb3GDjCYZPZ8hd4jPwpfV04lPA= X-Received: by 2002:a17:90a:f30d:b0:27d:427f:1bf4 with SMTP id ca13-20020a17090af30d00b0027d427f1bf4mr3554816pjb.19.1697866750225; Fri, 20 Oct 2023 22:39:10 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id s15-20020a170902ea0f00b001c60a2b5c61sm2397298plg.134.2023.10.20.22.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 22:39:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 83/90] target/sparc: Move FdTOq, FxTOq to decodetree Date: Fri, 20 Oct 2023 22:31:51 -0700 Message-Id: <20231021053158.278135-84-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231021053158.278135-1-richard.henderson@linaro.org> References: <20231021053158.278135-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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 | 47 ++++++++++++++++++++++----------------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index a444819d6c..41bf7a2a33 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -267,6 +267,7 @@ FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_r2 FqTOx 10 ..... 110100 00000 0 1000 0011 ..... @r_r2 FxTOs 10 ..... 110100 00000 0 1000 0100 ..... @r_r2 FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @r_r2 +FxTOq 10 ..... 110100 00000 0 1000 1100 ..... @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 @@ -275,6 +276,7 @@ FsTOd 10 ..... 110100 00000 0 1100 1001 ..... @r_r2 FqTOd 10 ..... 110100 00000 0 1100 1011 ..... @r_r2 FiTOq 10 ..... 110100 00000 0 1100 1100 ..... @r_r2 FsTOq 10 ..... 110100 00000 0 1100 1101 ..... @r_r2 +FdTOq 10 ..... 110100 00000 0 1100 1110 ..... @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 39598514c0..05887f37d1 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -58,6 +58,7 @@ #define gen_helper_fqtox ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fxtod ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fxtos ({ qemu_build_not_reached(); NULL; }) +#define gen_helper_fxtoq ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fnegd(D, S) qemu_build_not_reached() #define gen_helper_fabsd(D, S) qemu_build_not_reached() #define gen_helper_done(E) qemu_build_not_reached() @@ -1669,19 +1670,6 @@ static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs, } #endif -static void gen_ne_fop_QD(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_ptr, TCGv_i64)) -{ - TCGv_i64 src; - - src = gen_load_fpr_D(dc, rs); - - gen(tcg_env, src); - - gen_op_store_QT0_fpr(QFPREG(rd)); - gen_update_fprs_dirty(dc, QFPREG(rd)); -} - /* asi moves */ typedef enum { GET_ASI_HELPER, @@ -4931,6 +4919,29 @@ static bool do_env_qf(DisasContext *dc, arg_r_r *a, TRANS(FiTOq, ALL, do_env_qf, a, gen_helper_fitoq) TRANS(FsTOq, ALL, do_env_qf, a, gen_helper_fstoq) +static bool do_env_qd(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_env, TCGv_i64)) +{ + TCGv_i64 src; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + if (gen_trap_float128(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + src = gen_load_fpr_D(dc, a->rs); + func(tcg_env, src); + gen_op_store_QT0_fpr(QFPREG(a->rd)); + gen_update_fprs_dirty(dc, QFPREG(a->rd)); + return advance_pc(dc); +} + +TRANS(FdTOq, ALL, do_env_qd, a, gen_helper_fdtoq) +TRANS(FxTOq, 64, do_env_qd, a, gen_helper_fxtoq) + static bool do_fff(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i32, TCGv_i32, TCGv_i32)) { @@ -5218,11 +5229,9 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x83: /* V9 fqtox */ case 0xcc: /* fitoq */ case 0xcd: /* fstoq */ - g_assert_not_reached(); /* in decodetree */ case 0xce: /* fdtoq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_ne_fop_QD(dc, rd, rs2, gen_helper_fdtoq); - break; + case 0x8c: /* V9 fxtoq */ + g_assert_not_reached(); /* in decodetree */ #ifdef TARGET_SPARC64 case 0x3: /* V9 fmovq */ CHECK_FPU_FEATURE(dc, FLOAT128); @@ -5236,10 +5245,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_ne_fop_QQ(dc, rd, rs2, gen_helper_fabsq); break; - case 0x8c: /* V9 fxtoq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_ne_fop_QD(dc, rd, rs2, gen_helper_fxtoq); - break; #endif default: goto illegal_insn;