From patchwork Fri Jun 15 19:46:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 138817 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1294545lji; Fri, 15 Jun 2018 13:40:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKKmkZ9OK0Rlwcy+DkXmZ8oS8I0IHE1kbCH0ls/EstQ99QEvvpjabHxvlo8A+wY+ggv3i7l X-Received: by 2002:a37:6894:: with SMTP id d142-v6mr2773372qkc.348.1529095231907; Fri, 15 Jun 2018 13:40:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529095231; cv=none; d=google.com; s=arc-20160816; b=iygvhAQAaUIIqVsB8SgQGVoKKwveL/WqmfLZOC89u7imUcWuTCItpb2TavM8qBYkbZ CoULIYaTdKkVMxFPjrrFnCmeaw9gA/chyQcc9UWzkwTotwpQ1Nd1f+5fYF4O9ihHWeC5 zsxNX/t8SIsvVipuWW4/pTOzHMGxhqq53ltaz/dKXevGHDtbP7YH9QpOEY43MmPT6xlN 430o4S+dACUA29rCenD/qHg3psvVVQ6J4Z6Fav1SC4xqgOl88LzfLXliPFQjtDM6AXv9 V9dDd9t6esMMiBYMYBX+t01OQNZinDVdolyg1KSRxStBwTLdI43fV1KWyC/sobRHpr1/ 995w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=JJuWuvJJaqmpA1JDMnPjci5XY8PH5s/2mcDjRcXEBD8=; b=K1qe5EsjFObMbdh6NM7t0P5G8QaHZ8hD9y/8xVEbeNg+8//W+cQ2RDXb8+ScmOlx6u APiRa1Mazg/ssiRyo5I9bP0vuVFc2esetxUorFGy5rTG4JupiS6w81tfBfa/aqZvFatQ r7PiQJZ8bZL8/p20BCS4OeSAn70mEMck0gCuSMkfWMYvBPYenR3xgB24xeDX2WoXdV6u DoX4uXKhT9skard5yG69gF3dYc95juuNc+3h3QAi1YYCu+9Jh2Nwzn6LGm4f/TdlBFSU +wuQycUisJr9LSp/a3CQzFWFnrzFuqHlyEsv5u/01xfBVejaXVl1iF6w8JY/W4jfy75P VbPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QeqyCA3J; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o34-v6si6777800qtc.295.2018.06.15.13.40.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Jun 2018 13:40:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QeqyCA3J; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTvWJ-0001w1-6k for patch@linaro.org; Fri, 15 Jun 2018 16:40:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTuoi-0000lV-IA for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:55:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTuoh-0006s7-De for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:55:28 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:35209) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTuoh-0006rh-5a for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:55:27 -0400 Received: by mail-wm0-x22e.google.com with SMTP id j15-v6so5791415wme.0 for ; Fri, 15 Jun 2018 12:55:26 -0700 (PDT) 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=JJuWuvJJaqmpA1JDMnPjci5XY8PH5s/2mcDjRcXEBD8=; b=QeqyCA3Jkpj8mxV+OU4pIeX11wDEOPt5N+bRVhll12PW+RP746dEzS4GRb19QoZsSc NZsz6zfF9COHb+ztQ9WSp0Pp/ggEouCsVUp0ryz0oCx8W7HaUwJy4Jr+F5chKtedg7in 0Hoqa7OcbGhFwdPAQbh5DnYKpuGszUZnqHxjQ= 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=JJuWuvJJaqmpA1JDMnPjci5XY8PH5s/2mcDjRcXEBD8=; b=jpsoSEDcez+vf0tdZsufRQR4KU7O+sLhOVbJUlsWCGxe606/1RNTexWe2OH8lJXghH Du9TWk26Fk0RmACMCbwfkmz+URO8PcV+pU+SSa2XN6+g+BlmMHsH2lbD1UlqD0ZQTO4Z 4WuHAKtkpG+RSJ9v7MxT67cNXzwFp8ISycinvXSchgnHe9MrCmvpW6RROZvNcSIpOQQE FE6s14kjBxd+8MTuTJZGFm8fPU8RDtSBi4epRQVv4WRhRnGn9S2pUWqUe5OtnMvKJt6T C0DNhHeZdLwGMMi0GzGe7GYR88OhRibS+3RrClXtpCcReNRZPEcPgsn1YCOLX9syhqVs JsfA== X-Gm-Message-State: APt69E1Ch9h4n+IyD9YwpFWEReiKBPr/xm1WallqAD0N9KX20ZFRX19N qwuYbVPdAErEM+h/nsEZwyoDmQ== X-Received: by 2002:a1c:69d7:: with SMTP id z84-v6mr2094224wmh.147.1529092525999; Fri, 15 Jun 2018 12:55:25 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c18-v6sm8420839wrq.17.2018.06.15.12.55.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Jun 2018 12:55:21 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id E6E0C3E0B71; Fri, 15 Jun 2018 20:47:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=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, peter.maydell@linaro.org Date: Fri, 15 Jun 2018 20:46:29 +0100 Message-Id: <20180615194705.28019-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180615194705.28019-1-alex.bennee@linaro.org> References: <20180615194705.28019-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22e Subject: [Qemu-devel] [PATCH v7 18/54] 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: Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Eduardo Habkost , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The runner needs to compare against a reference run. We also only run this test when SPEED=slow as it takes a while. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- 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=60 --- tests/tcg/i386/Makefile.target | 16 ++++++++++++++++ tests/tcg/i386/test-i386-fprem.c | 12 +++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) -- 2.17.1 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)") +ifeq ($(SPEED), slow) + +test-i386-fprem.ref: test-i386-fprem + $(call quiet-command, ./$< > $@,"GENREF","generating $@") + +run-test-i386-fprem: TIMEOUT=60 +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_NAME)") +endif + # On i386 and x86_64 Linux only supports 4k pages (large pages are a different hack) EXTRA_RUNS+=run-test-mmap-4096 diff --git a/tests/tcg/i386/test-i386-fprem.c b/tests/tcg/i386/test-i386-fprem.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 . */ -#include "qemu/osdep.h" +#include +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) /* * 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; /* 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; }; #define IEEE854_LONG_DOUBLE_BIAS 0x3fff @@ -229,6 +232,7 @@ static void test_fprem_cases(void) do_fprem_stack_underflow(); printf("= invalid operation =\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); + do_fprem(smallest_positive_norm.d, smallest_positive_norm.d); + /* printf("= underflow =\n"); */ /* TODO: Is there a case where FPREM raises underflow? */ }