+2008-03-02 Joseph Myers <joseph@codesourcery.com>
+
+ * libgcc2.c (__addvSI3, __addvsi3, __addvDI3, __subvSI3,
+ __subvsi3, __subvDI3, __negvSI2, __negvsi2, __negvDI2, __absvSI2,
+ __absvsi2, __absvDI2): Use unsigned arithmetic.
+
2008-03-02 Andi Kleen <ak@suse.de>
Richard Guenther <rguenther@suse.de>
Wtype
__addvSI3 (Wtype a, Wtype b)
{
- const Wtype w = a + b;
+ const Wtype w = (UWtype) a + (UWtype) b;
if (b >= 0 ? w < a : w > a)
abort ();
SItype
__addvsi3 (SItype a, SItype b)
{
- const SItype w = a + b;
+ const SItype w = (USItype) a + (USItype) b;
if (b >= 0 ? w < a : w > a)
abort ();
DWtype
__addvDI3 (DWtype a, DWtype b)
{
- const DWtype w = a + b;
+ const DWtype w = (UDWtype) a + (UDWtype) b;
if (b >= 0 ? w < a : w > a)
abort ();
Wtype
__subvSI3 (Wtype a, Wtype b)
{
- const Wtype w = a - b;
+ const Wtype w = (UWtype) a - (UWtype) b;
if (b >= 0 ? w > a : w < a)
abort ();
SItype
__subvsi3 (SItype a, SItype b)
{
- const SItype w = a - b;
+ const SItype w = (USItype) a - (USItype) b;
if (b >= 0 ? w > a : w < a)
abort ();
DWtype
__subvDI3 (DWtype a, DWtype b)
{
- const DWtype w = a - b;
+ const DWtype w = (UDWtype) a - (UDWtype) b;
if (b >= 0 ? w > a : w < a)
abort ();
Wtype
__negvSI2 (Wtype a)
{
- const Wtype w = -a;
+ const Wtype w = -(UWtype) a;
if (a >= 0 ? w > 0 : w < 0)
abort ();
SItype
__negvsi2 (SItype a)
{
- const SItype w = -a;
+ const SItype w = -(USItype) a;
if (a >= 0 ? w > 0 : w < 0)
abort ();
DWtype
__negvDI2 (DWtype a)
{
- const DWtype w = -a;
+ const DWtype w = -(UDWtype) a;
if (a >= 0 ? w > 0 : w < 0)
abort ();
#ifdef L_negvsi2
w = __negvSI2 (a);
#else
- w = -a;
+ w = -(UWtype) a;
if (w < 0)
abort ();
#ifdef L_negvsi2
w = __negvsi2 (a);
#else
- w = -a;
+ w = -(USItype) a;
if (w < 0)
abort ();
#ifdef L_negvdi2
w = __negvDI2 (a);
#else
- w = -a;
+ w = -(UDWtype) a;
if (w < 0)
abort ();