From patchwork Thu Jun 21 06:25:27 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: 139474 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1688498lji; Wed, 20 Jun 2018 23:48:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKhbJrlIcz3Tg4uneAYDVRh59mBEvezJq1omqaDla4ZAePfBESTramwxhshW1fB3fgra69S X-Received: by 2002:ae9:e113:: with SMTP id g19-v6mr20999072qkm.9.1529563724458; Wed, 20 Jun 2018 23:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529563724; cv=none; d=google.com; s=arc-20160816; b=M3JKA6jho1yfK64p72DfuMOXncwidoUnesr+uYFGn+WtdS9f2YE4eXSjABjEL2epzy LBzM0rLrdG8XogbNEDhfqB2CVXkMXLx/EyWDKtA1/+kNapxEy9PkBN410tj7SLCQc+6D r/5xieB5bip//Ic2rGeRANd+jON9I57XE4PoYh9aEkdDvEVxJ7+ZgMfqp1rgUcDLuIxc ek93daeZWYdWeRGOj5vRt7CX2QfUTLWnu8FkYToRmMIMdVAU40JOElaNDmIbwAV+WOhH aqK8UoPITnWPhJ/Xna9KrfnW9Wdej02PHmDYW3eSpBqCMH6X4yq1nW/Uhjzn218sTzyk xTtg== 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=VxQ56s5ye6oB3sN0Qwu7CE/6mHBETSXVerOURgQuprc=; b=aBbNDr5HdEhCgufcGf0IahLe7An5Ina6IVsyuyiLuVm3gE0E18Wp2CVfDCusVz6vji S4tHUb4nVb1nDZJFYUBd7kIia4L7Z91FkMlXGHblw/gPNA8lQtqOQEfWv+EI9D9TYM3/ v/8AfDXkeZrrBBp0EMs0qyfBt/IJcn+vd+gepsyq3W+l7yb4jwd6NSxnzMdXAepIAZCZ 2LRIpX/INz3zmt8eaHXpi+FWJOaEelQrMDnv1mZgVzVrqQW+QwBHSr0nxBbbVJFcpEVz FPZeZ5D5JwiJ92dCdj/5BdjCVnOWUtv2vUAJ2LPTLMp0SdU1AqVh7pJXQm/fbPqUoJYL 7zvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JS9xNLfI; 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 g9-v6si1669378qta.301.2018.06.20.23.48.44 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 20 Jun 2018 23:48:44 -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=JS9xNLfI; 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]:53353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVtOd-0001cY-Uf for patch@linaro.org; Thu, 21 Jun 2018 02:48:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVt8a-0005p5-Dj for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:32:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVt8Z-0003xR-3m for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:32:08 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:35246) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVt8Y-0003w4-TY for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:32:07 -0400 Received: by mail-wr0-x243.google.com with SMTP id l8-v6so1846101wrr.2 for ; Wed, 20 Jun 2018 23:32:06 -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=VxQ56s5ye6oB3sN0Qwu7CE/6mHBETSXVerOURgQuprc=; b=JS9xNLfI4tPajPgAgT79F2maCCVi1Et9O3Ikn4YA2P2PG7/0Vq+1BZ4Q2/xCxFO65+ 7Q55ciFYcGMGr59OPJ9Ws1v8UaBUCKv1kjFoQASVjtM7DbBju/sJpVmFPLdxEqNPNtC0 A4doAfiBj9bWkdKeH5/r3V3+sJtJgMebrHLBM= 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=VxQ56s5ye6oB3sN0Qwu7CE/6mHBETSXVerOURgQuprc=; b=bdQ6tYXow5USu3RzAxkrjWybl6P6H+MITjFgaYIqPsGRHgfwizMZ3xQZ/KN3v21/eo SpUHFJUwviUvA0BRGzR7v/NS8zLcUbaBUOZkVM75ntq+/S0vPyOkuVjiQ1kFh3gUcVSE s4jUgsBkNyFQfPP1mXMzqmcJJvu1HmmabyKHyzwDh5HhFp+1PoSxDU3TYwkS8bSjB4AP ZfDhQxxEkj5BHVky3t/qn1WUaQR0zgzNGLT3Vqq/hJN7c0KHscWkmpXOmPR47+CeBG4r 9RwyyAV/LkReKWXHaK+kBbv+ry1+2Q33mGd5+ThvZEKBqG6o2CRxJ2xIixSCOTrsFCSg E3HA== X-Gm-Message-State: APt69E3p0HucS/wUyJsiY/4+MPAKw5n5FE17olo1WObQrq/Otk3hH55l 4xUeLaERTkICXh96FcA/my3t1w== X-Received: by 2002:adf:b8c7:: with SMTP id c7-v6mr21272276wrg.65.1529562725907; Wed, 20 Jun 2018 23:32:05 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b15-v6sm8043635wri.14.2018.06.20.23.31.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 23:32:02 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id D47FC3E0BC6; Thu, 21 Jun 2018 07:26:06 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Thu, 21 Jun 2018 07:25:27 +0100 Message-Id: <20180621062605.941-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180621062605.941-1-alex.bennee@linaro.org> References: <20180621062605.941-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::243 Subject: [Qemu-devel] [PULL v2 19/57] 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é -- 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? */ }