From nobody Tue Feb 10 20:48:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.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 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528462227445926.5058390626375; Fri, 8 Jun 2018 05:50:27 -0700 (PDT) Received: from localhost ([::1]:35445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRGqV-0006Ld-4G for importer@patchew.org; Fri, 08 Jun 2018 08:50:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRGa2-0001FD-KW for qemu-devel@nongnu.org; Fri, 08 Jun 2018 08:33:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRGa1-0006Gi-Ii for qemu-devel@nongnu.org; Fri, 08 Jun 2018 08:33:22 -0400 Received: from mail-wr0-x232.google.com ([2a00:1450:400c:c0c::232]:46209) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRGa1-0006G0-B9 for qemu-devel@nongnu.org; Fri, 08 Jun 2018 08:33:21 -0400 Received: by mail-wr0-x232.google.com with SMTP id v13-v6so13226285wrp.13 for ; Fri, 08 Jun 2018 05:33:21 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id m58-v6sm62871716wrf.61.2018.06.08.05.33.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Jun 2018 05:33:15 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 7AFBF3E0630; Fri, 8 Jun 2018 13:33:08 +0100 (BST) 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=hYsmMjJjnKmwMp98KssV3gWsAVodBXDBZxTPghBOj0I=; b=P2z89BrwQRLiZ+ouId94kBURWB+bMC9lrxtxWA+Amm6x7tvAjDs8Un6fcVwVzVEEvL 4iwE7gTYHAj2zUHKdW1Ta2BS5lVYa7z5q8l7iTeBjfiWKuov/VLDHNAiLwIDFR4reSK7 r9C8kWa44r9CyRCtifiIH3s4D5BUtZBJPBR8s= 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=hYsmMjJjnKmwMp98KssV3gWsAVodBXDBZxTPghBOj0I=; b=uK5Ri1C7eRd0TgfDHzTiOvdMGWZjuJlq5030FnejLOVQJJn5j9neYtyaJKC7VPoXxf 5GX5TDELCBz8upMzsrScp4yuDaOV95pIxpiGMSXUkaJWRcr0eOw2EuSgzG12FU152OhN eBAwjsq9w/gCx+xjmxYqJAy0i6wcCcC9aT35OoyTbdAEuDknXDZNFgWjxfWW1oIt+hQD dxSs9U8YEcseJn0pzFYgyQTyNbTAS17C0HmXDBof/ESa1XtscYjw41jY3DAp3j6WK2zc sP1vMICVC+WkWCve+TB174ada5JFYGQ0rzn0QWexXHX8ZDTHLw7ul4sBomiaHrRLiLoh I/+Q== X-Gm-Message-State: APt69E2cbpxK2l0IYNW//+gN+bpLupKz2VTBdtEvGmWCLn2MPTYaAJNa e0y1ASlFRSsZ+m89rhprHK66Ag== X-Google-Smtp-Source: ADUXVKKI63sFN9uUTD6Q1gShrM9/Gdx/jJP9bLAstsF2NWxIeqejqSztpnNU1ZPA9OtuvG8PT2cNlg== X-Received: by 2002:adf:f391:: with SMTP id m17-v6mr4745541wro.279.1528461200270; Fri, 08 Jun 2018 05:33:20 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de, pbonzini@redhat.com, stefanha@redhat.com, stefanb@linux.vnet.ibm.com, marcandre.lureau@redhat.com Date: Fri, 8 Jun 2018 13:32:35 +0100 Message-Id: <20180608123307.24773-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180608123307.24773-1-alex.bennee@linaro.org> References: <20180608123307.24773-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:400c:c0c::232 Subject: [Qemu-devel] [PATCH v6 17/49] tests/tcg/i386: add runner for test-i386-fprem 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 The runner needs to compare against a reference run. We also only run this test when SPEED=3Dslow as it takes a while. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- v5 - include test-i386-fprem.ref v5.1 - remove the 69Mb test-i386-fprem.ref - generate test-i386-fprem.ref on developers machine - add TIMEOUT=3D60 --- tests/tcg/i386/Makefile.target | 16 ++++++++++++++++ tests/tcg/i386/test-i386-fprem.c | 12 +++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target index 8b46cc021e..64d241cfdf 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -33,5 +33,21 @@ test-i386: test-i386.c test-i386-code16.S test-i386-vm86= .S test-i386.h test-i386 run-runcom: runcom pi_10.com $(call quiet-command, $(QEMU) ./runcom $(I386_SRC)/pi_10.com > runcom.out= , "TEST", "$< on $(TARGET_NAME)") =20 +ifeq ($(SPEED), slow) + +test-i386-fprem.ref: test-i386-fprem + $(call quiet-command, ./$< > $@,"GENREF","generating $@") + +run-test-i386-fprem: TIMEOUT=3D60 +run-test-i386-fprem: test-i386-fprem + $(call quiet-command, \ + $(QEMU) $< > $<.out && \ + diff -u $(I386_SRC)/$<.ref $<.out, \ + "TEST", "$< (default) on $(TARGET_NAME)") +else +run-test-i386-fprem: test-i386-fprem + $(call quiet-command, /bin/true, "SLOW TEST", "$< SKIPPED on $(TARGET_NAM= E)") +endif + # On i386 and x86_64 Linux only supports 4k pages (large pages are a diffe= rent hack) EXTRA_RUNS+=3Drun-test-mmap-4096 diff --git a/tests/tcg/i386/test-i386-fprem.c b/tests/tcg/i386/test-i386-fp= rem.c index 1a71623204..66f5a9657d 100644 --- a/tests/tcg/i386/test-i386-fprem.c +++ b/tests/tcg/i386/test-i386-fprem.c @@ -23,7 +23,10 @@ * along with this program; if not, see . */ =20 -#include "qemu/osdep.h" +#include +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) =20 /* * Inspired by 's union ieee854_long_double, but with single @@ -39,7 +42,7 @@ union float80u { unsigned int exponent:15; unsigned int negative:1; unsigned int empty:16; - } QEMU_PACKED ieee; + } __attribute__((packed)) ieee; =20 /* This is for NaNs in the IEEE 854 double-extended-precision format. = */ struct { @@ -49,7 +52,7 @@ union float80u { unsigned int exponent:15; unsigned int negative:1; unsigned int empty:16; - } QEMU_PACKED ieee_nan; + } __attribute__((packed)) ieee_nan; }; =20 #define IEEE854_LONG_DOUBLE_BIAS 0x3fff @@ -229,6 +232,7 @@ static void test_fprem_cases(void) do_fprem_stack_underflow(); =20 printf("=3D invalid operation =3D\n"); + do_fprem(q_nan.d, 1.0); do_fprem(s_nan.d, 1.0); do_fprem(1.0, 0.0); do_fprem(pos_inf.d, 1.0); @@ -238,6 +242,8 @@ static void test_fprem_cases(void) do_fprem(pos_denorm.d, 1.0); do_fprem(1.0, pos_denorm.d); =20 + do_fprem(smallest_positive_norm.d, smallest_positive_norm.d); + /* printf("=3D underflow =3D\n"); */ /* TODO: Is there a case where FPREM raises underflow? */ } --=20 2.17.1