Message ID | 20250124162836.2332150-57-peter.maydell@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a05:6000:18c8:b0:385:e875:8a9e with SMTP id w8csp887550wrq; Fri, 24 Jan 2025 08:45:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUxW69Hc/wxH8O0YSU0eBDXxK7jzOIthlCILGRBRsgFNN9WutMEtBpMc//0FURsi400ouawDw==@linaro.org X-Google-Smtp-Source: AGHT+IHNvWaetchWvafNu+yPi1fn/ZFwiffArjFVBXYNOfYxWCNSAu6NaaCGtA+W3tXQ9jHYe9FR X-Received: by 2002:a05:6102:548d:b0:4b6:5e0f:6ddc with SMTP id ada2fe7eead31-4b690be8ea7mr22800026137.14.1737737152674; Fri, 24 Jan 2025 08:45:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737737152; cv=none; d=google.com; s=arc-20240605; b=dyu/4VTXy6ZHJh9mz+HuT3jXzUeLgaNhcrDoQ606C7OCNHQ+y5rw3NZ4g7qFcFrj/N uIVWZHG90OBMs2elYnuROgzQYnx161q5Qwa3g+K5ip7Z7KoB2OJZ3DWxHgSkHCZ1XOoX oDLBJmoZ7OgOQSxeZZSL6en8NbwRpZBXv49QRS97RjleAPmQTh/Y73RGaQ/eyn4Jy/T4 mzCmEzq3nYtv0ZI2ZmO8e2H9oV4LyA+uu/Xo+CwYYcgh8ewAB4Yt7SP+bbDtYJpTKTAC XK81HWR14enXdYybChMWHOZZnThzGGwAqPuB+5XRi5DCpCXVmdR26ly8ynOIrIUqUqc3 apQQ== 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:to:from :dkim-signature; bh=vkN1tvZXYem3cLB2r+/GaeAu/aQPELpTO9bRu2GSjS0=; fh=OHXdmJhxjkJx83JB8nR6qCtdfWuF9r0Z1CWYa3Kf8HA=; b=dQRDI9TCexdsEUtk7Fnx3er0U/12YOUg9FXd959gBr3mm8NrCib5oymOktIuxiTIp0 QahKbjICI3BwHYbdlt37LC0nf8ZzfITZVWR5yfvKiYiXOs4mFREwMRVw/LXNfOi9V8ay UqkN0uhQ1u7vPGFtaCUPL9R6PFfYUIjbCU59x+G2tZT/ubKG6OABF2hTElcUhwcipZrT wk47bwWI3pHH+buC/LmGCSppfM7dkMLnizX9Ef72wqzYBs/9eQbIF+3yxDKhw8YJR/9g tUGdGhoI+3XBkfV0VDZP17fqF9OVFhXfakrUqKsYy+zefsHXLQAD99/nT6vmB8h/Dvqj 7JpA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QA9ekjkF; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a1e0cc1a2514c-864a9d4102csi749601241.178.2025.01.24.08.45.52 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Jan 2025 08:45:52 -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=QA9ekjkF; 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 <qemu-devel-bounces@nongnu.org>) id 1tbMfZ-0004S7-85; Fri, 24 Jan 2025 11:36:33 -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 <peter.maydell@linaro.org>) id 1tbMZ7-0005ol-3l for qemu-devel@nongnu.org; Fri, 24 Jan 2025 11:30:00 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>) id 1tbMZ4-0005kR-KM for qemu-devel@nongnu.org; Fri, 24 Jan 2025 11:29:52 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4361c705434so16685675e9.3 for <qemu-devel@nongnu.org>; Fri, 24 Jan 2025 08:29:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737736189; x=1738340989; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=vkN1tvZXYem3cLB2r+/GaeAu/aQPELpTO9bRu2GSjS0=; b=QA9ekjkF/0amWxMUvExS+Kru6TyW1dA2ONt43UHo27G2TEW2kcpkarY30KKZsqlzEh PUWM4vwyF/WEqY1V2rHnhn5X9MlJfQ1nImIE2nF1dc1pJDrJ58xDPEcxYQ4pYm6dMxqJ sF8Nd5cH92/4iIec2qWt/o635Yb5Yn5f7GeQcmhOrxMb0By1oNz0ALmjtZHuf6lJ7FW6 MYHfvHAGSvbbzZLZspzzTduRMo4cDHAbJRV4+uVeewgNEqNkmtUTYwLFciMC2cYJxu71 1Z85ECxr+AC5Ye5+Y1jMBReLuQ/IdQfJE8Kw4tAR/zvdiNmUHdy/1/b/EZhHLTX3CvXT 3lKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737736189; x=1738340989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vkN1tvZXYem3cLB2r+/GaeAu/aQPELpTO9bRu2GSjS0=; b=VKQYe0pMoWBRsSX+xpQFrVB2EbP8O/sAMsPo/XFRNCsgP1VoDsQ3iGtoc7mkN8eao+ 2yIlRGZJ50mwOVEQajoNhDDYwRzzu4YC6H6sQRVfMrfzPN3oUJRxGfnu+14XIzqGmSQ/ Zl8o+7rHzxvmeNas3dn/jzDfIGiA7SwFP8H60xBXOrcGl80UwBxWJvjH9xv0j5DyJPCO jfn68Fqlbf6uktQwYXaG1tD1adu/wxLxZk6mnJieN0N8JrBSvi4lRlf+S9adMBwQC0fE cp0b5pd2fhiD3QY4Zbw1Dau8RGMPynyVWIQ86LkwLfXcfhERnS2Z0vt/EszQYJFFCFv+ 3G0Q== X-Forwarded-Encrypted: i=1; AJvYcCXhP+kE8NUFjg0G0Wt6Sx4Fn4UNOzJFxvrrbBrLiTp58ysgb4wdNa5y7eisOHArau3gNsxzsYgdRYgJ@nongnu.org X-Gm-Message-State: AOJu0YxX+MTkA7MZSFo7oFHNHDcQ/xmkJDV+Mq3+KThXOUshKeUBrZX7 C6BGq6yhNPqtfMn1OOIYnhh9hLRIxIRyQ39Z8Z3ZJerkW4B9w1hw1JOqr0OU0GCcY6SB3vj9CCR 1 X-Gm-Gg: ASbGncvuq6ACO7Zj6+5rjVF4s3dcKQkeyuqFa5jXPwfsnrIKq+ErQQqo8nV2mQwbo9L oGRhaGvK0eqgr1/zYEz0jQZiJVgOhE6oHpNDhmJBk4ksOSQkuuAK01na9VYqPwPV/yp/I3glz/Y Df5/6FZBT5UZzZeFEtDkoXGqxYbQqiPefjdGr+NLu8Sn7BahjbWqzBdjjOZCESZa1yIGwAT7rsM jGVbBRDAYE86pkXwB4jcmjD1YG3WUVuj7o4GEBEK+YTZvk/FLzS/lYbozWyMd9iplma9qObW3nm WxnWRUkeYNc= X-Received: by 2002:a05:600c:1f19:b0:434:a1d3:a30f with SMTP id 5b1f17b1804b1-438b9cc072emr73449355e9.6.1737736188906; Fri, 24 Jan 2025 08:29:48 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd47eecasm31683025e9.6.2025.01.24.08.29.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 08:29:48 -0800 (PST) From: Peter Maydell <peter.maydell@linaro.org> To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 56/76] target/arm: Handle FPCR.AH in SVE FABS Date: Fri, 24 Jan 2025 16:28:16 +0000 Message-Id: <20250124162836.2332150-57-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250124162836.2332150-1-peter.maydell@linaro.org> References: <20250124162836.2332150-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
target/arm: Implement FEAT_AFP and FEAT_RPRES
|
expand
|
diff --git a/target/arm/tcg/helper-sve.h b/target/arm/tcg/helper-sve.h index 867a6d96e04..ff12f650c87 100644 --- a/target/arm/tcg/helper-sve.h +++ b/target/arm/tcg/helper-sve.h @@ -541,6 +541,10 @@ DEF_HELPER_FLAGS_4(sve_fabs_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_fabs_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_fabs_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve_ah_fabs_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve_ah_fabs_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(sve_ah_fabs_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) + DEF_HELPER_FLAGS_4(sve_fneg_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_fneg_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_fneg_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c index 976f3be44e0..5ce7d736475 100644 --- a/target/arm/tcg/sve_helper.c +++ b/target/arm/tcg/sve_helper.c @@ -879,6 +879,14 @@ DO_ZPZ(sve_fabs_h, uint16_t, H1_2, DO_FABS) DO_ZPZ(sve_fabs_s, uint32_t, H1_4, DO_FABS) DO_ZPZ_D(sve_fabs_d, uint64_t, DO_FABS) +#define DO_AH_FABS_H(N) (float16_is_any_nan(N) ? (N) : DO_FABS(N)) +#define DO_AH_FABS_S(N) (float32_is_any_nan(N) ? (N) : DO_FABS(N)) +#define DO_AH_FABS_D(N) (float64_is_any_nan(N) ? (N) : DO_FABS(N)) + +DO_ZPZ(sve_ah_fabs_h, uint16_t, H1_2, DO_AH_FABS_H) +DO_ZPZ(sve_ah_fabs_s, uint32_t, H1_4, DO_AH_FABS_S) +DO_ZPZ_D(sve_ah_fabs_d, uint64_t, DO_AH_FABS_D) + #define DO_FNEG(N) (N ^ ~((__typeof(N))-1 >> 1)) DO_ZPZ(sve_fneg_h, uint16_t, H1_2, DO_FNEG) diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index c173627ad49..c234a4910dd 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -783,7 +783,12 @@ static gen_helper_gvec_3 * const fabs_fns[4] = { NULL, gen_helper_sve_fabs_h, gen_helper_sve_fabs_s, gen_helper_sve_fabs_d, }; -TRANS_FEAT(FABS, aa64_sve, gen_gvec_ool_arg_zpz, fabs_fns[a->esz], a, 0) +static gen_helper_gvec_3 * const fabs_ah_fns[4] = { + NULL, gen_helper_sve_ah_fabs_h, + gen_helper_sve_ah_fabs_s, gen_helper_sve_ah_fabs_d, +}; +TRANS_FEAT(FABS, aa64_sve, gen_gvec_ool_arg_zpz, + s->fpcr_ah ? fabs_ah_fns[a->esz] : fabs_fns[a->esz], a, 0) static gen_helper_gvec_3 * const fneg_fns[4] = { NULL, gen_helper_sve_fneg_h,
Make SVE FABS honour the FPCR.AH "don't negate the sign of a NaN" semantics. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- target/arm/tcg/helper-sve.h | 4 ++++ target/arm/tcg/sve_helper.c | 8 ++++++++ target/arm/tcg/translate-sve.c | 7 ++++++- 3 files changed, 18 insertions(+), 1 deletion(-)