From patchwork Fri Oct 13 21:28:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 733330 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1680329wrv; Fri, 13 Oct 2023 14:38:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFsJ+BJI+gWzJHf7j3FR809bGpZRmXbLtKm1IYBWVsggXmoauc5mTJurRaTAz+DyLqKRk2C X-Received: by 2002:a05:6214:1808:b0:66c:fbad:5026 with SMTP id o8-20020a056214180800b0066cfbad5026mr2232127qvw.29.1697233104051; Fri, 13 Oct 2023 14:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697233104; cv=none; d=google.com; s=arc-20160816; b=Wmzsfi0PJsRg9frh8ZJsZh9UAkuMaW7WR4v3s8gVN5BDN2YSZvivWkZsAMPWRbEZ4G 3HGTTwG72Yc0hIN8/g+OKwZc2+4UaPbjeUGJhdFvUlHTBGOSAXYqKLMwl0sXin90KvrS RE6zSeBAO3tIEeNlrF16uJi83S7Ilz/absWXjoUe65+tGuZAPoxrcUtey4Fp9A2/d460 RJ+ZyS4vekfWaYcdArDKJSHwKBvrxutj/TfldWmzkyviYoEmVug6whgU7Mrb+4z194+c 6KAYM6mVmsTFdYIUo3l9LUArzOiBNJ5acfYw63jgrKSFInj0QQMm0ad0I+1pyck8YzJX sArg== 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=e9IeoznCVNi9HF18yQIi5ShIBfQ3I5fHN0cJyJzXN2Y=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=PLaicBNc6NyY9wLdk9MsrWOb9NvtYnzYRdcAGHkK2G3GoGzSbsBGzxIwrfzLLwba5F nXTt0XDaDP/ODSf7Oz0fU8aBb6rGS5Zr6m8hkWlj34e6dyoFmVVmj8r+qhiq+lpj5F1J 1as0iJ081GG8KX1XibIRY/+AorG6Vrk2dK0AR68+KQjVSK67r6q8Nms+ubdgeQMCWxZH fGloF0hdG2N8tKyPSTPS1w0i64te91zhSDk01dAW8iJRfz30Sr8hROjzesTdVSux/2vO SoGkUGVefyXKQ0rHp96XoRGLrRo0Waf1hrNW0r4w1NssBvJSe3BwBmpSzRrwIuBD+Gq8 CKIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x7fbmewK; 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 dn13-20020a056214094d00b006608a228fcbsi1802708qvb.323.2023.10.13.14.38.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 14:38: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=x7fbmewK; 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 1qrPms-0004Tu-83; Fri, 13 Oct 2023 17:33: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 1qrPmJ-0002kY-1C for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:33:06 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrPmH-0001bJ-5l for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:33:02 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso385354b3a.1 for ; Fri, 13 Oct 2023 14:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697232778; x=1697837578; 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=e9IeoznCVNi9HF18yQIi5ShIBfQ3I5fHN0cJyJzXN2Y=; b=x7fbmewKm71PI0YqmajsrBtMj1c8isqRslVH5b6h8PgRHUC86Z6XDEGZ8YsJMYFPnX UNX5Cm3xmPtO70ROFFCd3YLU9n6XybRuXPx1RlZB3Gt/XWVaRT+bFRClFUNKzPD4jKfQ yrtVbcb2PqyiQ+MmpETuTu4fKmxrxFSJ4Y3L2V/TQImHbrfXPMgfPfZt11pW/eXhYste ZilGuYchJ0rhtRP12xIY/1rbl0twnqQHX6xKMCQkjy9dbRq770mSyuCvZsEaUgzfWWor KmZom6HaZSN4G8jszI8TGjkr0/Nj3/fF30ugXH89Yo4FoqTd5w/sMWPiGaj56zdn+Igr 1jMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697232778; x=1697837578; 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=e9IeoznCVNi9HF18yQIi5ShIBfQ3I5fHN0cJyJzXN2Y=; b=KcgpFK2TXerUGI1iY41UIBqFj6O7fS5eNkuo41TfmVP530/71Uz8ccNiVKkaD2P/zT p1B94NqMW4s/24Roug8pRZM1K75LI/dTi6TJ5sOX+tbnjuRBv/0zSvuHFPJQwKYWAJe4 Z+3a/0zYjkbOctpIih/WBoPK2mEwxaTQcfkadQnhwK8T8SoU9FTU1YVYNwfjUHNTl6ZX e1ElcFXZn2dCzT5npyRRYS4YuYfU4xy3vtiWMIc+FZ63ODXPk5HQUFeH5cIPDKJbiJtE hVmdzKnA9ob8lcAZgCe4xVGyelzRfDLuhER+Ycjw8HlVZ2ED55SeRzybAbh+/YiyQ6LB Vb1g== X-Gm-Message-State: AOJu0Yz9TV9naxXD0rULH4kRD0S+dngGXFHMK3pZwjQsmTDFNmoYg5+u D8kcyLq+EDXcAoYwVuiJY6zxudIqMECqHn8PhAQ= X-Received: by 2002:a05:6a00:99e:b0:68f:c2f7:cef0 with SMTP id u30-20020a056a00099e00b0068fc2f7cef0mr2319209pfg.4.1697232778286; Fri, 13 Oct 2023 14:32:58 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id j5-20020aa78d05000000b0068842ebfd10sm13977191pfe.160.2023.10.13.14.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:32:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 77/85] target/sparc: Move FiTOq, FsTOq to decodetree Date: Fri, 13 Oct 2023 14:28:38 -0700 Message-Id: <20231013212846.165724-78-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231013212846.165724-1-richard.henderson@linaro.org> References: <20231013212846.165724-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 | 44 +++++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index f30f2bc800..f0a6abb170 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -267,6 +267,8 @@ 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 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 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 4446bc2e48..d6ae4431dc 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1542,19 +1542,6 @@ static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs, } #endif -static void gen_ne_fop_QF(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_ptr, TCGv_i32)) -{ - TCGv_i32 src; - - src = gen_load_fpr_F(dc, rs); - - gen(tcg_env, src); - - gen_op_store_QT0_fpr(QFPREG(rd)); - gen_update_fprs_dirty(dc, QFPREG(rd)); -} - static void gen_ne_fop_QD(DisasContext *dc, int rd, int rs, void (*gen)(TCGv_ptr, TCGv_i64)) { @@ -4788,6 +4775,29 @@ static bool do_env_dq(DisasContext *dc, arg_r_r *a, TRANS(FqTOd, ALL, do_env_dq, a, gen_helper_fqtod) TRANS(FqTOx, 64, do_env_dq, a, gen_helper_fqtox) +static bool do_env_qf(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_env, TCGv_i32)) +{ + TCGv_i32 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_F(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(FiTOq, ALL, do_env_qf, a, gen_helper_fitoq) +TRANS(FsTOq, ALL, do_env_qf, a, gen_helper_fstoq) + static bool do_fff(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i32, TCGv_i32, TCGv_i32)) { @@ -5073,15 +5083,9 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0xd3: /* fqtoi */ case 0xcb: /* fqtod */ case 0x83: /* V9 fqtox */ - g_assert_not_reached(); /* in decodetree */ case 0xcc: /* fitoq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_ne_fop_QF(dc, rd, rs2, gen_helper_fitoq); - break; case 0xcd: /* fstoq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_ne_fop_QF(dc, rd, rs2, gen_helper_fstoq); - break; + g_assert_not_reached(); /* in decodetree */ case 0xce: /* fdtoq */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_ne_fop_QD(dc, rd, rs2, gen_helper_fdtoq);