From patchwork Wed Dec 11 16:30:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 849256 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp425275wry; Wed, 11 Dec 2024 08:42:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVc3GJkzxlx5ExAa6yBG0wUbd9LIF9E/lpPht7VqNK0VFuYtLO/3mzlscmc/dUvTYTMODXFfg==@linaro.org X-Google-Smtp-Source: AGHT+IFzNfh22MaYG19trSJ5DaoT3ivo+TfZPerX+I9DKS0sO86UA2J8RoWve9fGT2qxmnKOT4Kd X-Received: by 2002:a05:6102:5487:b0:4af:3973:6b22 with SMTP id ada2fe7eead31-4b2478a8ffcmr97197137.22.1733935342456; Wed, 11 Dec 2024 08:42:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733935342; cv=none; d=google.com; s=arc-20240605; b=JOMbV3XzNSG04SHtcYhvHs6AsZ186yGxvsvyo8AAKHPVYIpH/nEAcRMXfLMFWF2+gt wYctoIsYmPa8DF+JATjLEtvGgvXnEmgJdYlGNAQ+xpirHIkBAL8a3nVDVT8C8xsmrxwm Wp3QbkLkvnecHy9xmqjiKxXGTgoufQn9DImPrugxohIgvLKgMLQ8dJExoh7bVs0FbSgk tG5OlPns/A6lcCBPFymeu+IZnwvVDbjti2sZD8Q+edcOzLYuXRdrtD1loyvt/fCb+Qcl bGyXGTJSw9j6g+zOOu/CgeHPkyiJLKf1KsxP/KNFNYBlECqxsZK+ECXLdQLB+XFJ4h29 OMhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=SjNCXqWLXBfOyQBfYtoOK+ENmcPrhXIDdj2qnDqUAHQ=; fh=ZhBia3nL9o1nuf7SbgdYn/0pDmAeja6gisyWXi2cqYE=; b=B1xjQMVmywuvy6ej1miAyvWWDYDeDZgHWddRWnAPlHwo7wuO9NEheWhnW5PgjED+kJ fjWa3MR3DRtFNBvkbrlA9SKiS5ta3rJxd7Va8c9xb1Lcke59hOFtsJK7ah2+Lqt+zrmr YU5BLv5sRChcuLSLe5YO8luZPTeRhDkV7MTfxpnE9qZUi50pEP9dGsWiwZ+mS9LaY1tf mmg3R8b/nrbgAlBIDjxLxim47tMPs05AYpN5X1M/iXal+dv4Bn14qfkYuy6e1pUHEm5P 55HobhsM6wnLNMLyWrtQwmeGyGlCEDV+C9lXaOypYCe0bXfkQDrmItW7D4ipcYD8Lk6L +c2w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=usl+ykL0; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4aff3de04e9si1688709137.122.2024.12.11.08.42.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Dec 2024 08:42:22 -0800 (PST) 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=usl+ykL0; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLPiD-0003WR-AP; Wed, 11 Dec 2024 11:37:21 -0500 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 1tLPhe-00010w-UQ for qemu-devel@nongnu.org; Wed, 11 Dec 2024 11:36:47 -0500 Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLPhc-0002Hf-Of for qemu-devel@nongnu.org; Wed, 11 Dec 2024 11:36:46 -0500 Received: by mail-qv1-xf2c.google.com with SMTP id 6a1803df08f44-6d8edad9932so39772356d6.0 for ; Wed, 11 Dec 2024 08:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733935004; x=1734539804; 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=SjNCXqWLXBfOyQBfYtoOK+ENmcPrhXIDdj2qnDqUAHQ=; b=usl+ykL0b0H3gXNpRaFT+o0+A682ynd/vguw8UhkwTuCSbJqENI+5Fme+8A7OfwVcq u1WipdWn/tIdZz7KruuQPWsZU91ELHEKcV/Dvp/8OgV7x9ihFokOMnX7OTCNw9r44zHM PANRdxogfESSJAUjhfpFYKsppsfoWV8x8/ItVGt5KVHW4/GJvYCMFel+JjDg8gMvkdqZ xdtkndZ/+fbniJvAleYcWEvXT59TDWOpiXguW+6Xo5dLV5UsTvMetIZhTi0+RMR3CSIP Nw7kICSflSKt3j3uVwfhYKNX+OV4yjVH5208rj9sz+BIxqjq3TdyDDA+7jia7dhU0yBC lyhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733935004; x=1734539804; 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=SjNCXqWLXBfOyQBfYtoOK+ENmcPrhXIDdj2qnDqUAHQ=; b=DWlZ2qgICSpwvcHtdKgIXrD3Cn9VZklJmAqey9P/MUI8weL/m6meWxtAZ7fnnpiWkh 7mM8SCmh8qHW5wj/EgRlgGH6ppDnB4dDIxrs/XV+LmU8ByvLZDXiT5s1twOlSDh+hFbF WjZpG+WdMMtvwTb//c/v8+gfh3Us7vmXHH9JuICo/FdXnid8ZqauHZzsob5jAOLQhvNc rcwYfJW3WFWZfKeJCpQrQDiwTGs7DnJude66gVu2HFGbnkcTyypnPItjLHzMoN7YY7Qx ayeVbvP0dR9gNhRWXSBJbMeUAT6HeY2Iu6d6DoJGTUPVOkNZgK9DOryehn2GXZ5f2pAv TA6A== X-Gm-Message-State: AOJu0YyJtd/3Cwm7sXAcRLD+05lAqxv/4/OvCVteDmAssTjEdxWc6L/0 ZJZ48RjmmFgDXBmO1DyYBLFPqa2Rh+DqLihwZOJ/HuJxmxHtYvfXW5k3NX1vPWUma93Lj6N9tKj 2EPe790kV X-Gm-Gg: ASbGncsmvfnzBbBV8kOLx8tYTl1F473f+84vMD00XUW/C+7tClsZr3AayVrALZL8sOa fex2Ta/409Am1MoDOEyWBpWhyD7OAVAKj+IDGaZXVk9OSHOIgk2OCGXCrkjV3p2prM0lTRreZ5w udWbUmFnonFUvZOfycCukMGFHNxkfhBicdW/POZBMLEa0GbRx/DYSX80iDPbuR2dmMeAopc7Bih GTfVn+Dlyt+d/tURq1ZVjcDW1axcGGPyZ2fYwqRx69jx6ykB8toHo25/mahKg== X-Received: by 2002:a05:6214:21a2:b0:6d4:20fa:83f4 with SMTP id 6a1803df08f44-6d934be9199mr49018926d6.48.1733935003822; Wed, 11 Dec 2024 08:36:43 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d8da675214sm71856276d6.11.2024.12.11.08.36.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 08:36:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v3 59/69] target/arm: Convert [US]CVTF (vector, integer) scalar to decodetree Date: Wed, 11 Dec 2024 10:30:26 -0600 Message-ID: <20241211163036.2297116-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241211163036.2297116-1-richard.henderson@linaro.org> References: <20241211163036.2297116-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f2c; envelope-from=richard.henderson@linaro.org; helo=mail-qv1-xf2c.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 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 35 ++++++++++++++++++++++++---------- target/arm/tcg/a64.decode | 6 ++++++ 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 894befef4d..6e9d040ebf 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8599,6 +8599,29 @@ static bool do_cvtf_g(DisasContext *s, arg_fcvt *a, bool is_signed) TRANS(SCVTF_g, do_cvtf_g, a, true) TRANS(UCVTF_g, do_cvtf_g, a, false) +/* + * [US]CVTF (vector), scalar version. + * Which sounds weird, but really just means input from fp register + * instead of input from general register. Input and output element + * size are always equal. + */ +static bool do_cvtf_f(DisasContext *s, arg_fcvt *a, bool is_signed) +{ + TCGv_i64 tcg_int; + int check = fp_access_check_scalar_hsd(s, a->esz); + + if (check <= 0) { + return check == 0; + } + + tcg_int = tcg_temp_new_i64(); + read_vec_element(s, tcg_int, a->rn, 0, a->esz | (is_signed ? MO_SIGN : 0)); + return do_cvtf_scalar(s, a->esz, a->rd, a->shift, tcg_int, is_signed); +} + +TRANS(SCVTF_f, do_cvtf_f, a, true) +TRANS(UCVTF_f, do_cvtf_f, a, false) + static void do_fcvt_scalar(DisasContext *s, MemOp out, MemOp esz, TCGv_i64 tcg_out, int shift, int rn, ARMFPRounding rmode) @@ -9838,16 +9861,6 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) case 0x6d: /* FCMLE (zero) */ handle_2misc_fcmp_zero(s, opcode, true, u, true, size, rn, rd); return; - case 0x1d: /* SCVTF */ - case 0x5d: /* UCVTF */ - { - bool is_signed = (opcode == 0x1d); - if (!fp_access_check(s)) { - return; - } - handle_simd_intfp_conv(s, rd, rn, 1, is_signed, 0, size); - return; - } case 0x3d: /* FRECPE */ case 0x3f: /* FRECPX */ case 0x7d: /* FRSQRTE */ @@ -9867,6 +9880,8 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) case 0x1c: /* FCVTAS */ case 0x5c: /* FCVTAU */ case 0x56: /* FCVTXN, FCVTXN2 */ + case 0x1d: /* SCVTF */ + case 0x5d: /* UCVTF */ default: unallocated_encoding(s); return; diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index f66f62da4f..146500d9c4 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -1657,6 +1657,12 @@ FCVTXN_s 0111 1110 011 00001 01101 0 ..... ..... @rr_s @icvt_sd . ....... .. ...... ...... rn:5 rd:5 \ &fcvt sf=0 esz=%esz_sd shift=0 +SCVTF_f 0101 1110 011 11001 11011 0 ..... ..... @icvt_h +SCVTF_f 0101 1110 0.1 00001 11011 0 ..... ..... @icvt_sd + +UCVTF_f 0111 1110 011 11001 11011 0 ..... ..... @icvt_h +UCVTF_f 0111 1110 0.1 00001 11011 0 ..... ..... @icvt_sd + FCVTNS_f 0101 1110 011 11001 10101 0 ..... ..... @icvt_h FCVTNS_f 0101 1110 0.1 00001 10101 0 ..... ..... @icvt_sd FCVTNU_f 0111 1110 011 11001 10101 0 ..... ..... @icvt_h