From nobody Mon Jun 24 12:18:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 154696478574417.892652171749546; Tue, 8 Jan 2019 08:26:25 -0800 (PST) Received: from localhost ([127.0.0.1]:54122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gguCs-0007PD-1W for importer@patchew.org; Tue, 08 Jan 2019 11:26:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggu8g-0004EL-Sv for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggu8f-0000fC-Ni for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:02 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:50895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggu8f-0000LY-ET for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:01 -0500 Received: by mail-wm1-x343.google.com with SMTP id n190so4729054wmd.0 for ; Tue, 08 Jan 2019 08:21:57 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c10sm50030616wrw.49.2019.01.08.08.21.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 08:21:54 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 7B5ED3E0D4E; Tue, 8 Jan 2019 16:21:54 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zxMd6GPDwM6BPndhdG+Twn4eiN8aaFHmKKsZ7ct7NIQ=; b=gZNK2V+ciswNZDvZCL6Jrt76KxiJpSVGTJckc/LLHzvS8csUr5UKh/MqZ9jM0UqFZA oG+WnTLX+4VBT7U0qLr4YJ24B4OEWH0HSxypi8egL9gxDidKdo1lkJMqO+r+bgeLybpr UYljv5m3CN+Hqvk8yjLiyUKlfD1bfKYRAwuzA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zxMd6GPDwM6BPndhdG+Twn4eiN8aaFHmKKsZ7ct7NIQ=; b=Xf+T5wBDUlnXJEFZcGGieWAZm5hDam14iMKKy19biu4/yXRvnv/HU7apelpq8S5lKT RCNSErRv0jcfyzzLVEov67Rux7SiBxKjWqNUQSGpcZD9oiWxA0XPZjHbJKm+FcbDef/H eNTqcr3TZDzk2BqLjMdZPAIKxVK7oitvZUG5Si9TNlGUPzHdtRFY8A4L9EzXja3/oYnG /SYg+7JM+J4C7jWav1YJmnt/m5qsHoKLKHI1aqypMm3JDpPMJtnzSQjYJ90M53jmx9Xc MBgp6Y278Z4l+SoMO+TEA1Ioj8dDEj7HREOb5H/hKMMiqLLblt8o2Me1BzCTXWv4JnBe 12XA== X-Gm-Message-State: AJcUukdi8VQ9YwDpZhy2gcibRjqSAZVS7t43UYnWVkeAmjw5Nki3KJ7s JlWW7FLOItkeNpE00y1HBPCPDw== X-Google-Smtp-Source: ALg8bN6iJOU9RtPl2Ag1gd17WE5YbDTaOhJRy2eesUX2l6FaLEmUj/zgh225Y3MpwfzmhCqnEtFdlQ== X-Received: by 2002:a7b:c315:: with SMTP id k21mr2182318wmj.145.1546964515698; Tue, 08 Jan 2019 08:21:55 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 8 Jan 2019 16:21:49 +0000 Message-Id: <20190108162154.22259-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190108162154.22259-1-alex.bennee@linaro.org> References: <20190108162154.22259-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PATCH v1 1/6] fp-bench: fix update_random_ops X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: "Emilio G. Cota" The second test in the branches is wrong; fix while converting to a switch statement, which is easier to get right. Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e --- tests/fp/fp-bench.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c index f5bc5edebf..546bac9c9c 100644 --- a/tests/fp/fp-bench.c +++ b/tests/fp/fp-bench.c @@ -143,15 +143,20 @@ static void update_random_ops(int n_ops, enum precisi= on prec) for (i =3D 0; i < n_ops; i++) { uint64_t r =3D random_ops[i]; =20 - if (prec =3D=3D PREC_SINGLE || PREC_FLOAT32) { + switch (prec) { + case PREC_SINGLE: + case PREC_FLOAT32: do { r =3D xorshift64star(r); } while (!float32_is_normal(r)); - } else if (prec =3D=3D PREC_DOUBLE || PREC_FLOAT64) { + break; + case PREC_DOUBLE: + case PREC_FLOAT64: do { r =3D xorshift64star(r); } while (!float64_is_normal(r)); - } else { + break; + default: g_assert_not_reached(); } random_ops[i] =3D r; --=20 2.17.1 From nobody Mon Jun 24 12:18:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1546964631979555.831615421481; Tue, 8 Jan 2019 08:23:51 -0800 (PST) Received: from localhost ([127.0.0.1]:53879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gguAP-0005F7-E1 for importer@patchew.org; Tue, 08 Jan 2019 11:23:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggu8h-0004Er-SU for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggu8e-0000a3-7n for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:02 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:38049) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggu8d-0000Rc-Uh for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:00 -0500 Received: by mail-wr1-x442.google.com with SMTP id v13so4663626wrw.5 for ; Tue, 08 Jan 2019 08:21:58 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id j3sm11424373wmb.39.2019.01.08.08.21.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 08:21:55 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 91DE83E10A4; Tue, 8 Jan 2019 16:21:54 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BKiceF0eCEcLLYJ2HmNMq8GOYGcVmd+bgBmQXvFufFI=; b=HCRm+rbFBQGNLLSMSNjNgL4vP+lJGx8Bfu88+dckemNj+DAVJRur00v6sCx7YxvI26 pgGk5TM5gK0wf2VwK0oK2QhrjOuHcT8GYOjDq2055uvypFJpuUmoRp+PTllu/PkMo27o 9XzHLMnFgnu1VwLhBNbWAkxxxk/PwFkKdMX6Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BKiceF0eCEcLLYJ2HmNMq8GOYGcVmd+bgBmQXvFufFI=; b=i2JSwxH70aE8vp1sVyvZNcN9yAdwSh/WiNfkDhtS10Qc6XJF1SDTBsgZ990l3pGyGW zX5pmRvFQWxNlUx7F+G1HJwIZYJqWbJThjx8WfVhSEm8mSa6g2C9OaV5peavf3ilOK2S xWPCCrVrqyPEoGeqoEOhzE/UcB0O8JZ9htv/eLTIJ1ZTmk4hyT9pKlWg5LmmcfCR0ZHS WXBihPw/g6Wma8hjMldna9LWIf1f/8SZlU50FdHlvnLNSnI9jFKHt+3u6GyWUthTns08 4c/YPuozi2uMJCXv1cXfTRnJWYS1oBhWYkdntRThby8gPsegbfraywtahC93pdOBEfDP 5yhA== X-Gm-Message-State: AJcUukefhnDG29QWf1jX6jX6now2db45JPfmLGHFNYJslgy6Mw7VxXma lBF4CM9srlv/QN93izGpZ/U1durxyf4= X-Google-Smtp-Source: ALg8bN4y+l6PBBiaHRDc+om8l92icdk6U6jMwYD1u9mItQ0RQbj0GmKz8JsHJ9ZH9C7adnD4AWZ5LQ== X-Received: by 2002:adf:d1d2:: with SMTP id m18mr2040455wri.138.1546964517276; Tue, 08 Jan 2019 08:21:57 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 8 Jan 2019 16:21:50 +0000 Message-Id: <20190108162154.22259-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190108162154.22259-1-alex.bennee@linaro.org> References: <20190108162154.22259-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [PATCH v1 2/6] fp-bench: remove wrong exponent raise in fill_random X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: "Emilio G. Cota" At this point random_ops[] only contains normals, so there's no need to do anything to them. In fact, raising the exponent here can make the output !normal, which is precisely what the comment says we want to avoid. Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e --- tests/fp/fp-bench.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c index 546bac9c9c..4ba5e1d2d4 100644 --- a/tests/fp/fp-bench.c +++ b/tests/fp/fp-bench.c @@ -176,8 +176,6 @@ static void fill_random(union fp *ops, int n_ops, enum = precision prec, if (no_neg && float32_is_neg(ops[i].f32)) { ops[i].f32 =3D float32_chs(ops[i].f32); } - /* raise the exponent to limit the frequency of denormal resul= ts */ - ops[i].f32 |=3D 0x40000000; break; case PREC_DOUBLE: case PREC_FLOAT64: @@ -185,8 +183,6 @@ static void fill_random(union fp *ops, int n_ops, enum = precision prec, if (no_neg && float64_is_neg(ops[i].f64)) { ops[i].f64 =3D float64_chs(ops[i].f64); } - /* raise the exponent to limit the frequency of denormal resul= ts */ - ops[i].f64 |=3D LIT64(0x4000000000000000); break; default: g_assert_not_reached(); --=20 2.17.1 From nobody Mon Jun 24 12:18:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1546964795423685.597325965591; Tue, 8 Jan 2019 08:26:35 -0800 (PST) Received: from localhost ([127.0.0.1]:54130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gguD3-0007VU-Pu for importer@patchew.org; Tue, 08 Jan 2019 11:26:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggu8m-0004HR-6W for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggu8g-0000jY-Sm for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:05 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:35990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggu8f-0000Uz-Dt for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:02 -0500 Received: by mail-wr1-x442.google.com with SMTP id u4so4673521wrp.3 for ; Tue, 08 Jan 2019 08:21:59 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id w125sm10303466wmb.45.2019.01.08.08.21.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 08:21:56 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id ADB363E113B; Tue, 8 Jan 2019 16:21:54 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Cu0zWCd/QWoV++VI/VVTfNtwQXOM6UIZaGTYIh0OvRk=; b=RU7NZAsVWKRCWRoOFovvTpFekdnjE94bjqnfMRak74doeNqaakbCecBvEVF7E/kzrN pN/n3pGCdviZJor25a4rVWjsvffzLYin2GjnFQEsZLa/imu0VsqXxLsEebz9NxlkCqc8 jYj/hwUJQJFoTGaeBzn8cJhDtho02oUNuiZnA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Cu0zWCd/QWoV++VI/VVTfNtwQXOM6UIZaGTYIh0OvRk=; b=o6ryX5krW08x4cDbl5koL99xZhDI84smCW/AFhsMYNLvnLjXToD63VqOtwpR90iiWL Qf3npjHf3ky89B1z+hDeMi9WX9w/1RdKgkQ0sn865gVvR2Wv/1K/Kd74jf+ZH856FscX ctXh9pNqU5PQvJqSYQSUEToGkv/wW/bt2OMZFyIAyBhLF6LcSRAT3+N8AXfExBLufGHg fs+G4exWk3DghtqOsAwU99tpY9qcylxVv3G9jnYceRYTzAmCk8Sq/mh6y6581egIK1SV HzGcnCUNWtqvEktVqSS5MtX5UNeX1PnruyyJTLh6yPIxharx6vZRg1wMuPW6AdNb85s8 oRxw== X-Gm-Message-State: AJcUukfl1FaNyrmnffB0tMHCHtohGhpie5kAm3EreerboIydmp9i2aKB jUV/sS7Y1w6KUI+1iCVv8vkjvw== X-Google-Smtp-Source: ALg8bN7loUL4EaQ6v5zQbJ2RIddQ+eehKWfs9179E9A0wwV/puGO/QnOp3X4otvaeQzWXINxI+bCLQ== X-Received: by 2002:adf:d089:: with SMTP id y9mr1989239wrh.22.1546964518269; Tue, 08 Jan 2019 08:21:58 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 8 Jan 2019 16:21:51 +0000 Message-Id: <20190108162154.22259-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190108162154.22259-1-alex.bennee@linaro.org> References: <20190108162154.22259-1-alex.bennee@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [PATCH v1 3/6] softfloat: enforce softfloat if the host's FMA is broken X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Emilio G. Cota" The added branch to the FMA ops is marked as unlikely and therefore its impact on performance (measured with fp-bench) is within noise range when measured on an Intel(R) Xeon(R) Gold 6142 CPU @ 2.60GHz. In addition, when the host doesn't have a hardware FMA instruction we force the use of softfloat, since whatever the libc does (e.g. checking the host's FP flags) is unlikely to be faster than our softfloat implementation. For instance, on an i386 machine with no hardware support for FMA, we get: $ for precision in single double; do ./fp-bench -o mulAdd -p $precision done - before: 5.07 MFlops 1.85 MFlops - after: 12.65 MFlops 10.05 MFlops Reported-by: Laurent Desnogues Suggested-by: Richard Henderson Signed-off-by: Emilio G. Cota --- fpu/softfloat.c | 85 ++++++++++++++++++++++++++++++++++++++++++++ include/qemu/cpuid.h | 6 ++++ 2 files changed, 91 insertions(+) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 59eac97d10..ccaed85b0f 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -1542,6 +1542,8 @@ soft_f64_muladd(float64 a, float64 b, float64 c, int = flags, return float64_round_pack_canonical(pr, status); } =20 +static bool force_soft_fma; + float32 QEMU_FLATTEN float32_muladd(float32 xa, float32 xb, float32 xc, int flags, float_status= *s) { @@ -1562,6 +1564,11 @@ float32_muladd(float32 xa, float32 xb, float32 xc, i= nt flags, float_status *s) if (unlikely(!f32_is_zon3(ua, ub, uc))) { goto soft; } + + if (unlikely(force_soft_fma)) { + goto soft; + } + /* * When (a || b) =3D=3D 0, there's no need to check for under/over flo= w, * since we know the addend is (normal || 0) and the product is 0. @@ -1623,6 +1630,11 @@ float64_muladd(float64 xa, float64 xb, float64 xc, i= nt flags, float_status *s) if (unlikely(!f64_is_zon3(ua, ub, uc))) { goto soft; } + + if (unlikely(force_soft_fma)) { + goto soft; + } + /* * When (a || b) =3D=3D 0, there's no need to check for under/over flo= w, * since we know the addend is (normal || 0) and the product is 0. @@ -7974,3 +7986,76 @@ float128 float128_scalbn(float128 a, int n, float_st= atus *status) , status); =20 } + +#ifdef CONFIG_CPUID_H +#include "qemu/cpuid.h" +#endif + +static void check_host_hw_fma(void) +{ +#ifdef CONFIG_CPUID_H + int max =3D __get_cpuid_max(0, NULL); + int a, b, c, d; + bool has_fma3 =3D false; + bool has_fma4 =3D false; + bool has_avx =3D false; + + if (max >=3D 1) { + __cpuid(1, a, b, c, d); + + /* check whether avx is usable */ + if (c & bit_OSXSAVE) { + int bv; + + __asm("xgetbv" : "=3Da"(bv), "=3Dd"(d) : "c"(0)); + if ((bv & 6) =3D=3D 6) { + has_avx =3D c & bit_AVX; + } + } + + if (has_avx) { + /* fma3 */ + has_fma3 =3D c & bit_FMA3; + + /* fma4 */ + __cpuid(0x80000000, a, b, c, d); + if (a >=3D 0x80000001) { + __cpuid(0x80000001, a, b, c, d); + + has_fma4 =3D c & bit_FMA4; + } + } + } + /* + * Without HW FMA, whatever the libc does is probably slower than our + * softfloat implementation. + */ + if (!has_fma3 && !has_fma4) { + force_soft_fma =3D true; + } +#endif +} + +static void __attribute__((constructor)) softfloat_init(void) +{ + union_float64 ua, ub, uc, ur; + + if (QEMU_NO_HARDFLOAT) { + return; + } + + /* + * Test that the host's FMA is not obviously broken. For example, + * glibc < 2.23 can perform an incorrect FMA on certain hosts; see + * https://sourceware.org/bugzilla/show_bug.cgi?id=3D13304 + */ + ua.s =3D 0x0020000000000001ULL; + ub.s =3D 0x3ca0000000000000ULL; + uc.s =3D 0x0020000000000000ULL; + ur.h =3D fma(ua.h, ub.h, uc.h); + if (ur.s !=3D 0x0020000000000001ULL) { + force_soft_fma =3D true; + } + + check_host_hw_fma(); +} diff --git a/include/qemu/cpuid.h b/include/qemu/cpuid.h index 69301700bd..320926ffe0 100644 --- a/include/qemu/cpuid.h +++ b/include/qemu/cpuid.h @@ -25,6 +25,9 @@ #endif =20 /* Leaf 1, %ecx */ +#ifndef bit_FMA3 +#define bit_FMA3 (1 << 12) +#endif #ifndef bit_SSE4_1 #define bit_SSE4_1 (1 << 19) #endif @@ -53,5 +56,8 @@ #ifndef bit_LZCNT #define bit_LZCNT (1 << 5) #endif +#ifndef bit_FMA4 +#define bit_FMA4 (1 << 16) +#endif =20 #endif /* QEMU_CPUID_H */ --=20 2.17.1 From nobody Mon Jun 24 12:18:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 154696463984853.693687267844666; Tue, 8 Jan 2019 08:23:59 -0800 (PST) Received: from localhost ([127.0.0.1]:53886 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gguAX-0005IH-E1 for importer@patchew.org; Tue, 08 Jan 2019 11:23:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggu8h-0004EK-RI for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggu8e-0000bg-Lq for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:01 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:35400) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggu8e-0000YH-DG for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:00 -0500 Received: by mail-wm1-x341.google.com with SMTP id t200so5062444wmt.0 for ; Tue, 08 Jan 2019 08:22:00 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id z206sm10345054wmc.18.2019.01.08.08.21.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 08:21:56 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id C471D3E117B; Tue, 8 Jan 2019 16:21:54 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Pte7Wj4rgezoXgNvGxvsFaiSdpnOauW2cBpolG/kvlw=; b=dxp3bp6/vl0AnZznNW6Rwh0G/S8QHmXWtG3SumESv2ti2ZlHfPJL2URa0eh6DoedoQ J76f6bvJbpSEDe8/jXM8cVaerwRpu82YKJ74NjDTNz3eVCUTRxsuNEZ0GCyBWCRWygdz 0SlG1/msr6wSx3JWgJI7IXeJV2ZtuuNJbvJRo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Pte7Wj4rgezoXgNvGxvsFaiSdpnOauW2cBpolG/kvlw=; b=kRNva/TehEMDqvEOm7vNc/FNFqHXjaItPX0Hm1Qmyf3wlXthOjEJAiCA5bO59JgfBs 1xHCmxsKYyGN0j7zBJ8EsDvOJC2pgTvWaY0gaDZEAz2zcyeDvxI62kq5ipky64L3hwjA FHQAz2noPeDgav1SIOa5LMajV3HIkcE33uL204VVImX99dpcZVbkZd7sKKOFjbVTbqpY MFIWSKSpfe8XUVF4MzS1r73TSPymChikzau0j5uhetKZE6fKg30Y8MwXVlB9qMJU8IAs Ol+EMGJ/Bs5/zTR7fjcupWVv2WO4xgQtlE6XwlY8Zgmip7eUk4d/mJeEptZvO2ENFlpx bs0w== X-Gm-Message-State: AJcUuke/SuN/wHgs67/qx+UD5gvHBMQW8HSbRp6B7mWR2Sm6dZKRX4qg dOVGmSlHHDrRu+Y4frq6r2kZSQJMaz8= X-Google-Smtp-Source: ALg8bN6ovGYh6zeMQOIJt31cFIGGyIDgBH7POURs/EeIAKBTnqCkDHnH6Ii6J/UPaEEtnLfVxKv58A== X-Received: by 2002:a1c:a548:: with SMTP id o69mr2348287wme.118.1546964519266; Tue, 08 Jan 2019 08:21:59 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 8 Jan 2019 16:21:52 +0000 Message-Id: <20190108162154.22259-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190108162154.22259-1-alex.bennee@linaro.org> References: <20190108162154.22259-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 Subject: [Qemu-devel] [PATCH v1 4/6] tests/Makefile: add floating point tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Wire up test/fp-test into the main testing Makefile. Currently we skip some of the extF80 and f128 related tests. Once we re-factor and fix these tests the plumbing should get simpler. Signed-off-by: Alex Benn=C3=A9e --- tests/Makefile.include | 115 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/tests/Makefile.include b/tests/Makefile.include index 3f5a1d0c30..69610c0ed1 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -844,6 +844,121 @@ check-report.xml: $(patsubst %,check-report-qtest-%.x= ml, $(QTEST_TARGETS)) check check-report.html: check-report.xml $(call quiet-command,gtester-report $< > $@,"GEN","$@") =20 +# FPU Emulation tests (aka softfloat) +# +# As we still have some places that need fixing the rules are a little +# more complex than they need to be and have to override some of the +# generic Makefile expansions. Once we are cleanly passing all +# the tests we can simplify the make syntax. + +# the build dir is created by configure +$(BUILD_DIR)/tests/fp/fp-test: $(BUILD_DIR)/tests/fp + $(call quiet-command, \ + cd $(BUILD_DIR)/tests/fp && make, \ + "BUILD", $<) + +# The full test suite can take a bit of time, default to a quick run +ifeq ($(SPEED), quick) +FP_TL=3D-l 1 +else +FP_TL=3D-l 2 -r all +endif + +# $1 =3D tests, $2 =3D description +test-softfloat =3D $(call quiet-command, \ + cd $(BUILD_DIR)/tests/fp && ./fp-test -s $(FP_TL) $1 > $2.out 2> $2.err= , \ + "FLOAT TEST", $2) + +# Conversion Routines: +# FIXME: i32_to_extF80 (broken), i64_to_extF80 (broken) +# ui32_to_f128 (not implemented), f128_to_ui32 (not implemented) +# extF80_roundToInt (broken) +# +check-softfloat-conv: tests/fp/fp-test + $(call test-softfloat, \ + i32_to_f16 i64_to_f16 \ + i32_to_f32 i64_to_f32 \ + i32_to_f64 i64_to_f64 \ + i32_to_f128 i64_to_f128, int-to-float) + $(call test-softfloat, \ + ui32_to_f16 ui64_to_f16 \ + ui32_to_f32 ui64_to_f32 \ + ui32_to_f64 ui64_to_f64 \ + ui64_to_f128, uint-to-float) + $(call test-softfloat, \ + f16_to_i32 f16_to_i32_r_minMag \ + f32_to_i32 f32_to_i32_r_minMag \ + f64_to_i32 f64_to_i32_r_minMag \ + extF80_to_i32 extF80_to_i32_r_minMag \ + f128_to_i32 f128_to_i32_r_minMag \ + f16_to_i64 f16_to_i64_r_minMag \ + f32_to_i64 f32_to_i64_r_minMag \ + f64_to_i64 f64_to_i64_r_minMag \ + extF80_to_i64 extF80_to_i64_r_minMag \ + f128_to_i64 f128_to_i64_r_minMag, \ + float-to-int) + $(call test-softfloat, \ + f16_to_ui32 f16_to_ui32_r_minMag \ + f32_to_ui32 f32_to_ui32_r_minMag \ + f64_to_ui32 f64_to_ui32_r_minMag \ + f16_to_ui64 f16_to_ui64_r_minMag \ + f32_to_ui64 f32_to_ui64_r_minMag \ + f64_to_ui64 f64_to_ui64_r_minMag, \ + float-to-uint) + $(call test-softfloat, \ + f16_roundToInt f32_roundToInt \ + f64_roundToInt f128_roundToInt, \ + round-to-integer) + +# Generic rule for all float operations +# +# Some patterns are overidden due to broken or missing tests. +# Hopefully these can be removed over time. + +check-softfloat-%: tests/fp/fp-test + $(call test-softfloat, f16_$* f32_$* f64_$* extF80_$* f128_$*, $*) + +# Float Compare routines +SF_COMPARE_OPS=3Deq eq_signaling le le_quiet lt_quiet +SF_COMPARE_RULES=3D$(patsubst %,check-softfloat-%, $(SF_COMPARE_OPS)) + +# FIXME: extF80_le_quiet (broken) +check-softfloat-le_quiet: tests/fp/fp-test + $(call test-softfloat, \ + f16_le_quiet f32_le_quiet f64_le_quiet \ + f128_le_quiet, \ + le_quite) + +# FIXME: extF80_lt_quiet (broken) +check-softfloat-lt_quiet: tests/fp/fp-test + $(call test-softfloat, \ + f16_lt_quiet f32_lt_quiet f64_lt_quiet \ + f128_lt_quiet, \ + lt_quite) + +.PHONY: check-softfloat-compare +check-softfloat-compare: $(SF_COMPARE_RULES) + +# Math Operations + +# FIXME: extF80_mulAdd (missing) +check-softfloat-mulAdd: tests/fp/fp-test + $(call test-softfloat, \ + f16_mulAdd f32_mulAdd f64_mulAdd f128_mulAdd, \ + mulAdd) + +# FIXME: extF80_rem (broken) +check-softfloat-rem: tests/fp/fp-test + $(call test-softfloat, \ + f16_rem f32_rem f64_rem f128_rem, \ + rem) + +SF_MATH_OPS=3Dadd sub mul mulAdd div rem sqrt +SF_MATH_RULES=3D$(patsubst %,check-softfloat-%, $(SF_MATH_OPS)) + +.PHONY: check-softfloat-ops +check-softfloat-ops: $(SF_MATH_RULES) + # Per guest TCG tests =20 LINUX_USER_TARGETS=3D$(filter %-linux-user,$(TARGET_DIRS)) --=20 2.17.1 From nobody Mon Jun 24 12:18:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1546964966572675.8989210895062; Tue, 8 Jan 2019 08:29:26 -0800 (PST) Received: from localhost ([127.0.0.1]:54431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gguFn-0001WU-RL for importer@patchew.org; Tue, 08 Jan 2019 11:29:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggu8s-0004Mi-BN for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggu8o-00017c-J3 for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:13 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:53974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggu8j-0000dg-FF for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:09 -0500 Received: by mail-wm1-x32d.google.com with SMTP id d15so4712601wmb.3 for ; Tue, 08 Jan 2019 08:22:03 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g9sm9892244wmg.44.2019.01.08.08.21.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 08:21:57 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id D96B73E118E; Tue, 8 Jan 2019 16:21:54 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sncl268j326mbrHK+6GzulZI9Mox7RKtqTWf6ITvKco=; b=P12do+pvLZ0mAslQRcv9ORsh3oaROOnTQh7LVGhPyWc+oSN7j8dXDR7wX7fOMangjU 3eV23935nueVd0VWlR69KioASp8gL0h+3u9SxKm9AuAicZo9obqzJPcDzLodunx/8Edi e8LwREoHzRWAX3a3IbaScKIkXGSpixIkCZJmY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sncl268j326mbrHK+6GzulZI9Mox7RKtqTWf6ITvKco=; b=YrNU4ZDaLLxhowYaToY4f6Rq+9o9IHnwHyO4xNBsC66dMFBkwF1/NjnTuz2s/PNkdI E23ArKm4acm/ehWDg6dlhzjrLn60cpr6zbYMyM6zjqYsG5mXHcGRbjmJ23NyXXhSL+Xm 7eVeHPzqc9vsoHIgxMEIg/p+YbaTEerHWJ7Nv/F73RxQG732m3vUxdQ4d7pI61BcF50S y+fYF66Xmr6dtiGoP0azoekDmJJ3avNazH3D3bxjPrsxJ9EDZ1zQwENq3VIg0jPBkki7 Czk4Yki9CZOvM9XTPSU0nULXSRSV1gTZXMnvY3trEQGYFlu4pbOasRgi4qMM13KrFVo2 Iexg== X-Gm-Message-State: AJcUuke2WX1999xNcIDU5hVCKw5XVmaqBilvnENa1OGNDKUzlAHlesd/ 05OUNvtnSxRe78P08WX+onCHvSMjfYA= X-Google-Smtp-Source: ALg8bN6geq/erAGBbASBeM14VJl9sfyAhndCV6Uc7ZC88Twn5onP/Cp4GvFvi/PRVzmIQr6zeIR32w== X-Received: by 2002:a7b:c218:: with SMTP id x24mr2298105wmi.58.1546964520935; Tue, 08 Jan 2019 08:22:00 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 8 Jan 2019 16:21:53 +0000 Message-Id: <20190108162154.22259-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190108162154.22259-1-alex.bennee@linaro.org> References: <20190108162154.22259-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d Subject: [Qemu-devel] [PATCH v1 5/6] scripts/archive-source: include softfloat tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We need these if we want to run unit/softfloat tests in our docker containers. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- scripts/archive-source.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index 62bd22578b..6eed2a29bd 100755 --- a/scripts/archive-source.sh +++ b/scripts/archive-source.sh @@ -26,7 +26,7 @@ vroot_dir=3D"${tar_file}.vroot" # independent of what the developer currently has initialized # in their checkout, because the build environment is completely # different to the host OS. -submodules=3D"dtc ui/keycodemapdb" +submodules=3D"dtc ui/keycodemapdb tests/fp/berkeley-softfloat-3 tests/fp/b= erkeley-testfloat-3" =20 trap "status=3D$?; rm -rf \"$list_file\" \"$vroot_dir\"; exit \$status" 0 = 1 2 3 15 =20 --=20 2.17.1 From nobody Mon Jun 24 12:18:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1546964791249199.30651027361057; Tue, 8 Jan 2019 08:26:31 -0800 (PST) Received: from localhost ([127.0.0.1]:54127 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gguCx-0007Rb-P5 for importer@patchew.org; Tue, 08 Jan 2019 11:26:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggu8s-0004Mh-BF for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggu8o-00017Y-J4 for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:13 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:55813) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggu8k-0000bo-GX for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:09 -0500 Received: by mail-wm1-x344.google.com with SMTP id y139so4666121wmc.5 for ; Tue, 08 Jan 2019 08:22:01 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l20sm115623313wrb.93.2019.01.08.08.21.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 08:21:57 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id EB6CB3E11E5; Tue, 8 Jan 2019 16:21:54 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Dl11T0QaTAXzCTmUGQS54C+SDceurmzs5fdGU6KlM+c=; b=jQN6v+Y5qQ0CJqS9uvTtpWQixgVwQTs6pnz1ffnG+a4Uf+Qs1TfnvHgAWa1QunaLDj gXjtCYU3hGDFFfFgBMLcafyn7n5eBQf08HlqwqV6tPSkJGSdbVvB/Hi3J3fN/QA2iU9Y MFZ1VQ80MR1poiHvCVStq0RM6cg5oxnZC2hdM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dl11T0QaTAXzCTmUGQS54C+SDceurmzs5fdGU6KlM+c=; b=btAWpBL7YWF5H0BYAQOtBmdZEoVnbJH6gQrxwDUdAMKGUG8zhAzq7reXP/vSsOSiBf q0KmtOCZzbAKD6UQWtpFfMpx/osJYJEfipxzcHFkJwYT/bdIaI+/+hrH/e1i0dxKrNM2 3hAI/bhebvagyEvM0Tt3/+z8uTml5ulM9H0OQIm0dzpwgbOgCzsUga/PueclTnFrlf3D Gf7I7TPKJOF+cx6878zS5zUOgXhPNf4N5tB7wPUsIahMVcoSMhH6kOoVDoz+wcEbjeYL NgQ4CncpsKcCfaAqz2flPihT1ZO79xpuxJcG3AqAbY2Y5HQS0ddXpfcs8DR5pNEBRee3 JJcg== X-Gm-Message-State: AJcUukdenX8pcR1HgH7TOFB8Euklk+PTMsL2tfQv3Zl1lNbLj6pyawOC hfCPooR3x+JWq0qyWRQV141R0Q== X-Google-Smtp-Source: ALg8bN4fafPvFAtX0FwxviGRo6+zfQVsLn/PFRiQr8CJktS4yQUaf8K6CiQmY2EoAIVhLaMy2WrbSw== X-Received: by 2002:a1c:2d4b:: with SMTP id t72mr2095262wmt.99.1546964520246; Tue, 08 Jan 2019 08:22:00 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 8 Jan 2019 16:21:54 +0000 Message-Id: <20190108162154.22259-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190108162154.22259-1-alex.bennee@linaro.org> References: <20190108162154.22259-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v1 6/6] tests/Makfile: add check-softfloat rule X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cota@braap.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This adds a rule to run all of our softfloat tests. It is included as a pre-requisite to check-tcg and check-unit as well. Signed-off-by: Alex Benn=C3=A9e --- tests/Makefile.include | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 69610c0ed1..efbfe7708a 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -11,6 +11,7 @@ check-help: @echo " $(MAKE) check-qapi-schema Run QAPI schema tests" @echo " $(MAKE) check-block Run block tests" @echo " $(MAKE) check-tcg Run TCG tests" + @echo " $(MAKE) check-softfloat Run FPU emulation tests" @echo " $(MAKE) check-acceptance Run all acceptance (functional) test= s" @echo " $(MAKE) check-report.html Generates an HTML test report" @echo " $(MAKE) check-venv Creates a Python venv for tests" @@ -959,6 +960,18 @@ SF_MATH_RULES=3D$(patsubst %,check-softfloat-%, $(SF_M= ATH_OPS)) .PHONY: check-softfloat-ops check-softfloat-ops: $(SF_MATH_RULES) =20 +# Finally a generic rule to test all of softfoat. If TCG isnt't +# enabled we define a null operation which skips the tests. + +.PHONY: check-softfloat +ifeq ($(CONFIG_TCG),y) +check-softfloat: check-softfloat-conv check-softfloat-compare check-softfl= oat-ops +else +check-softfloat: + $(call quiet-command, /bin/true, "FLOAT TEST", \ + "SKIPPED for non-TCG builds") +endif + # Per guest TCG tests =20 LINUX_USER_TARGETS=3D$(filter %-linux-user,$(TARGET_DIRS)) @@ -991,7 +1004,7 @@ clean-tcg-tests-%: build-tcg: $(BUILD_TCG_TARGET_RULES) =20 .PHONY: check-tcg -check-tcg: $(RUN_TCG_TARGET_RULES) +check-tcg: check-softfloat $(RUN_TCG_TARGET_RULES) =20 .PHONY: clean-tcg clean-tcg: $(CLEAN_TCG_TARGET_RULES) @@ -1072,7 +1085,7 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR) .PHONY: check-qapi-schema check-qtest check-unit check check-clean check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y)) check-tes= ts/qapi-schema/doc-good.texi check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS)) -check-unit: $(patsubst %,check-%, $(check-unit-y)) +check-unit: $(patsubst %,check-%, $(check-unit-y)) check-softfloat check-speed: $(patsubst %,check-%, $(check-speed-y)) check-block: $(patsubst %,check-%, $(check-block-y)) check: check-qapi-schema check-unit check-qtest check-decodetree --=20 2.17.1