Re: [hatari-devel] FPU update

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 21/04/2017 à 15:33, Nicolas Pomarède a écrit :
                                                         ^
In file included from
/home/npomarede/src/hatari-fpu/src/cpu/fpp_softfloat.c:30:0:
/home/npomarede/src/hatari-fpu/src/cpu/softfloat/softfloat-macros.h: In
function 'add192':
/home/npomarede/src/hatari-fpu/src/cpu/softfloat/softfloat-macros.h:439:16:
warning: comparison between signed and unsigned integer expressions
[-Wsign-compare]
     z0 += ( z1 < carry1 );

Hi

for this one in add192(), carry1 should be declared as uint8_t not int8_t, because we have :
    carry1 = ( z2 < a2 );

which means carry1 can only be 0 or 1, not negative. In similar sub192(), uint8_t is correctly used.

diff -r d84dc2131312 src/cpu/softfloat/softfloat-macros.h
--- a/src/cpu/softfloat/softfloat-macros.h Sat Apr 22 15:58:33 2017 +0200 +++ b/src/cpu/softfloat/softfloat-macros.h Sat Apr 22 19:58:10 2017 +0200
@@ -428,7 +428,7 @@
  )
 {
     uint64_t z0, z1, z2;
-    int8_t carry0, carry1;
+    uint8_t carry0, carry1;


Nicolas




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/