qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 14/24] fpu/soft-fp: Adjust _FP_CMP_CHECK_NAN


From: Richard Henderson
Subject: [Qemu-devel] [PATCH 14/24] fpu/soft-fp: Adjust _FP_CMP_CHECK_NAN
Date: Sat, 3 Feb 2018 20:11:26 -0800

The fourth argument to _FP_CMP is a 4-state integer operand that
controls the operation wrt raising exceptions.  However, the usage
that we need within QEMU produces a -Werror=int-in-bool-context:

  error: ?: using integer constants in boolean context, \
  the expression will always evaluate to ‘true’
     glue(FP_CMP_, FS)(r, A, B, float_relation_unordered, (quiet ? 1 : 2));
  note: in definition of macro ‘_FP_CMP_CHECK_NAN’
       if (ex)        \
           ^~

Adding an explicit comparison avoids this.

Signed-off-by: Richard Henderson <address@hidden>
---
 fpu/op-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fpu/op-common.h b/fpu/op-common.h
index c5f33c0148..c4d8b58a03 100644
--- a/fpu/op-common.h
+++ b/fpu/op-common.h
@@ -1242,7 +1242,7 @@
     {                                                                  \
       /* The arguments are unordered, which may or may not result in   \
         an exception.  */                                              \
-      if (ex)                                                          \
+      if ((ex) != 0)                                                    \
        {                                                               \
          /* At least some cases of unordered arguments result in       \
             exceptions; check whether this is one.  */                 \
-- 
2.14.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]