From patchwork Tue Jan 8 16:21:52 2019 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: 154983 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp5062845jaa; Tue, 8 Jan 2019 08:22:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN6W+tGa8KbfMl5A/m3y2pkJq91WJkIi/GPZfPmPhOyaa+/p8TgBYMq+uV3uZg6lGkv0C5zk X-Received: by 2002:a1c:6e06:: with SMTP id j6mr2346864wmc.3.1546964555744; Tue, 08 Jan 2019 08:22:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546964555; cv=none; d=google.com; s=arc-20160816; b=C74acaUggjF61ynT3VnfOpAulJZMtVu0C3grG20UOe38g0L6qi+cnkGKsF4smEmPti MwMWOzcntwrU60v0DBFIkSs7hR/wW3NxdSatUk57qOFa1iu8mQYzjtJk3KOmS9C2v2/l 5P+XQTidAMh4MNcN7DAKPJRdT4zhq9aOYyPnGi3p62CZNlErhQwlWvXn2vvyM5BRJvaI nPOobIMoiUKNdFDtITISxddHhVZHlkSYLKEA6icTBIab/PEWgVk/eqDKWKtHD/AKgSTe I7DGwPyPzSyfAkOws8tB1q9psAsCSqFccY1/z9gxzVJ2t/SdbbSXedRDQaIpR0miTBw5 8VZA== 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; bh=Pte7Wj4rgezoXgNvGxvsFaiSdpnOauW2cBpolG/kvlw=; b=iAkz80nyWkTQGL01ojoTw7CLaQmOeLwGPL16A3MClf4fDGJNS+Hs7K230no3qpnvqi GdvdONO4MSchbrV/IfPEp5R8xtQ6YyVqqkzq4e/aWDOBaS6lsjb+r/CmHLFOYNumw8f6 DCqmYVG2mOqr8L3JklMw0mziOh8nBHIyfNaMTn+eQZq4NejMfGhMtIr83/M+7zZIUHSi XcUgJcM42ZZU1qekzSQHinONwE69X07uvvPG2Elfx09iwcmQT5553j/BkedgZxVDn9nN 1+HH0j8atKPdtd2LbWabFtQQOIzapB5zHyvpoeuFKso8foz9r7QkWBoCWq5hystVQptP PbQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="dxp3bp6/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id m12si37672518wrn.358.2019.01.08.08.22.35 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 08 Jan 2019 08:22:35 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="dxp3bp6/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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 ([127.0.0.1]:53788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggu9A-0004He-KV for patch@linaro.org; Tue, 08 Jan 2019 11:22:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggu8h-0004EK-RI for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggu8e-0000bg-Lq for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:01 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:35400) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggu8e-0000YH-DG for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:00 -0500 Received: by mail-wm1-x341.google.com with SMTP id t200so5062444wmt.0 for ; Tue, 08 Jan 2019 08:22:00 -0800 (PST) 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=Pte7Wj4rgezoXgNvGxvsFaiSdpnOauW2cBpolG/kvlw=; b=dxp3bp6/vl0AnZznNW6Rwh0G/S8QHmXWtG3SumESv2ti2ZlHfPJL2URa0eh6DoedoQ J76f6bvJbpSEDe8/jXM8cVaerwRpu82YKJ74NjDTNz3eVCUTRxsuNEZ0GCyBWCRWygdz 0SlG1/msr6wSx3JWgJI7IXeJV2ZtuuNJbvJRo= 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=Pte7Wj4rgezoXgNvGxvsFaiSdpnOauW2cBpolG/kvlw=; b=kRNva/TehEMDqvEOm7vNc/FNFqHXjaItPX0Hm1Qmyf3wlXthOjEJAiCA5bO59JgfBs 1xHCmxsKYyGN0j7zBJ8EsDvOJC2pgTvWaY0gaDZEAz2zcyeDvxI62kq5ipky64L3hwjA FHQAz2noPeDgav1SIOa5LMajV3HIkcE33uL204VVImX99dpcZVbkZd7sKKOFjbVTbqpY MFIWSKSpfe8XUVF4MzS1r73TSPymChikzau0j5uhetKZE6fKg30Y8MwXVlB9qMJU8IAs Ol+EMGJ/Bs5/zTR7fjcupWVv2WO4xgQtlE6XwlY8Zgmip7eUk4d/mJeEptZvO2ENFlpx bs0w== X-Gm-Message-State: AJcUuke/SuN/wHgs67/qx+UD5gvHBMQW8HSbRp6B7mWR2Sm6dZKRX4qg dOVGmSlHHDrRu+Y4frq6r2kZSQJMaz8= X-Received: by 2002:a1c:a548:: with SMTP id o69mr2348287wme.118.1546964519266; Tue, 08 Jan 2019 08:21:59 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id z206sm10345054wmc.18.2019.01.08.08.21.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 08:21:56 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id C471D3E117B; Tue, 8 Jan 2019 16:21:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 8 Jan 2019 16:21:52 +0000 Message-Id: <20190108162154.22259-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190108162154.22259-1-alex.bennee@linaro.org> References: <20190108162154.22259-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:4864:20::341 Subject: [Qemu-devel] [PATCH v1 4/6] tests/Makefile: add floating point tests 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: cota@braap.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Wire up test/fp-test into the main testing Makefile. Currently we skip some of the extF80 and f128 related tests. Once we re-factor and fix these tests the plumbing should get simpler. Signed-off-by: Alex Bennée --- tests/Makefile.include | 115 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) -- 2.17.1 diff --git a/tests/Makefile.include b/tests/Makefile.include index 3f5a1d0c30..69610c0ed1 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -844,6 +844,121 @@ check-report.xml: $(patsubst %,check-report-qtest-%.xml, $(QTEST_TARGETS)) check check-report.html: check-report.xml $(call quiet-command,gtester-report $< > $@,"GEN","$@") +# FPU Emulation tests (aka softfloat) +# +# As we still have some places that need fixing the rules are a little +# more complex than they need to be and have to override some of the +# generic Makefile expansions. Once we are cleanly passing all +# the tests we can simplify the make syntax. + +# the build dir is created by configure +$(BUILD_DIR)/tests/fp/fp-test: $(BUILD_DIR)/tests/fp + $(call quiet-command, \ + cd $(BUILD_DIR)/tests/fp && make, \ + "BUILD", $<) + +# The full test suite can take a bit of time, default to a quick run +ifeq ($(SPEED), quick) +FP_TL=-l 1 +else +FP_TL=-l 2 -r all +endif + +# $1 = tests, $2 = description +test-softfloat = $(call quiet-command, \ + cd $(BUILD_DIR)/tests/fp && ./fp-test -s $(FP_TL) $1 > $2.out 2> $2.err, \ + "FLOAT TEST", $2) + +# Conversion Routines: +# FIXME: i32_to_extF80 (broken), i64_to_extF80 (broken) +# ui32_to_f128 (not implemented), f128_to_ui32 (not implemented) +# extF80_roundToInt (broken) +# +check-softfloat-conv: tests/fp/fp-test + $(call test-softfloat, \ + i32_to_f16 i64_to_f16 \ + i32_to_f32 i64_to_f32 \ + i32_to_f64 i64_to_f64 \ + i32_to_f128 i64_to_f128, int-to-float) + $(call test-softfloat, \ + ui32_to_f16 ui64_to_f16 \ + ui32_to_f32 ui64_to_f32 \ + ui32_to_f64 ui64_to_f64 \ + ui64_to_f128, uint-to-float) + $(call test-softfloat, \ + f16_to_i32 f16_to_i32_r_minMag \ + f32_to_i32 f32_to_i32_r_minMag \ + f64_to_i32 f64_to_i32_r_minMag \ + extF80_to_i32 extF80_to_i32_r_minMag \ + f128_to_i32 f128_to_i32_r_minMag \ + f16_to_i64 f16_to_i64_r_minMag \ + f32_to_i64 f32_to_i64_r_minMag \ + f64_to_i64 f64_to_i64_r_minMag \ + extF80_to_i64 extF80_to_i64_r_minMag \ + f128_to_i64 f128_to_i64_r_minMag, \ + float-to-int) + $(call test-softfloat, \ + f16_to_ui32 f16_to_ui32_r_minMag \ + f32_to_ui32 f32_to_ui32_r_minMag \ + f64_to_ui32 f64_to_ui32_r_minMag \ + f16_to_ui64 f16_to_ui64_r_minMag \ + f32_to_ui64 f32_to_ui64_r_minMag \ + f64_to_ui64 f64_to_ui64_r_minMag, \ + float-to-uint) + $(call test-softfloat, \ + f16_roundToInt f32_roundToInt \ + f64_roundToInt f128_roundToInt, \ + round-to-integer) + +# Generic rule for all float operations +# +# Some patterns are overidden due to broken or missing tests. +# Hopefully these can be removed over time. + +check-softfloat-%: tests/fp/fp-test + $(call test-softfloat, f16_$* f32_$* f64_$* extF80_$* f128_$*, $*) + +# Float Compare routines +SF_COMPARE_OPS=eq eq_signaling le le_quiet lt_quiet +SF_COMPARE_RULES=$(patsubst %,check-softfloat-%, $(SF_COMPARE_OPS)) + +# FIXME: extF80_le_quiet (broken) +check-softfloat-le_quiet: tests/fp/fp-test + $(call test-softfloat, \ + f16_le_quiet f32_le_quiet f64_le_quiet \ + f128_le_quiet, \ + le_quite) + +# FIXME: extF80_lt_quiet (broken) +check-softfloat-lt_quiet: tests/fp/fp-test + $(call test-softfloat, \ + f16_lt_quiet f32_lt_quiet f64_lt_quiet \ + f128_lt_quiet, \ + lt_quite) + +.PHONY: check-softfloat-compare +check-softfloat-compare: $(SF_COMPARE_RULES) + +# Math Operations + +# FIXME: extF80_mulAdd (missing) +check-softfloat-mulAdd: tests/fp/fp-test + $(call test-softfloat, \ + f16_mulAdd f32_mulAdd f64_mulAdd f128_mulAdd, \ + mulAdd) + +# FIXME: extF80_rem (broken) +check-softfloat-rem: tests/fp/fp-test + $(call test-softfloat, \ + f16_rem f32_rem f64_rem f128_rem, \ + rem) + +SF_MATH_OPS=add sub mul mulAdd div rem sqrt +SF_MATH_RULES=$(patsubst %,check-softfloat-%, $(SF_MATH_OPS)) + +.PHONY: check-softfloat-ops +check-softfloat-ops: $(SF_MATH_RULES) + # Per guest TCG tests LINUX_USER_TARGETS=$(filter %-linux-user,$(TARGET_DIRS))