| 1 |
/* revsh */ |
| 2 |
short swaps16 (short x) |
| 3 |
{ |
| 4 |
return __builtin_bswap16 (x); |
| 5 |
} |
| 6 |
|
| 7 |
extern short foos16 (short); |
| 8 |
|
| 9 |
/* revshne */ |
| 10 |
short swaps16_cond (short x, int y) |
| 11 |
{ |
| 12 |
short z = x; |
| 13 |
if (y != 2) |
| 14 |
z = __builtin_bswap16 (x); |
| 15 |
return foos16 (z); |
| 16 |
} |
| 17 |
|
| 18 |
/* rev16 */ |
| 19 |
unsigned short swapu16 (unsigned short x) |
| 20 |
{ |
| 21 |
return __builtin_bswap16 (x); |
| 22 |
} |
| 23 |
|
| 24 |
extern unsigned short foou16 (unsigned short); |
| 25 |
|
| 26 |
/* rev16ne */ |
| 27 |
unsigned short swapu16_cond (unsigned short x, int y) |
| 28 |
{ |
| 29 |
unsigned short z = x; |
| 30 |
if (y != 2) |
| 31 |
z = __builtin_bswap16 (x); |
| 32 |
return foou16 (z); |
| 33 |
} |
| 34 |
|
| 35 |
/* rev */ |
| 36 |
int swaps32 (int x) { |
| 37 |
return __builtin_bswap32 (x); |
| 38 |
} |
| 39 |
|
| 40 |
extern int foos32 (int); |
| 41 |
|
| 42 |
/* revne */ |
| 43 |
int swaps32_cond (int x, int y) |
| 44 |
{ |
| 45 |
int z = x; |
| 46 |
if (y != 2) |
| 47 |
z = __builtin_bswap32 (x); |
| 48 |
return foos32 (z); |
| 49 |
} |
| 50 |
|
| 51 |
/* rev */ |
| 52 |
unsigned int swapu32 (unsigned int x) |
| 53 |
{ |
| 54 |
return __builtin_bswap32 (x); |
| 55 |
} |
| 56 |
|
| 57 |
extern unsigned int foou32 (unsigned int); |
| 58 |
|
| 59 |
/* revne */ |
| 60 |
unsigned int swapsu2 (unsigned int x, int y) |
| 61 |
{ |
| 62 |
int z = x; |
| 63 |
if (y != 2) |
| 64 |
z = __builtin_bswap32 (x); |
| 65 |
return foou32 (z); |
| 66 |
} |