Tue Feb 17 02:43:39 2009 UTC ()
fix -Wsign-compare issue (seen on arm), using similar technique
to ../bits64/softfloat-macros


(lukem)
diff -r1.1 -r1.2 src/lib/libc/softfloat/bits32/softfloat-macros

cvs diff -r1.1 -r1.2 src/lib/libc/softfloat/bits32/softfloat-macros (expand / switch to unified diff)

--- src/lib/libc/softfloat/bits32/softfloat-macros 2002/05/21 23:51:07 1.1
+++ src/lib/libc/softfloat/bits32/softfloat-macros 2009/02/17 02:43:39 1.2
@@ -301,27 +301,27 @@ INLINE void @@ -301,27 +301,27 @@ INLINE void
301 bits32 *z1Ptr, 301 bits32 *z1Ptr,
302 bits32 *z2Ptr 302 bits32 *z2Ptr
303 ) 303 )
304{ 304{
305 bits32 z0, z1, z2; 305 bits32 z0, z1, z2;
306 int8 carry0, carry1; 306 int8 carry0, carry1;
307 307
308 z2 = a2 + b2; 308 z2 = a2 + b2;
309 carry1 = ( z2 < a2 ); 309 carry1 = ( z2 < a2 );
310 z1 = a1 + b1; 310 z1 = a1 + b1;
311 carry0 = ( z1 < a1 ); 311 carry0 = ( z1 < a1 );
312 z0 = a0 + b0; 312 z0 = a0 + b0;
313 z1 += carry1; 313 z1 += carry1;
314 z0 += ( z1 < carry1 ); 314 z0 += ( z1 < (bits32)carry1 );
315 z0 += carry0; 315 z0 += carry0;
316 *z2Ptr = z2; 316 *z2Ptr = z2;
317 *z1Ptr = z1; 317 *z1Ptr = z1;
318 *z0Ptr = z0; 318 *z0Ptr = z0;
319 319
320} 320}
321 321
322/* 322/*
323------------------------------------------------------------------------------- 323-------------------------------------------------------------------------------
324Subtracts the 64-bit value formed by concatenating `b0' and `b1' from the 324Subtracts the 64-bit value formed by concatenating `b0' and `b1' from the
32564-bit value formed by concatenating `a0' and `a1'. Subtraction is modulo 32564-bit value formed by concatenating `a0' and `a1'. Subtraction is modulo
3262^64, so any borrow out (carry out) is lost. The result is broken into two 3262^64, so any borrow out (carry out) is lost. The result is broken into two
32732-bit pieces which are stored at the locations pointed to by `z0Ptr' and 32732-bit pieces which are stored at the locations pointed to by `z0Ptr' and
@@ -358,27 +358,27 @@ INLINE void @@ -358,27 +358,27 @@ INLINE void
358 bits32 *z0Ptr, 358 bits32 *z0Ptr,
359 bits32 *z1Ptr, 359 bits32 *z1Ptr,
360 bits32 *z2Ptr 360 bits32 *z2Ptr
361 ) 361 )
362{ 362{
363 bits32 z0, z1, z2; 363 bits32 z0, z1, z2;
364 int8 borrow0, borrow1; 364 int8 borrow0, borrow1;
365 365
366 z2 = a2 - b2; 366 z2 = a2 - b2;
367 borrow1 = ( a2 < b2 ); 367 borrow1 = ( a2 < b2 );
368 z1 = a1 - b1; 368 z1 = a1 - b1;
369 borrow0 = ( a1 < b1 ); 369 borrow0 = ( a1 < b1 );
370 z0 = a0 - b0; 370 z0 = a0 - b0;
371 z0 -= ( z1 < borrow1 ); 371 z0 -= ( z1 < (bits32)borrow1 );
372 z1 -= borrow1; 372 z1 -= borrow1;
373 z0 -= borrow0; 373 z0 -= borrow0;
374 *z2Ptr = z2; 374 *z2Ptr = z2;
375 *z1Ptr = z1; 375 *z1Ptr = z1;
376 *z0Ptr = z0; 376 *z0Ptr = z0;
377 377
378} 378}
379 379
380/* 380/*
381------------------------------------------------------------------------------- 381-------------------------------------------------------------------------------
382Multiplies `a' by `b' to obtain a 64-bit product. The product is broken 382Multiplies `a' by `b' to obtain a 64-bit product. The product is broken
383into two 32-bit pieces which are stored at the locations pointed to by 383into two 32-bit pieces which are stored at the locations pointed to by
384`z0Ptr' and `z1Ptr'. 384`z0Ptr' and `z1Ptr'.