All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH  v1 0/6] current fpu/next queue
@ 2019-01-08 16:21 Alex Bennée
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 1/6] fp-bench: fix update_random_ops Alex Bennée
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Alex Bennée @ 2019-01-08 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: cota, Alex Bennée


Hi,

This is the current queue of fixes for our softfloat implementation. I
ended up taking Emilio's more complete dynamic probe approach for
broken FMA implementations (direct from git). There is also a fix for
the fp-bench. Finally a couple of patches to roll check-softfloat into
the main make system. It skips some f128 and extF80 float operations
which trigger faults but hopefully we can fix those up in a later
re-factor of the extended size floats.

The following patches need review
  patch 0003/softfloat enforce softfloat if the host s FMA is .patch
  patch 0004/tests Makefile add floating point tests.patch
  patch 0005/scripts archive source include softfloat tests.patch
  patch 0006/tests Makfile add check softfloat rule.patch

Alex Bennée (3):
  tests/Makefile: add floating point tests
  scripts/archive-source: include softfloat tests
  tests/Makfile: add check-softfloat rule

Emilio G. Cota (3):
  fp-bench: fix update_random_ops
  fp-bench: remove wrong exponent raise in fill_random
  softfloat: enforce softfloat if the host's FMA is broken

 fpu/softfloat.c           |  85 ++++++++++++++++++++++++
 include/qemu/cpuid.h      |   6 ++
 scripts/archive-source.sh |   2 +-
 tests/Makefile.include    | 132 +++++++++++++++++++++++++++++++++++++-
 tests/fp/fp-bench.c       |  15 +++--
 5 files changed, 230 insertions(+), 10 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH  v1 1/6] fp-bench: fix update_random_ops
  2019-01-08 16:21 [Qemu-devel] [PATCH v1 0/6] current fpu/next queue Alex Bennée
@ 2019-01-08 16:21 ` Alex Bennée
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 2/6] fp-bench: remove wrong exponent raise in fill_random Alex Bennée
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Alex Bennée @ 2019-01-08 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: cota, Alex Bennée, Aurelien Jarno, Peter Maydell

From: "Emilio G. Cota" <cota@braap.org>

The second test in the branches is wrong; fix while converting
to a switch statement, which is easier to get right.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/fp/fp-bench.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c
index f5bc5edebf..546bac9c9c 100644
--- a/tests/fp/fp-bench.c
+++ b/tests/fp/fp-bench.c
@@ -143,15 +143,20 @@ static void update_random_ops(int n_ops, enum precision prec)
     for (i = 0; i < n_ops; i++) {
         uint64_t r = random_ops[i];
 
-        if (prec == PREC_SINGLE || PREC_FLOAT32) {
+        switch (prec) {
+        case PREC_SINGLE:
+        case PREC_FLOAT32:
             do {
                 r = xorshift64star(r);
             } while (!float32_is_normal(r));
-        } else if (prec == PREC_DOUBLE || PREC_FLOAT64) {
+            break;
+        case PREC_DOUBLE:
+        case PREC_FLOAT64:
             do {
                 r = xorshift64star(r);
             } while (!float64_is_normal(r));
-        } else {
+            break;
+        default:
             g_assert_not_reached();
         }
         random_ops[i] = r;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v1 2/6] fp-bench: remove wrong exponent raise in fill_random
  2019-01-08 16:21 [Qemu-devel] [PATCH v1 0/6] current fpu/next queue Alex Bennée
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 1/6] fp-bench: fix update_random_ops Alex Bennée
@ 2019-01-08 16:21 ` Alex Bennée
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 3/6] softfloat: enforce softfloat if the host's FMA is broken Alex Bennée
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Alex Bennée @ 2019-01-08 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: cota, Alex Bennée, Aurelien Jarno, Peter Maydell

From: "Emilio G. Cota" <cota@braap.org>

