From patchwork Tue Jan 22 21:50:14 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: 156331 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp45071jaa; Tue, 22 Jan 2019 13:59:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN7F0SBxKk4mhtfsQtpYE7AioTNZZxZvi/kyOhUX/w+U65RRe0NEG9hMOOTG0y7nTBSOrAy7 X-Received: by 2002:adf:fe43:: with SMTP id m3mr33532377wrs.290.1548194358796; Tue, 22 Jan 2019 13:59:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548194358; cv=none; d=google.com; s=arc-20160816; b=jlpQCnUhsi+WdXW32RMHuSw7nbN1eBQi3xfiWWLa2o4jOW4IbWxQl5BBRx2piT9+3Y iHtTyEK8bfVsklfZq+BU4kxWBmUvLfapAq3T0w6yEEbZ0OGMAmwdxbk56O/qLYm74VCN M8fN8zZBbKQQJ5dzaGNyJwWze3YUNQ4jFJUG3dHioyeuVar//m3oaSBwRAtOSzCorg+A hmpsJgzN6J+KMdPfOlqwL+a8O5KpjAwWS8vz8qJeh1F9vZVicrTO+OgF66rUlrtnkRHH ShJDUoy4B4fsi2bvFjDGJItUgHH57pWDL3dkZ1aOu3In7KU54h7Rkg2E3zOhNxl8TMjd e0xw== 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=vNUVzXJMeciF3yCxVe8r8HtMv+v24ndvlEQDb539ja8=; b=ssiDjNC+j7Tgb+bX91tFdv7XSylh777mEIas9FPciewKoZLp0Mc5Mq6vEzSIos7Xiz dL7vBK6m6JwVRqv1tiMXvFKXh8NM5OKU0L+kmiXwW+x4WIA8g4QHGFA9RiyWYkyVkJ+c KLL1ujYLcQu4dGnUau/f2tsWTXUcsUsw9H7N2ahcpL5o4bk43ixxMA3sJxSgTuWj7iyE xMvs1sNv8U6g5GsLoqH8f3pEhg+as06yPfTsh68A2OnLp62APD1ztwooSWTVjDKj+Lz1 ABRzJyCkTpfX58znEkbg2KkUQLIRg4hc2xFzFY1wm8zS14wHkHjiEl8JkqGBbYb2cMGo cd1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hkGkPTyM; 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 i89si71491103wri.305.2019.01.22.13.59.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 22 Jan 2019 13:59:18 -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=hkGkPTyM; 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]:50911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm44g-000727-7A for patch@linaro.org; Tue, 22 Jan 2019 16:59:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm3wR-0007TN-2s for qemu-devel@nongnu.org; Tue, 22 Jan 2019 16:50:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gm3wP-0008Fi-Ij for qemu-devel@nongnu.org; Tue, 22 Jan 2019 16:50:42 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:34734) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gm3wP-0007uB-9s for qemu-devel@nongnu.org; Tue, 22 Jan 2019 16:50:41 -0500 Received: by mail-wm1-x341.google.com with SMTP id y185so9540697wmd.1 for ; Tue, 22 Jan 2019 13:50:25 -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=vNUVzXJMeciF3yCxVe8r8HtMv+v24ndvlEQDb539ja8=; b=hkGkPTyMs3RHAunAfxnBdNpIoMnn1uNsLcEULTrjtaww0vHAm3F6v82bZPcEAK9ZcV CG1U20cTTF49UQvIb0EK3As+i9vrcpftDVZOTG6hQKyYkHGY1HLQLrrCymkJAGKM0FK5 2mJjVGPwfm0VpEUBcgtAVV/hXtPlrhhfBH/Vo= 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=vNUVzXJMeciF3yCxVe8r8HtMv+v24ndvlEQDb539ja8=; b=F79P2M11tko+9MT/TnU2qffFKx37+E7PXYogAcQ9Rzp1MsrfwedrTkxKnapXZrldhH yZCwfl0vkjwZFvcBi3l6qRrmrFKQ5Ic9f3J8S71J1ZV+6sP6UIyw+lP54Xsw7LAzdoTJ urqmBK5lNH0PbUcA3URNnVxcgKi+VpbwEDcL5Mx3orhU6y/JO6FEZ4a62MkMZ1QJXLUY vUwieqWoNOrvwt6VifyByVlCnA8n241g5TCgZJZSmyKr4nnjHLXe4tVJaoP+b3yKyER+ 8pdj6C9Ca1+QrCYf0E4fKOPN5effPU4nDZ8eBVF52Dnqi38wCFqf/xSpz6C3gIbgXzZq GKug== X-Gm-Message-State: AJcUukcxPiQinMOHGEBtXwKm7urwTteILZRdQu+WWL2teEe2O4iUZLzy hzHTE6SYMdrjuUoSvRAz6SDUIY9EaF4= X-Received: by 2002:a1c:f71a:: with SMTP id v26mr152368wmh.131.1548193824398; Tue, 22 Jan 2019 13:50:24 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t66sm18073834wme.15.2019.01.22.13.50.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Jan 2019 13:50:20 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id D24103E0D0E; Tue, 22 Jan 2019 21:50:16 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 22 Jan 2019 21:50:14 +0000 Message-Id: <20190122215016.18697-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190122215016.18697-1-alex.bennee@linaro.org> References: <20190122215016.18697-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 v3 09/11] 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: =?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 --- v3 - tweak test function - always call fp-test build --- tests/Makefile.include | 120 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) -- 2.17.1 diff --git a/tests/Makefile.include b/tests/Makefile.include index 4eea38ae99..f123616bc7 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -880,6 +880,126 @@ check-report-unit.tap: $(check-unit-y) check-report.tap: $(patsubst %,check-report-qtest-%.tap, $(QTEST_TARGETS)) check-report-unit.tap $(call quiet-command,./scripts/tap-merge.py $^ > $@,"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. + +FP_TEST_BIN=$(BUILD_DIR)/tests/fp/fp-test + +# the build dir is created by configure +.PHONY: $(FP_TEST_BIN) +$(FP_TEST_BIN): $(BUILD_DIR)/tests/fp fpu/softfloat.c + $(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>&1 || \ + (cat $2.out && exit 1;), \ + "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: $(FP_TEST_BIN) + $(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-%: $(FP_TEST_BIN) + $(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: $(FP_TEST_BIN) + $(call test-softfloat, \ + f16_le_quiet f32_le_quiet f64_le_quiet \ + f128_le_quiet, \ + le_quiet) + +# FIXME: extF80_lt_quiet (broken) +check-softfloat-lt_quiet: $(FP_TEST_BIN) + $(call test-softfloat, \ + f16_lt_quiet f32_lt_quiet f64_lt_quiet \ + f128_lt_quiet, \ + lt_quiet) + +.PHONY: check-softfloat-compare +check-softfloat-compare: $(SF_COMPARE_RULES) + +# Math Operations + +# FIXME: extF80_mulAdd (missing) +check-softfloat-mulAdd: $(FP_TEST_BIN) + $(call test-softfloat, \ + f16_mulAdd f32_mulAdd f64_mulAdd f128_mulAdd, \ + mulAdd) + +# FIXME: extF80_rem (broken) +check-softfloat-rem: $(FP_TEST_BIN) + $(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))