[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnet/support rc2.c,1.1,1.2
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnet/support rc2.c,1.1,1.2 |
Date: |
Tue, 28 Jan 2003 22:51:11 -0500 |
Update of /cvsroot/dotgnu-pnet/pnet/support
In directory subversions:/tmp/cvs-serv6512/support
Modified Files:
rc2.c
Log Message:
rc2.c: work around problems with unsigned short on Alpha compilers.
Index: rc2.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/rc2.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** rc2.c 12 Jul 2002 06:02:30 -0000 1.1
--- rc2.c 29 Jan 2003 03:51:09 -0000 1.2
***************
*** 32,35 ****
--- 32,49 ----
/*
+ * Some alpha versions of gcc have problems assigning to unsigned short's,
+ * which causes gcc to lock-up. We work around this using "ILUInt32".
+ * This isn't terribly elegant - any suggestions as to what is really
+ * happening are welcome.
+ */
+ #if defined(__alpha__)
+ typedef ILUInt32 RWorkType;
+ #define NORM(x) ((x) &= 0xFFFF)
+ #else
+ typedef ILUInt16 RWorkType;
+ #define NORM(x)
+ #endif
+
+ /*
* Perform a "mix" operation.
*/
***************
*** 39,44 ****
--- 53,60 ----
(R[((rindex) - 1) & 3] & R[((rindex) -
2) & 3]) + \
((~(R[((rindex) - 1) & 3])) &
R[((rindex) - 3) & 3]); \
+ NORM(R[(rindex)]); \
R[(rindex)] = (R[(rindex)] << (svalue)) | \
(R[(rindex)] >> (16 -
(svalue))); \
+ NORM(R[(rindex)]); \
} while (0)
#define MIXROUND(kindex) \
***************
*** 56,59 ****
--- 72,76 ----
do { \
R[(rindex)] += K[R[((rindex) - 1) & 3] & 63]; \
+ NORM(R[(rindex)]); \
} while (0)
#define MASHROUND() \
***************
*** 72,78 ****
--- 89,97 ----
R[(rindex)] = (R[(rindex)] >> (svalue)) | \
(R[(rindex)] << (16 -
(svalue))); \
+ NORM(R[(rindex)]); \
R[(rindex)] -= K[(kindex)] + \
(R[((rindex) - 1) & 3] & R[((rindex) -
2) & 3]) + \
((~(R[((rindex) - 1) & 3])) &
R[((rindex) - 3) & 3]); \
+ NORM(R[(rindex)]); \
} while (0)
#define RMIXROUND(kindex) \
***************
*** 90,93 ****
--- 109,113 ----
do { \
R[(rindex)] -= K[R[((rindex) - 1) & 3] & 63]; \
+ NORM(R[(rindex)]); \
} while (0)
#define RMASHROUND() \
***************
*** 178,182 ****
{
register const ILUInt16 *K = rc2->key;
! ILUInt16 R[4];
/* Copy the input buffer into the "R" array */
--- 198,202 ----
{
register const ILUInt16 *K = rc2->key;
! RWorkType R[4];
/* Copy the input buffer into the "R" array */
***************
*** 225,229 ****
{
register const ILUInt16 *K = rc2->key;
! ILUInt16 R[4];
/* Copy the input buffer into the "R" array */
--- 245,249 ----
{
register const ILUInt16 *K = rc2->key;
! RWorkType R[4];
/* Copy the input buffer into the "R" array */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnet/support rc2.c,1.1,1.2,
Rhys Weatherley <address@hidden> <=