include/SDL_endian.h
branchSDL-1.2
changeset 4374 124629b76853
parent 4283 cd511a8560b7
child 4431 d660ca4f7b1f
equal deleted inserted replaced
4373:ab06accf1b96 4374:124629b76853
    84 	Uint16 result;
    84 	Uint16 result;
    85 
    85 
    86 	__asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
    86 	__asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x));
    87 	return result;
    87 	return result;
    88 }
    88 }
    89 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
    89 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
    90 static __inline__ Uint16 SDL_Swap16(Uint16 x)
    90 static __inline__ Uint16 SDL_Swap16(Uint16 x)
    91 {
    91 {
    92 	__asm__("rorw #8,%0" : "=d" (x) :  "0" (x) : "cc");
    92 	__asm__("rorw #8,%0" : "=d" (x) :  "0" (x) : "cc");
    93 	return x;
    93 	return x;
    94 }
    94 }
   119 	__asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
   119 	__asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x));
   120 	__asm__("rlwimi %0,%2,8,8,15"   : "=&r" (result) : "0" (result),    "r" (x));
   120 	__asm__("rlwimi %0,%2,8,8,15"   : "=&r" (result) : "0" (result),    "r" (x));
   121 	__asm__("rlwimi %0,%2,24,0,7"   : "=&r" (result) : "0" (result),    "r" (x));
   121 	__asm__("rlwimi %0,%2,24,0,7"   : "=&r" (result) : "0" (result),    "r" (x));
   122 	return result;
   122 	return result;
   123 }
   123 }
   124 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
   124 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
   125 static __inline__ Uint32 SDL_Swap32(Uint32 x)
   125 static __inline__ Uint32 SDL_Swap32(Uint32 x)
   126 {
   126 {
   127 	__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) :  "0" (x) : "cc");
   127 	__asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) :  "0" (x) : "cc");
   128 	return x;
   128 	return x;
   129 }
   129 }