mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
[Xbox] Use intrinsics swap
This commit is contained in:
parent
46ac351b9b
commit
3be063d28a
1 changed files with 7 additions and 1 deletions
|
@ -153,9 +153,15 @@ private:
|
|||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifndef _XBOX
|
||||
inline unsigned long long bswap64(unsigned long long x) { return _byteswap_uint64(x); }
|
||||
inline unsigned int bswap32(unsigned int x) { return _byteswap_ulong(x); }
|
||||
inline unsigned int bswap16(unsigned int x) { return _byteswap_ushort(x); }
|
||||
inline unsigned short bswap16(unsigned short x) { return _byteswap_ushort(x); }
|
||||
#else
|
||||
inline unsigned long long bswap64(unsigned long long x) { return __loaddoublewordbytereverse(0, &x); }
|
||||
inline unsigned int bswap32(unsigned int x) { return __loadwordbytereverse(0, &x); }
|
||||
inline unsigned short bswap16(unsigned short x) { return __loadshortbytereverse(0, &x); }
|
||||
#endif
|
||||
#else
|
||||
// TODO: speedup
|
||||
inline unsigned short bswap16(unsigned short x) { return (x << 8) | (x >> 8); }
|
||||
|
|
Loading…
Add table
Reference in a new issue