| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fdump-tree-crc-details -O2" } */ |
| 3 |
/* { dg-require-effective-target int32plus } */ |
| 4 |
|
| 5 |
// File - liboctasic_la-oct6100_chip_open |
| 6 |
// We don't support this case. |
| 7 |
|
| 8 |
typedef unsigned int UINT32; |
| 9 |
typedef UINT32 * PUINT32; |
| 10 |
typedef struct _OCT6100_INSTANCE_API_ |
| 11 |
{ |
| 12 |
|
| 13 |
// tPOCT6100_SHARED_INFO pSharedInfo; |
| 14 |
|
| 15 |
//PVOID pProcessContext; |
| 16 |
|
| 17 |
//tOCT6100_USER_SERIAL_OBJECT ulApiSerObj; |
| 18 |
|
| 19 |
|
| 20 |
} tOCT6100_INSTANCE_API, *tPOCT6100_INSTANCE_API; |
| 21 |
|
| 22 |
UINT32 Oct6100ApiProductionCrc( |
| 23 |
tPOCT6100_INSTANCE_API f_pApiInstance, |
| 24 |
PUINT32 f_pulMessage, |
| 25 |
UINT32 f_ulMessageLength, |
| 26 |
PUINT32 f_pulCrcResult ) |
| 27 |
{ |
| 28 |
UINT32 ulWidth = 32; |
| 29 |
UINT32 ulKey, i, j; |
| 30 |
UINT32 ulRemainder = 0; |
| 31 |
|
| 32 |
|
| 33 |
ulRemainder = f_pulMessage[ f_ulMessageLength - 1 ]; |
| 34 |
for ( j = f_ulMessageLength - 1; j != 0xFFFFFFFF ; j-- ) |
| 35 |
{ |
| 36 |
for ( i = 0; i < ulWidth; i++ ) |
| 37 |
{ |
| 38 |
if ( ( ( ulRemainder >> 0x1F ) & 0x1 ) == 0x1 ) |
| 39 |
{ |
| 40 |
ulKey = 0x8765DCBA; |
| 41 |
} |
| 42 |
else |
| 43 |
{ |
| 44 |
ulKey = 0; |
| 45 |
} |
| 46 |
ulRemainder = ulRemainder ^ ulKey; |
| 47 |
|
| 48 |
ulRemainder = ulRemainder << 1; |
| 49 |
if ( j != 0 ) |
| 50 |
{ |
| 51 |
ulRemainder = ulRemainder | ( ( f_pulMessage[ j - 1 ] ) >> ( 0x1F - i ) ); |
| 52 |
} |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
*f_pulCrcResult = ulRemainder; |
| 57 |
|
| 58 |
return 0x00000000; |
| 59 |
} |