At this point random_ops[] only contains normals, so there's
no need to do anything to them. In fact, raising the exponent
here can make the output !normal, which is precisely
what the comment says we want to avoid.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/fp/fp-bench.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c
index 546bac9c9c..4ba5e1d2d4 100644
--- a/tests/fp/fp-bench.c
+++ b/tests/fp/fp-bench.c
@@ -176,8 +176,6 @@ static void fill_random(union fp *ops, int n_ops, enum precision prec,
             if (no_neg && float32_is_neg(ops[i].f32)) {
                 ops[i].f32 = float32_chs(ops[i].f32);
             }
-            /* raise the exponent to limit the frequency of denormal results */
-            ops[i].f32 |= 0x40000000;
             break;
         case PREC_DOUBLE:
         case PREC_FLOAT64:
@@ -185,8 +183,6 @@ static void fill_random(union fp *ops, int n_ops, enum precision prec,
             if (no_neg && float64_is_neg(ops[i].f64)) {
                 ops[i].f64 = float64_chs(ops[i].f64);
             }
-            /* raise the exponent to limit the frequency of denormal results */
-            ops[i].f64 |= LIT64(0x4000000000000000);
             break;
         default:
             g_assert_not_reached();
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v1 3/6] softfloat: enforce softfloat if the host's FMA is broken
  2019-01-08 16:21 [Qemu-devel] [PATCH v1 0/6] current fpu/next queue Alex Bennée
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 1/6] fp-bench: fix update_random_ops Alex Bennée
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 2/6] fp-bench: remove wrong exponent raise in fill_random Alex Bennée
@ 2019-01-08 16:21 ` Alex Bennée
  2019-01-08 17:23   ` Alex Bennée
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 4/6] tests/Makefile: add floating point tests Alex Bennée
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Alex Bennée @ 2019-01-08 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: cota, Aurelien Jarno, Peter Maydell, Alex Bennée

From: "Emilio G. Cota" <cota@braap.org>

The added branch to the FMA ops is marked as unlikely and therefore
its impact on performance (measured with fp-bench) is within noise range
when measured on an Intel(R) Xeon(R) Gold 6142 CPU @ 2.60GHz.

In addition, when the host doesn't have a hardware FMA instruction
we force the use of softfloat, since whatever the libc does (e.g. checking
the host's FP flags) is unlikely to be faster than our softfloat
implementation. For instance, on an i386 machine with no hardware
support for FMA, we get:

  $ for precision in single double; do
        ./fp-bench -o mulAdd -p $precision
    done

- before:
5.07 MFlops
1.85 MFlops

- after:
12.65 MFlops
10.05 MFlops

Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 fpu/softfloat.c      | 85 ++++++++++++++++++++++++++++++++++++++++++++
 include/qemu/cpuid.h |  6 ++++
 2 files changed, 91 insertions(+)

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 59eac97d10..ccaed85b0f 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -1542,6 +1542,8 @@ soft_f64_muladd(float64 a, float64 b, float64 c, int flags,
     return float64_round_pack_canonical(pr, status);
 }
 
+static bool force_soft_fma;
+
 float32 QEMU_FLATTEN
 float32_muladd(float32 xa, float32 xb, float32 xc, int flags, float_status *s)
 {
@@ -1562,6 +1564,11 @@ float32_muladd(float32 xa, float32 xb, float32 xc, int flags, float_status *s)
     if (unlikely(!f32_is_zon3(ua, ub, uc))) {
         goto soft;
     }
+
+    if (unlikely(force_soft_fma)) {
+        goto soft;
+    }
+
     /*
      * When (a || b) == 0, there's no need to check for under/over flow,
      * since we know the addend is (normal || 0) and the product is 0.
@@ -1623,6 +1630,11 @@ float64_muladd(float64 xa, float64 xb, float64 xc, int flags, float_status *s)
     if (unlikely(!f64_is_zon3(ua, ub, uc))) {
         goto soft;
     }
+
+    if (unlikely(force_soft_fma)) {
+        goto soft;
+    }
+
     /*
      * When (a || b) == 0, there's no need to check for under/over flow,
      * since we know the addend is (normal || 0) and the product is 0.
@@ -7974,3 +7986,76 @@ float128 float128_scalbn(float128 a, int n, float_status *status)
                                          , status);
 
 }
+
+#ifdef CONFIG_CPUID_H
+#include "qemu/cpuid.h"
+#endif
+
+static void check_host_hw_fma(void)
+{
+#ifdef CONFIG_CPUID_H
+    int max = __get_cpuid_max(0, NULL);
+    int a, b, c, d;
+    bool has_fma3 = false;
+    bool has_fma4 = false;
+    bool has_avx = false;
+
+    if (max >= 1) {
+        __cpuid(1, a, b, c, d);
+
+        /* check whether avx is usable */
+        if (c & bit_OSXSAVE) {
+            int bv;
+
+            __asm("xgetbv" : "=a"(bv), "=d"(d) : "c"(0));
+            if ((bv & 6) == 6) {
+                has_avx = c & bit_AVX;
+            }
+        }
+
+        if (has_avx) {
+            /* fma3 */
+            has_fma3 = c & bit_FMA3;
+
+            /* fma4 */
+            __cpuid(0x80000000, a, b, c, d);
+            if (a >= 0x80000001) {
+                __cpuid(0x80000001, a, b, c, d);
+
+                has_fma4 = c & bit_FMA4;
+            }
+        }
+    }
+    /*
+     * Without HW FMA, whatever the libc does is probably slower than our
+     * softfloat implementation.
+     */
+    if (!has_fma3 && !has_fma4) {
+        force_soft_fma = true;
+    }
+#endif
+}
+
+static void __attribute__((constructor)) softfloat_init(void)
+{
+    union_float64 ua, ub, uc, ur;
+
+    if (QEMU_NO_HARDFLOAT) {
+        return;
+    }
+
+    /*
+     * Test that the host's FMA is not obviously broken. For example,
+     * glibc < 2.23 can perform an incorrect FMA on certain hosts; see
+     *   https://sourceware.org/bugzilla/show_bug.cgi?id=13304
+     */
+    ua.s = 0x0020000000000001ULL;
+    ub.s = 0x3ca0000000000000ULL;
+    uc.s = 0x0020000000000000ULL;
+    ur.h = fma(ua.h, ub.h, uc.h);
+    if (ur.s != 0x0020000000000001ULL) {
+        force_soft_fma = true;
+    }
+
+    check_host_hw_fma();
+}
diff --git a/include/qemu/cpuid.h b/include/qemu/cpuid.h
index 69301700bd..320926ffe0 100644
--- a/include/qemu/cpuid.h
+++ b/include/qemu/cpuid.h
@@ -25,6 +25,9 @@
 #endif
 
 /* Leaf 1, %ecx */
