Re: [Algorithms] Byte Swapping
Brought to you by:
vexxed72
From: Pierre T. <p.t...@wa...> - 2000-07-17 23:11:47
|
Errr............ you'd better use the BSWAP instruction........ same result with one line of assembly............ Pierre ----- Original Message ----- From: Charles Bloom <cb...@cb...> To: <gda...@li...> Sent: Tuesday, July 18, 2000 12:41 AM Subject: Re: [Algorithms] Byte Swapping > > Jumping in late : I'm sure you don't need it now, but > here's a crazy ANSI C byte-swapper : > > let x = a 32 bit ulong , ABCD > then y = DCBA > > y = (x = x>>16 | x<<16) ^ (x = (x^x>>8) & 0x00FF00FF) ^ (x<<8); > > At 11:45 PM 7/15/2000 -0700, you wrote: > >I can do the obvious method, but I was wondering if anyone have any > >cool/fast code snippets for byte swapping integers and floats? > > > >Tom > > > > > >_______________________________________________ > >GDAlgorithms-list mailing list > >GDA...@li... > >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > > -------------------------------------- > Charles Bloom www.cbloom.com > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |