include/SDL_endian.h
changeset 3630 efb79807afe1
parent 3407 d3baf5ac4e37
child 3697 f7b03b6838cb
equal deleted inserted replaced
3629:102be1cdd2bb 3630:efb79807afe1
    90     Uint16 result;
    90     Uint16 result;
    91 
    91 
    92   __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
    92   __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
    93     return result;
    93     return result;
    94 }
    94 }
    95 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
    95 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
    96 static __inline__ Uint16
    96 static __inline__ Uint16
    97 SDL_Swap16(Uint16 x)
    97 SDL_Swap16(Uint16 x)
    98 {
    98 {
    99   __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
    99   __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
   100     return x;
   100     return x;
   130   __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x));
   130   __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x));
   131   __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x));
   131   __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x));
   132   __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x));
   132   __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x));
   133     return result;
   133     return result;
   134 }
   134 }
   135 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__))
   135 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
   136 static __inline__ Uint32
   136 static __inline__ Uint32
   137 SDL_Swap32(Uint32 x)
   137 SDL_Swap32(Uint32 x)
   138 {
   138 {
   139   __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
   139   __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
   140     return x;
   140     return x;