diff mbox

[1/5] softfloat: fix float{32, 64}_muladd options

Message ID 1347138767-19941-1-git-send-email-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno Sept. 8, 2012, 9:12 p.m. UTC
float{32,64}_muladd takes an enum as a parameter, and not flags. It
means the parameter should be checked with == test instead of &.

Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 fpu/softfloat.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index b29256a..518e45b 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -2171,15 +2171,15 @@  float32 float32_muladd(float32 a, float32 b, float32 c, int flags STATUS_PARAM)
         return float32_default_nan;
     }
 
-    if (flags & float_muladd_negate_c) {
+    if (flags == float_muladd_negate_c) {
         cSign ^= 1;
     }
 
-    signflip = (flags & float_muladd_negate_result) ? 1 : 0;
+    signflip = (flags == float_muladd_negate_result) ? 1 : 0;
 
     /* Work out the sign and type of the product */
     pSign = aSign ^ bSign;
-    if (flags & float_muladd_negate_product) {
+    if (flags == float_muladd_negate_product) {
         pSign ^= 1;
     }
     pInf = (aExp == 0xff) || (bExp == 0xff);
@@ -3724,15 +3724,15 @@  float64 float64_muladd(float64 a, float64 b, float64 c, int flags STATUS_PARAM)
         return float64_default_nan;
     }
 
-    if (flags & float_muladd_negate_c) {
+    if (flags == float_muladd_negate_c) {
         cSign ^= 1;
     }
 
-    signflip = (flags & float_muladd_negate_result) ? 1 : 0;
+    signflip = (flags == float_muladd_negate_result) ? 1 : 0;
 
     /* Work out the sign and type of the product */
     pSign = aSign ^ bSign;
-    if (flags & float_muladd_negate_product) {
+    if (flags == float_muladd_negate_product) {
         pSign ^= 1;
     }
     pInf = (aExp == 0x7ff) || (bExp == 0x7ff);