include/SDL_endian.h
changeset 985 cec525374267
parent 859 6b28c91bf3d2
child 994 c4e5473672b6
     1.1 --- a/include/SDL_endian.h	Sun Nov 21 21:59:47 2004 +0000
     1.2 +++ b/include/SDL_endian.h	Mon Nov 22 10:16:58 2004 +0000
     1.3 @@ -79,6 +79,12 @@
     1.4  	__asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
     1.5  	return result;
     1.6  }
     1.7 +#elif defined(__GNUC__) && defined(__M68000__)
     1.8 +static __inline__ Uint16 SDL_Swap16(Uint16 x)
     1.9 +{
    1.10 +	__asm__("rorw #8,%0" : "=d" (x) :  "0" (x) : "cc");
    1.11 +	return x;
    1.12 +}
    1.13  #else
    1.14  static __inline__ Uint16 SDL_Swap16(Uint16 x) {
    1.15  	return((x<<8)|(x>>8));
    1.16 @@ -107,6 +113,12 @@
    1.17  	__asm__("rlwimi %0,%2,24,0,7"   : "=&r" (result) : "0" (result),    "r" (x));
    1.18  	return result;
    1.19  }
    1.20 +#elif defined(__GNUC__) && defined(__M68000__)
    1.21 +static __inline__ Uint16 SDL_Swap32(Uint16 x)
    1.22 +{
    1.23 +	__asm__("rorw	#8,%0;\t\nswap	%0;\t\nror	#8,%0" : "=d" (x) :  "0" (x) : "cc");
    1.24 +	return x;
    1.25 +}
    1.26  #else
    1.27  static __inline__ Uint32 SDL_Swap32(Uint32 x) {
    1.28  	return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));