From patchwork Sun Jan 8 02:37:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 640358 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp1519365pvb; Sat, 7 Jan 2023 18:48:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXsTiYApjWa8sj7/JpF2EChGTmDcdCEz2EnreLDyOvEZBmEKmj7m9ep/4aC8IZzlyJelkVnC X-Received: by 2002:a05:622a:258c:b0:3ab:9ef8:f7e8 with SMTP id cj12-20020a05622a258c00b003ab9ef8f7e8mr54687814qtb.42.1673146100374; Sat, 07 Jan 2023 18:48:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673146100; cv=none; d=google.com; s=arc-20160816; b=SO+5xehR8DvbqjYgvnTSB4tehYHkklwtccB46QWpEX1HW9F7K77pbp4FhHUtwOqvsA pXDSySCrNMrSa+ZL2sM7RkfJFhV8haxabX/e7aBTK0SzH0XUewwmB8fhq8/I8rwU6YLo pKKBObRS/RSv6dIgYekO8IfqtW6P6+yZI2HE07vjAGpjbiZRaKEoIzzNjjdhJvb2fCuS c+2vTekEzzWWiSmiV3Sbi4croyM3rdeRUejw9U4wymbPyK0OzXtarfVOLWQIzfLMdAhU Z4YG8tUl6tBnzbZO4i4Pt61gTD2dpMwqdNSfjjK46/sjS8fyRDapGMPA1z61Jo6hU5tg vFow== 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=wHZLFNNm0ZFp31ulDF75QeL44+XwFwYbg39T7b6YDuI=; b=VkFayEEAQh/jhTuytV+CYe7HXw0A2P0pOifHpmFrAGeX3EjKc+9ZuZZ4+86RSoN54b s3AWk2QVwOOGe+Dhe798nm9bMy7a3DpKILA0X4Wr5dNUNIdDT2xpluxaMHs957Iyavf2 e2OiuRM0gL8DoQxC1qYyLqpE3Uzj0/3hzCmwwK+RlVG9xfSVqbBMK4J7lkK3/SCJlKld xKmR4VAkdK6esP1a6+BVrDVo+OMF4f1H8QMMjLDEVoW/x6VO9Z1km7IXNm8TpQJOL58e g59Nw7+DNL9CDpk7ohmNdakK3h8W/8mXD5jevoQIh4wnYl6CwWm5BJ4Ul6dwWRCaqXmw PtQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="yz/Vv9hf"; 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 ch15-20020a05622a40cf00b003a924782d83si2838261qtb.770.2023.01.07.18.48.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jan 2023 18:48:20 -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="yz/Vv9hf"; 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 1pELa2-0005ms-WB; Sat, 07 Jan 2023 21:38:39 -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 1pELa1-0005iT-Ij for qemu-devel@nongnu.org; Sat, 07 Jan 2023 21:38:37 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pELZD-0004hO-EE for qemu-devel@nongnu.org; Sat, 07 Jan 2023 21:38:37 -0500 Received: by mail-pj1-x1030.google.com with SMTP id fz16-20020a17090b025000b002269d6c2d83so8701502pjb.0 for ; Sat, 07 Jan 2023 18:37:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=wHZLFNNm0ZFp31ulDF75QeL44+XwFwYbg39T7b6YDuI=; b=yz/Vv9hfx11fLSInlmwJJ1MiPWzE7D/6OdyIY8MRsTs5VPjdFjXiWqOie9g2r6ox8f xOqANbE5cvmgQPJkBPDFqa5M2lDwRmrPO5Ps35nPdBDp/2jfCaf6CekDebjqcusMcNtI e7wjIooMErSThlYi6DKx+5bT78BY7IWdlWjBAxF/xzojETPLYpH5Z/I+a8obKDiWp/ee bJzNJbVRYOKS6Q8NF8c1Y86wXQ9zdyEsto8R0ACvTaT20gzVGLqEhlTB+5Y/1jRRtwpr V35qfYdz/Kax42wBGbUZfcRkscrNi0Rw4aNaCmMirA+Hmopcpyj06pGB8fvY153nHJ0P tosw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=wHZLFNNm0ZFp31ulDF75QeL44+XwFwYbg39T7b6YDuI=; b=6Sp3fGbH7Hegs+W7hFgYyXgCafv4rZoChLADLkEri1W7NK5DqU4aGarr4IMQgBQdtH qfQVvAhPC8VuE8Pswqz+0+bCi9TGBO4EeNqpZgy9+TShh96OQEmxIP8KAYNn3M+5B0Aq 0ggQy6tV3A8e2wPfjBB6YEB+3TQAn4bjyquwWWFl7NDF7RIWrlBC1PUpdHrbQu58dOUQ PMzZIXyuc6MWJj+4DeXSRLuJnvOpVoVVTz8Gv6a1zWlxMCOz3zCZal7362QCSvg/Fv+N nL9r379Igrojg2ZJy+UbSLpUakSBw3MtP1RT2kaa/Bfa7AL9bbUiapj1FBu43MnJ08Vk Lb8w== X-Gm-Message-State: AFqh2kq5YMztFQ2DUdjWM6pIkdgcjk6LWeGw1nytwa+4a5A5vbVtXUvL PdJXXmZ8l4E46zmEldIriRXC24AcHg+/76b2 X-Received: by 2002:a17:902:f791:b0:192:5ec4:6656 with SMTP id q17-20020a170902f79100b001925ec46656mr61538487pln.3.1673145466046; Sat, 07 Jan 2023 18:37:46 -0800 (PST) Received: from stoup.. ([2602:47:d48c:8101:8a2d:2011:f402:6f82]) by smtp.gmail.com with ESMTPSA id o17-20020a170902d4d100b00189d4c666c8sm3394775plg.153.2023.01.07.18.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 18:37:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, pbonzini@redhat.com, eduardo@habkost.net, Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v4 23/36] tests/tcg/s390x: Add long-double.c Date: Sat, 7 Jan 2023 18:37:06 -0800 Message-Id: <20230108023719.2466341-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230108023719.2466341-1-richard.henderson@linaro.org> References: <20230108023719.2466341-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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=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: 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 Acked-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tests/tcg/s390x/long-double.c | 24 ++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 25 insertions(+) create mode 100644 tests/tcg/s390x/long-double.c diff --git a/tests/tcg/s390x/long-double.c b/tests/tcg/s390x/long-double.c new file mode 100644 index 0000000000..757a6262fd --- /dev/null +++ b/tests/tcg/s390x/long-double.c @@ -0,0 +1,24 @@ +/* + * Perform some basic arithmetic with long double, as a sanity check. + * With small integral numbers, we can cross-check with integers. + */ + +#include + +int main() +{ + int i, j; + + for (i = 1; i < 5; i++) { + for (j = 1; j < 5; j++) { + long double la = (long double)i + j; + long double lm = (long double)i * j; + long double ls = (long double)i - j; + + assert(la == i + j); + assert(lm == i * j); + assert(ls == i - j); + } + } + return 0; +} diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target index 79250f31dd..1d454270c0 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -26,6 +26,7 @@ TESTS+=branch-relative-long TESTS+=noexec TESTS+=div TESTS+=clst +TESTS+=long-double Z13_TESTS=vistr $(Z13_TESTS): CFLAGS+=-march=z13 -O2