From patchwork Tue Jun 19 15:43:57 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: 139171 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5378853lji; Tue, 19 Jun 2018 08:57:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKILADbErJGa6xhr2xPFQwP0oL42+A/oqWC1DIhZm99hmCqtyAyeQFSGAGsE9B0cop6OStub X-Received: by 2002:aed:3fc8:: with SMTP id w8-v6mr15479457qth.262.1529423860732; Tue, 19 Jun 2018 08:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529423860; cv=none; d=google.com; s=arc-20160816; b=NrPmdgODPWRG9M6Xy05rcw0x5Un8ugYGBaEhO0mQtJODvVQfWiKif4u0ZWb1Y5Bxpg K3G8LPJlHgNGFfyxOmSdfg0huXLBEnvwVxy49oapfnEoB3nXTQ6ZRbKZVCtq63F6//I3 ikRZbnCHC3WnYLV/syLY6hd2Uy6KhinEQ6j841g3rMXhNLDyrc3zzEZ2yq0xMC0OZUox aRixP7/37itxlVGnNYI5GINHWJgRd8/b6RTa1eSoMO7WDKASv/uk8U/8L0u+fLaZBLzq pj6OCsyGMKGT9ckx5WtlIyD23haEgJg4mMpKxFGJorf+37nllB7Ghe7MVaoBm8v0fFTh 3ePg== 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=IaTqRfOb4P7cqlBWHljxQDEUSYW1YT4Pg98hjHTwvdY=; b=0UziLdMXv/7KEj1MpvEfe+wHIVObmi/HLj0zP3V6/OQTc0hVCc3w9QG3AQNl8Rlerz j93HJIfBuPOAxnP8N18Vot8YEZREDGbN2ZkZgW968QEEXxkb2qI7c5TOJmIAQiUsflud aPL2E8/y8MwiDwUDDrSQkN7fkATDps9pifz/doRQjdoiYG0Dhv68CID75VHGu+KkoQCD Y+aZdkj4uTeY4sBknY9bQXQpuzeKs2uzWqLgjqoHNTLfnzlGNQ9D8wZ+Jndc9NjrBvby YNDi4AYT2qvZP+QKuEbIN/qQzsepjPJIdmT/mSQRiSG2jbWzzHBq+5Oc73XBPPad7hfY vfbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Ta/+tkAl"; 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 s8-v6si54250qta.56.2018.06.19.08.57.40 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Jun 2018 08:57:40 -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="Ta/+tkAl"; 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]:43402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVJ0m-0000PE-5U for patch@linaro.org; Tue, 19 Jun 2018 11:57:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVIoR-0006jN-1M for qemu-devel@nongnu.org; Tue, 19 Jun 2018 11:44:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVIoP-0006V5-Qi for qemu-devel@nongnu.org; Tue, 19 Jun 2018 11:44:55 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:40414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVIoP-0006Ue-Jc for qemu-devel@nongnu.org; Tue, 19 Jun 2018 11:44:53 -0400 Received: by mail-wr0-x241.google.com with SMTP id l41-v6so144470wre.7 for ; Tue, 19 Jun 2018 08:44:53 -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=IaTqRfOb4P7cqlBWHljxQDEUSYW1YT4Pg98hjHTwvdY=; b=Ta/+tkAli+SgN4xwItxtmU/0DVw5oJsxiZRLPtmsleCUtKjFNOJVtur0pzLYEsSI30 XgWqAqfQLTWyAa9oVtO+rnaHyPPDFsFVuK1bsfj8XoNhIEeMB3R7t1i/cnE/mGshuyqt h3BpBDLbHdMvPmeMOmtQ2JUE1bWPWihIr0ERA= 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=IaTqRfOb4P7cqlBWHljxQDEUSYW1YT4Pg98hjHTwvdY=; b=mSWsdW8AYEZC1wt92ztz35HCCwfhUQj85hCdBjbqnC6i3Dzn1v4gpx4F/JjrJtgYd4 aYqtb/FU09Rgq2d+Ladan/oukgHzY5qEuIN8tXQhl/e2Dp0SaSfYj+25M4Q8HvylYgWu kEsCJcMJ12aYP3sCryBxvJRD0J1R/cadkhix5XVeQYElNVUvci+mZjxmTzcab33878Ov wLxMO9LydIzR+TFmNmuQILxMl5odVBzn8ru45VJxjKgyd36brMYqIDfoC5/n2i+QrwDq HBZ3vfcU0lzAcau2zFgrQVHkCeIXOycmkXWStSpMOc28mS54SZwk2SU96D/MeLUt+cPl WWfg== X-Gm-Message-State: APt69E2k/aPLXKsof/fYweEADYcIr+r/ZpyolSHUB/HqTecxJbigXwUL TO0qaBuB3JwhqgwaWVD9ieonJQ== X-Received: by 2002:adf:86ae:: with SMTP id 43-v6mr13371613wrx.281.1529423092507; Tue, 19 Jun 2018 08:44:52 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id q70-v6sm447696wmd.45.2018.06.19.08.44.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Jun 2018 08:44:48 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id F31C43E0B71; Tue, 19 Jun 2018 16:44:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 19 Jun 2018 16:43:57 +0100 Message-Id: <20180619154435.18898-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180619154435.18898-1-alex.bennee@linaro.org> References: <20180619154435.18898-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:c0c::241 Subject: [Qemu-devel] [PULL 18/56] 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: agraf@suse.de, Eduardo Habkost , =?utf-8?q?Alex_B?= =?utf-8?b?ZW5uw6ll?= , richard.henderson@linaro.org, qemu-devel@nongnu.org, f4bug@amsat.org, cota@braap.org, Paolo Bonzini , famz@redhat.com, aurelien@aurel32.net, 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 -- 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? */ }