[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/support mul_long.c,1.1,1.2
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/support mul_long.c,1.1,1.2 |
Date: |
Wed, 27 Nov 2002 20:37:22 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/support
In directory subversions:/tmp/cvs-serv13010/support
Modified Files:
mul_long.c
Log Message:
ILUInt64MulOvf: explicitly cast 32-bit subcomponents to 64 bits before
multiplying, to prevent truncation.
Index: mul_long.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/mul_long.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** mul_long.c 8 Nov 2001 06:35:19 -0000 1.1
--- mul_long.c 28 Nov 2002 01:37:20 -0000 1.2
***************
*** 40,47 ****
high2 = (ILUInt32)(value2 >> 32);
low2 = (ILUInt32)value2;
! temp = low1 * low2;
result1 = (ILUInt32)temp;
result2 = (ILUInt32)(temp >> 32);
! temp = low1 * high2;
orig = result2;
result2 += (ILUInt32)temp;
--- 40,47 ----
high2 = (ILUInt32)(value2 >> 32);
low2 = (ILUInt32)value2;
! temp = ((ILUInt64)low1) * ((ILUInt64)low2);
result1 = (ILUInt32)temp;
result2 = (ILUInt32)(temp >> 32);
! temp = ((ILUInt64)low1) * ((ILUInt64)high2);
orig = result2;
result2 += (ILUInt32)temp;
***************
*** 50,54 ****
else
result3 = ((ILUInt32)(temp >> 32));
! temp = high1 * low2;
orig = result2;
result2 += (ILUInt32)temp;
--- 50,54 ----
else
result3 = ((ILUInt32)(temp >> 32));
! temp = ((ILUInt64)high1) * ((ILUInt64)low2);
orig = result2;
result2 += (ILUInt32)temp;
***************
*** 71,75 ****
result4 = 0;
}
! temp = high1 * high2;
orig = result3;
result3 += (ILUInt32)temp;
--- 71,75 ----
result4 = 0;
}
! temp = ((ILUInt64)high1) * ((ILUInt64)high2);
orig = result3;
result3 += (ILUInt32)temp;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/support mul_long.c,1.1,1.2,
Rhys Weatherley <address@hidden> <=