From patchwork Thu Feb 13 14:26:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 864829 Delivered-To: patch@linaro.org Received: by 2002:a5d:47a6:0:b0:38f:210b:807b with SMTP id 6csp452387wrb; Thu, 13 Feb 2025 06:27:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUC2BspDqY5bIjuM5orOeJQrAbtrTzwS5rqC0vAQIYtmWUDQ/3/ei3AvQ6GgOJAhuOt7zjKTA==@linaro.org X-Google-Smtp-Source: AGHT+IEfbJ2LU5pjBs6U92aVybAWMjVKxf84LdAyKAZMqvMs0UTEaiTHICsEDIrVLaqM8AXqVyNJ X-Received: by 2002:a05:622a:4d8d:b0:471:b8e8:eaed with SMTP id d75a77b69052e-471bed8d7f4mr64485471cf.31.1739456831087; Thu, 13 Feb 2025 06:27:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739456831; cv=none; d=google.com; s=arc-20240605; b=Ey4OUKFHsNA4a+kXOEzPLOzxhdAfC5PkrDSBvOdo6dPX5Rvn9GHxoPZja1ahXjjEX2 N4w7TypDWv9CVNnA1dpmMQBm2It2L1W7nnAoNBS7+BpWgx04vMjyIHQ8g553hBqP2V0F cSgzzdT+veK0KyadoVlGTHtPdkXM/zFT6g4F9YFKjwFdSIXbEBvta51+02EKqWNA7qHi 87zHqzn/MoH3YYX8f6JDTfbTZxP8e5h/c9jCn5ffJeR9keG7MxhGsKlwbZ3O2TlB1OTj SmOkWwbVfEQiu7UobBaU4TMZtnS69k6wSu4/bHmgOBILHCI3EOf8bXgyX38FsULW45ni jLKA== 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=KZQiHA1qvCBztocbqsFOi1IRya4/wKDmhY8pdA7/x98=; fh=PAYODwlZirpE9wBz0jOP90gCu/93ITqb817G+JU23Zw=; b=VIS3gxozuz0qhnRDwGi8IIF3+0lXBxFakdVEtb1MjTaNeYxe+D2qQ2yxP4nt9oJmN+ 4MeqvZrs8L/0Ixg9d2VW78WXfbsjN9VMGGMxI3Mfdg1rh0rNM4qY9T5U9K/8Qcw7kIFB cYy7M6PLpY9M0omD3moDgihkCN7KHeQybl2BUAL/GHu6K5KSr1I0ZdKU/lehdHt4Six3 poU+PlK7RVjpiq7bkYDZkMRq86C2+d53XDjUuNy9igpFlGk9eyD0dZaoCVwnEZXz1YsO bDfzSQWaAr4WdgFzgrqKp7wul+21awcIttL8t91bLpCRCoqpEPq0r4C5z6ZDJLEQj7bc m2lQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iHdQUdgX; 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 d75a77b69052e-471c2b7ed09si13971601cf.658.2025.02.13.06.27.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Feb 2025 06:27:11 -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=iHdQUdgX; 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 1tiaAc-0004VK-Nw; Thu, 13 Feb 2025 09:26:26 -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 1tiaAb-0004Tx-9N for qemu-devel@nongnu.org; Thu, 13 Feb 2025 09:26:25 -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 ) id 1tiaAZ-0006nt-Hs for qemu-devel@nongnu.org; Thu, 13 Feb 2025 09:26:25 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4395f66a639so6292095e9.0 for ; Thu, 13 Feb 2025 06:26:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739456782; x=1740061582; 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=KZQiHA1qvCBztocbqsFOi1IRya4/wKDmhY8pdA7/x98=; b=iHdQUdgXxxLSPLU0CkMaOttxmD1GDx0FTFzPPHY60sweJLOvJDjVVHP5j3HD2q1QQm ob0oRa4l2V6IcRkyryK+NAB3S4WjOUN52lYkVvrRLb2ISnfEIKqysnDsM2zFUr/dzmfp spQpvxW7xEWa/uCgF5wH2G8kMmo6Uh5PShBk7rG9p4h0lOJyHWd3alZaa9Qhtg9Jt6g/ p/F6Pl/8VDN2mz6V0wWBeITSVxy0TWzogWdQb+v8Ntb536LllNdMxPDMP96vh9WN7R74 2sTrEpfC3f0RO77K5FOqZgvfkGCBuDHhYUUMzqOt1kZxeJZBzSmi3bwwpbr/BS0yek8J eV/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739456782; x=1740061582; 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=KZQiHA1qvCBztocbqsFOi1IRya4/wKDmhY8pdA7/x98=; b=JBFy47AV1+1kLnGb5EINDWAW2G3SD8F7e/Ftx+adC1s8IvNEedl1CUpXbk6vaDgSix eb62N0nIyClTZY1ItmQFo95tlcqcTxqGB4kRBJKYibc5jYt98kXlhKZOjXVk1mysVEHa zSGeoHSOkps6sFJ+ppm5pjVIdSEX8jHJtSnOEEksGjBs/wN4tCW/xpISuE2rKMzAo8d1 eECzaoNllihsQ41EPhMpyWf+e67QJqpfo6c3AYKIjMAQSVRnK7SPux8aIAgtVDIByH3A b+P6sJXqSQR0syY6uXt3zhpKBPvX2iRGDHf55gp8HKfE+xwKLkr4SesXJDrUQG1UJOWA iNBw== X-Gm-Message-State: AOJu0YyobC3etEZg0V5YtONvkT7YrcAuAi/ZZP4UIWUqoAWw/D3C1Jc0 rbAoPjwcixZfJ6I3xANvuwYYrd6NELDdfej8AK0H14tv+fBEluw4em+Np90Iel45aeCQIxkOfT8 Q X-Gm-Gg: ASbGnctPVd6GhXbfZOoqoJwoRcxxL/3IVm3mLl9TdXkdqWq0spfoumLdksINMLy3m0G hqseoLs1PHKsIupZeS8dewfSgAKFFo7O/PPZfmUl+i8vn75shkNF/4pQKVdHkVKgoBCQAi/EWBc oP4YfOUf5w0E+SNS6iY83ShtUzDGY9BHomJWb1pIpecZi0Kc1cYNgNqjL58FM0XTrL/smFTe0su 4UUkCE/Olhhw84zAkGzA3qmCS4gk7ya4w/uy5y1hJ3bDRszdkMDEHi+xipSouNrSs8scDPZzlU+ ISuT5yMbm/y2cYCCdlrmvA== X-Received: by 2002:a05:600c:450c:b0:434:f3d8:62d0 with SMTP id 5b1f17b1804b1-4395815f428mr76899535e9.3.1739456782015; Thu, 13 Feb 2025 06:26:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f258b4335sm2093604f8f.15.2025.02.13.06.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2025 06:26:21 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Zhao Liu , Eduardo Habkost Subject: [PATCH 4/4] tests/tcg/x86_64/fma: add test for exact-denormal output Date: Thu, 13 Feb 2025 14:26:13 +0000 Message-ID: <20250213142613.151308-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250213142613.151308-1-peter.maydell@linaro.org> References: <20250213142613.151308-1-peter.maydell@linaro.org> MIME-Version: 1.0 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 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 Add some fma test cases that check for correct handling of FTZ and for the flag that indicates that the input denormal was consumed. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- tests/tcg/x86_64/fma.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/tcg/x86_64/fma.c b/tests/tcg/x86_64/fma.c index 46f863005ed..34219614c0a 100644 --- a/tests/tcg/x86_64/fma.c +++ b/tests/tcg/x86_64/fma.c @@ -82,6 +82,18 @@ static testdata tests[] = { */ { 0x3fdfffffffffffff, 0x001fffffffffffff, 0x801fffffffffffff, true, 0x8010000000000000, 0x20 }, /* Enabling FTZ shouldn't change flags */ + /* + * normal * 0 + a denormal. With FTZ disabled this gives an exact + * result (equal to the input denormal) that has consumed the denormal. + */ + { 0x3cc8000000000000, 0x0000000000000000, 0x8008000000000000, false, + 0x8008000000000000, 0x2 }, /* Denormal */ + /* + * With FTZ enabled, this consumes the denormal, returns zero (because + * flushed) and indicates also Underflow and Precision. + */ + { 0x3cc8000000000000, 0x0000000000000000, 0x8008000000000000, true, + 0x8000000000000000, 0x32 }, /* Precision, Underflow, Denormal */ }; int main(void)