include/SDL_endian.h
changeset 994 c4e5473672b6
parent 985 cec525374267
child 1026 0f3aa6ab3341
equal deleted inserted replaced
993:2662da16d668 994:c4e5473672b6
   112 	__asm__("rlwimi %0,%2,8,8,15"   : "=&r" (result) : "0" (result),    "r" (x));
   112 	__asm__("rlwimi %0,%2,8,8,15"   : "=&r" (result) : "0" (result),    "r" (x));
   113 	__asm__("rlwimi %0,%2,24,0,7"   : "=&r" (result) : "0" (result),    "r" (x));
   113 	__asm__("rlwimi %0,%2,24,0,7"   : "=&r" (result) : "0" (result),    "r" (x));
   114 	return result;
   114 	return result;
   115 }
   115 }
   116 #elif defined(__GNUC__) && defined(__M68000__)
   116 #elif defined(__GNUC__) && defined(__M68000__)
   117 static __inline__ Uint16 SDL_Swap32(Uint16 x)
   117 static __inline__ Uint32 SDL_Swap32(Uint32 x)
   118 {
   118 {
   119 	__asm__("rorw	#8,%0;\t\nswap	%0;\t\nror	#8,%0" : "=d" (x) :  "0" (x) : "cc");
   119 	__asm__("rorw	#8,%0\n\tswap	%0\n\tror	#8,%0" : "=d" (x) :  "0" (x) : "cc");
   120 	return x;
   120 	return x;
   121 }
   121 }
   122 #else
   122 #else
   123 static __inline__ Uint32 SDL_Swap32(Uint32 x) {
   123 static __inline__ Uint32 SDL_Swap32(Uint32 x) {
   124 	return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));
   124 	return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24));