Little-endian PowerPC
Little-endian PowerPC
Posted Oct 7, 2010 14:47 UTC (Thu) by jengelh (subscriber, #33263)In reply to: Little-endian PowerPC by etienne
Parent article: Little-endian PowerPC
>Last time I looked gcc was not able to generate (did not know about) the bswap instruction.
Perhaps you need to update from that ancient gcc version ;-)
int main(int argc, char **argv) { printf("%d\n", htonl(argc)); return 0; } compiled with gcc-4.5 -O3 -static on x86_64 gives me a bswap in objdump. bswap has been there since 80486.
>some assembly instuctions to cast the value 3 in a 16 bits word to the value 3 in a byte,
Well, wouldn't that be just AND r0, 0xFF.
