From patchwork Fri May 25 15:04:56 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: 136939 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3707449lji; Fri, 25 May 2018 08:06:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIfoh+aEy/4kl4fy7wSxVYUQEm6MjfsqJhReYkIrhIGKdoRxaRCCvtvc3yfisdw4v5ihONt X-Received: by 2002:a0c:b29e:: with SMTP id r30-v6mr2547209qve.17.1527260806530; Fri, 25 May 2018 08:06:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527260806; cv=none; d=google.com; s=arc-20160816; b=qm1dVeQZ6xqA/XyBcSI4Fa6UVog2wCBpfjHV4cLzSGtgxYPOHbZ2vkOCum0yqEYvmp iLUr8Q+3h/9bgAjrjC2XkJYlaOPm1Ip36F4JKUEK0vlCLrbRCb0y0M3I8NBwB/xdwVyP 0aFeqtDy5U6ouFh0cKSHy0SjZbYHcCkqtarnqECa6duu17ZaRT3qq4HKqFGwaEDy/eMb JB71Gz1rRUY5Ar1Tp6UDMQKVdJ3BAzbU2Eoy3mUtTU+7YUJlgtviq+RPR0Wdl3h5a+mk 0XEMMWATGrYgVONhd1JXm2WiiRBZJv0rFGgtQntT81A8RMcP34e3Ohn51rPYSIVPU7/P iS4Q== 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=YGW/n4uIzpZ6dh+Spw93KGLkfy9gM+9TRiuXIcsy+cw=; b=sEaqFWRTTZBlpD4Tg0Qg/UhwRK07IgZMDW2tdrkDeRh6r6Kczc5u/DzKVRH6wdd2YB RCPSNZmNXDa5PSAOuHnoEOR58Cp9ae94b6xnG7m7tKI4pcZMzOtzO7cy7hu2ntwssY+O Dh6kvymOyT8C1UsxAGkLJaMO6BP1tA76Eww3xCmOB2V4dSOirQ8K3LeQzRAEEmpMMJNH oE1oz4yVs2Awn17YoZZ+6uAYsYUdyZ6AHAtGil4h22hjDBHGkW0Qf0EBx2e6wRD7D+2t ExM2nKTeNr6IzLl5nGxTF6aZnJjZq708+RMoAKt2HLVBYZsQ1T62VZy7ZUaYg/a5ezzN cwNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IBwLf/S7; 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 r39-v6si406805qte.161.2018.05.25.08.06.46 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 25 May 2018 08:06:46 -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=IBwLf/S7; 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]:44533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMEIo-0004Me-1u for patch@linaro.org; Fri, 25 May 2018 11:06:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMEH9-0003yt-Eb for qemu-devel@nongnu.org; Fri, 25 May 2018 11:05:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMEH5-00039a-FL for qemu-devel@nongnu.org; Fri, 25 May 2018 11:05:03 -0400 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:35038) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMEH5-00038y-8Z for qemu-devel@nongnu.org; Fri, 25 May 2018 11:04:59 -0400 Received: by mail-wm0-x234.google.com with SMTP id o78-v6so15520520wmg.0 for ; Fri, 25 May 2018 08:04:59 -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=YGW/n4uIzpZ6dh+Spw93KGLkfy9gM+9TRiuXIcsy+cw=; b=IBwLf/S78ppbcX2Gnjbf4xd4B7meo0UE8w+r0n0skZgKk3rQ7gu/7zy/p+4ZwMPPEz d0BLOHa3bVaet66GxK/jiZJCG87AKC2MjQczY3hxbc7iyevqkkzaqB7qeGIPy3djBox0 uQqndMZTehDm8CF+tV1lAAoECSXgSINLMao6U= 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=YGW/n4uIzpZ6dh+Spw93KGLkfy9gM+9TRiuXIcsy+cw=; b=q1gwSPwYlF4CdScCv7318QAMKY+Bs155KIDntD8n4PY/a1vO19VVbala4gfjv+2s0x Ui1+0Ol/0Qsg672AS72WaJQJYu4Rg4NHkkjD1KaNe7H9BAE7kz/MpCw5DeudBw4/6wlW hXTj/3sxg+azi1YM3oE43ct6scu4G38hX7G1qidugRvSsPEuB7+BMRCm7cBwbqhSCRfq qV6m8WoB2Y8JdWRBahbl3Sw/mmcPiqhdQs706pTh6d0Ehcy63gopO5p0uIGbhGuhyyyJ GtMjDVkQDcwddS+KDk5lnY+QLypxFa8LNa2o2J8LWmsWCRxZFOBMXLZzhg7+97GJ53tF hcwg== X-Gm-Message-State: ALKqPweRjwJWr9H9qhvHoX0f/YJVV7xLmkZyt6LcWlGWTBgrDKHlCtne zADQT8siqYi5Rcow5hPG/L8+MQ== X-Received: by 2002:a1c:6a0d:: with SMTP id f13-v6mr1876004wmc.1.1527260698035; Fri, 25 May 2018 08:04:58 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e13-v6sm1863566wrm.45.2018.05.25.08.04.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 May 2018 08:04:56 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 5A99A3E025C; Fri, 25 May 2018 16:04:56 +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 Date: Fri, 25 May 2018 16:04:56 +0100 Message-Id: <20180525150456.26443-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180525133851.27161-1-alex.bennee@linaro.org> References: <20180525133851.27161-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::234 Subject: [Qemu-devel] [PATCH v5.1 21/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: 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 --- 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.0 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? */ }