+#ifndef bit_FMA3
+#define bit_FMA3        (1 << 12)
+#endif
 #ifndef bit_SSE4_1
 #define bit_SSE4_1      (1 << 19)
 #endif
@@ -53,5 +56,8 @@
 #ifndef bit_LZCNT
 #define bit_LZCNT       (1 << 5)
 #endif
+#ifndef bit_FMA4
+#define bit_FMA4        (1 << 16)
+#endif
 
 #endif /* QEMU_CPUID_H */
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v1 4/6] tests/Makefile: add floating point tests
  2019-01-08 16:21 [Qemu-devel] [PATCH v1 0/6] current fpu/next queue Alex Bennée
                   ` (2 preceding siblings ...)
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 3/6] softfloat: enforce softfloat if the host's FMA is broken Alex Bennée
@ 2019-01-08 16:21 ` Alex Bennée
  2019-01-09 21:08   ` Richard Henderson
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 5/6] scripts/archive-source: include softfloat tests Alex Bennée
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Alex Bennée @ 2019-01-08 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: cota, Alex Bennée

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 <alex.bennee@linaro.org>
---
 tests/Makefile.include | 115 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 115 insertions(+)

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))
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v1 5/6] scripts/archive-source: include softfloat tests
  2019-01-08 16:21 [Qemu-devel] [PATCH v1 0/6] current fpu/next queue Alex Bennée
                   ` (3 preceding siblings ...)
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 4/6] tests/Makefile: add floating point tests Alex Bennée
@ 2019-01-08 16:21 ` Alex Bennée
  2019-01-09 21:09   ` Richard Henderson
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 6/6] tests/Makfile: add check-softfloat rule Alex Bennée
  2019-01-08 20:35 ` [Qemu-devel] [PATCH v1 0/6] current fpu/next queue no-reply
  6 siblings, 1 reply; 11+ messages in thread
From: Alex Bennée @ 2019-01-08 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: cota, Alex Bennée

We need these if we want to run unit/softfloat tests in our docker
containers.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 scripts/archive-source.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh
index 62bd22578b..6eed2a29bd 100755
--- a/scripts/archive-source.sh
+++ b/scripts/archive-source.sh
@@ -26,7 +26,7 @@ vroot_dir="${tar_file}.vroot"
 # independent of what the developer currently has initialized
 # in their checkout, because the build environment is completely
 # different to the host OS.
-submodules="dtc ui/keycodemapdb"
+submodules="dtc ui/keycodemapdb tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3"
 
 trap "status=$?; rm -rf \"$list_file\" \"$vroot_dir\"; exit \$status" 0 1 2 3 15
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH v1 6/6] tests/Makfile: add check-softfloat rule
  2019-01-08 16:21 [Qemu-devel] [PATCH v1 0/6] current fpu/next queue Alex Bennée
                   ` (4 preceding siblings ...)
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 5/6] scripts/archive-source: include softfloat tests Alex Bennée
@ 2019-01-08 16:21 ` Alex Bennée
  2019-01-08 20:35 ` [Qemu-devel] [PATCH v1 0/6] current fpu/next queue no-reply
  6 siblings, 0 replies; 11+ messages in thread
