From nobody Wed Oct 1 09:31:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548194445641278.58428012268587; Tue, 22 Jan 2019 14:00:45 -0800 (PST) Received: from localhost ([127.0.0.1]:50939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm466-000800-5g for importer@patchew.org; Tue, 22 Jan 2019 17:00:42 -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) 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) 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-Google-Smtp-Source: ALg8bN5C9hs+jdQ2VzJ2pkId9/XkkTEvXGuEGSd06QAZI+B6Jy3g7i497uXywPlz4DdYugZlHb37AA== X-Received: by 2002:a1c:f71a:: with SMTP id v26mr152368wmh.131.1548193824398; Tue, 22 Jan 2019 13:50:24 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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=C3=A9e --- v3 - tweak test function - always call fp-test build --- tests/Makefile.include | 120 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) 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","$@") =20 +# 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=3D$(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=3D-l 1 +else +FP_TL=3D-l 2 -r all +endif + +# $1 =3D tests, $2 =3D description +test-softfloat =3D $(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=3Deq eq_signaling le le_quiet lt_quiet +SF_COMPARE_RULES=3D$(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=3Dadd sub mul mulAdd div rem sqrt +SF_MATH_RULES=3D$(patsubst %,check-softfloat-%, $(SF_MATH_OPS)) + +.PHONY: check-softfloat-ops +check-softfloat-ops: $(SF_MATH_RULES) + # Per guest TCG tests =20 LINUX_USER_TARGETS=3D$(filter %-linux-user,$(TARGET_DIRS)) --=20 2.17.1