From: Alex Bennée @ 2019-01-08 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: cota, Alex Bennée

This adds a rule to run all of our softfloat tests. It is included as
a pre-requisite to check-tcg and check-unit as well.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/Makefile.include | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 69610c0ed1..efbfe7708a 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -11,6 +11,7 @@ check-help:
 	@echo " $(MAKE) check-qapi-schema    Run QAPI schema tests"
 	@echo " $(MAKE) check-block          Run block tests"
 	@echo " $(MAKE) check-tcg            Run TCG tests"
+	@echo " $(MAKE) check-softfloat      Run FPU emulation tests"
 	@echo " $(MAKE) check-acceptance     Run all acceptance (functional) tests"
 	@echo " $(MAKE) check-report.html    Generates an HTML test report"
 	@echo " $(MAKE) check-venv           Creates a Python venv for tests"
@@ -959,6 +960,18 @@ SF_MATH_RULES=$(patsubst %,check-softfloat-%, $(SF_MATH_OPS))
 .PHONY: check-softfloat-ops
 check-softfloat-ops: $(SF_MATH_RULES)
 
+# Finally a generic rule to test all of softfoat. If TCG isnt't
+# enabled we define a null operation which skips the tests.
+
+.PHONY: check-softfloat
+ifeq ($(CONFIG_TCG),y)
+check-softfloat: check-softfloat-conv check-softfloat-compare check-softfloat-ops
+else
+check-softfloat:
+	$(call quiet-command, /bin/true, "FLOAT TEST", \
+		"SKIPPED for non-TCG builds")
+endif
+
 # Per guest TCG tests
 
 LINUX_USER_TARGETS=$(filter %-linux-user,$(TARGET_DIRS))
@@ -991,7 +1004,7 @@ clean-tcg-tests-%:
 build-tcg: $(BUILD_TCG_TARGET_RULES)
 
 .PHONY: check-tcg
-check-tcg: $(RUN_TCG_TARGET_RULES)
+check-tcg: check-softfloat $(RUN_TCG_TARGET_RULES)
 
 .PHONY: clean-tcg
 clean-tcg: $(CLEAN_TCG_TARGET_RULES)
@@ -1072,7 +1085,7 @@ check-acceptance: check-venv $(TESTS_RESULTS_DIR)
 .PHONY: check-qapi-schema check-qtest check-unit check check-clean
 check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y)) check-tests/qapi-schema/doc-good.texi
 check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
-check-unit: $(patsubst %,check-%, $(check-unit-y))
+check-unit: $(patsubst %,check-%, $(check-unit-y)) check-softfloat
 check-speed: $(patsubst %,check-%, $(check-speed-y))
 check-block: $(patsubst %,check-%, $(check-block-y))
 check: check-qapi-schema check-unit check-qtest check-decodetree
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v1 3/6] softfloat: enforce softfloat if the host's FMA is broken
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 3/6] softfloat: enforce softfloat if the host's FMA is broken Alex Bennée
@ 2019-01-08 17:23   ` Alex Bennée
  0 siblings, 0 replies; 11+ messages in thread
From: Alex Bennée @ 2019-01-08 17:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: cota, Aurelien Jarno, Peter Maydell


Alex Bennée <alex.bennee@linaro.org> writes:

> From: "Emilio G. Cota" <cota@braap.org>
>
> The added branch to the FMA ops is marked as unlikely and therefore
> its impact on performance (measured with fp-bench) is within noise range
> when measured on an Intel(R) Xeon(R) Gold 6142 CPU @ 2.60GHz.

Ahh I missed v2:

  Subject: [PATCH v2] softfloat: enforce softfloat if the host's FMA is broken
  Date: Tue, 25 Dec 2018 02:03:05 -0500
  Message-Id: <20181225070305.18221-1-cota@braap.org>

I'll roll that into the next iteration.

--
Alex Bennée

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH  v1 0/6] current fpu/next queue
  2019-01-08 16:21 [Qemu-devel] [PATCH v1 0/6] current fpu/next queue Alex Bennée
                   ` (5 preceding siblings ...)
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 6/6] tests/Makfile: add check-softfloat rule Alex Bennée
@ 2019-01-08 20:35 ` no-reply
  6 siblings, 0 replies; 11+ messages in thread
From: no-reply @ 2019-01-08 20:35 UTC (permalink / raw)
  To: alex.bennee; +Cc: fam, qemu-devel, cota

Patchew URL: https://patchew.org/QEMU/20190108162154.22259-1-alex.bennee@linaro.org/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Subject: [Qemu-devel] [PATCH  v1 0/6] current fpu/next queue
Message-id: 20190108162154.22259-1-alex.bennee@linaro.org

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
48a1465 tests/Makfile: add check-softfloat rule
283786b scripts/archive-source: include softfloat tests
4069cf6 tests/Makefile: add floating point tests
44b370e softfloat: enforce softfloat if the host's FMA is broken
a5a1840 fp-bench: remove wrong exponent raise in fill_random
f511a5c fp-bench: fix update_random_ops

=== OUTPUT BEGIN ===
Checking PATCH 1/6: fp-bench: fix update_random_ops...
Checking PATCH 2/6: fp-bench: remove wrong exponent raise in fill_random...
Checking PATCH 3/6: softfloat: enforce softfloat if the host's FMA is broken...
Checking PATCH 4/6: tests/Makefile: add floating point tests...
Checking PATCH 5/6: scripts/archive-source: include softfloat tests...
ERROR: line over 90 characters
#24: FILE: scripts/archive-source.sh:29:
+submodules="dtc ui/keycodemapdb tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3"

total: 1 errors, 0 warnings, 8 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 6/6: tests/Makfile: add check-softfloat rule...
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190108162154.22259-1-alex.bennee@linaro.org/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v1 4/6] tests/Makefile: add floating point tests
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 4/6] tests/Makefile: add floating point tests Alex Bennée
@ 2019-01-09 21:08   ` Richard Henderson
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Henderson @ 2019-01-09 21:08 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel; +Cc: cota

On 1/9/19 3:21 AM, Alex Bennée wrote:
> +		le_quite)

quiet.  Several instances.


r~

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v1 5/6] scripts/archive-source: include softfloat tests
  2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 5/6] scripts/archive-source: include softfloat tests Alex Bennée
@ 2019-01-09 21:09   ` Richard Henderson
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Henderson @ 2019-01-09 21:09 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel; +Cc: cota

On 1/9/19 3:21 AM, Alex Bennée wrote:
> We need these if we want to run unit/softfloat tests in our docker
> containers.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  scripts/archive-source.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-01-09 21:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 16:21 [Qemu-devel] [PATCH v1 0/6] current fpu/next queue Alex Bennée
2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 1/6] fp-bench: fix update_random_ops Alex Bennée
2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 2/6] fp-bench: remove wrong exponent raise in fill_random Alex Bennée
2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 3/6] softfloat: enforce softfloat if the host's FMA is broken Alex Bennée
2019-01-08 17:23   ` Alex Bennée
2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 4/6] tests/Makefile: add floating point tests Alex Bennée
2019-01-09 21:08   ` Richard Henderson
2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 5/6] scripts/archive-source: include softfloat tests Alex Bennée
2019-01-09 21:09   ` Richard Henderson
2019-01-08 16:21 ` [Qemu-devel] [PATCH v1 6/6] tests/Makfile: add check-softfloat rule Alex Bennée
2019-01-08 20:35 ` [Qemu-devel] [PATCH v1 0/6] current fpu/next queue no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.