diff options
author | bunnei <bunneidev@gmail.com> | 2015-03-06 16:29:58 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-03-06 16:29:58 +0100 |
commit | 53ba65db436eb9c25ac71e17bfb8685d599b1681 (patch) | |
tree | bea33469eebc06d4e72b1961f689cbc8b3df076d /src/common/common.h | |
parent | Merge pull request #615 from Subv/services (diff) | |
parent | Removed swap code redundancy and moved common swap code to swap.h (diff) | |
download | yuzu-53ba65db436eb9c25ac71e17bfb8685d599b1681.tar yuzu-53ba65db436eb9c25ac71e17bfb8685d599b1681.tar.gz yuzu-53ba65db436eb9c25ac71e17bfb8685d599b1681.tar.bz2 yuzu-53ba65db436eb9c25ac71e17bfb8685d599b1681.tar.lz yuzu-53ba65db436eb9c25ac71e17bfb8685d599b1681.tar.xz yuzu-53ba65db436eb9c25ac71e17bfb8685d599b1681.tar.zst yuzu-53ba65db436eb9c25ac71e17bfb8685d599b1681.zip |
Diffstat (limited to 'src/common/common.h')
-rw-r--r-- | src/common/common.h | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/common/common.h b/src/common/common.h index 948dc536a..f7d0f55c5 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -117,40 +117,4 @@ enum EMUSTATE_CHANGE EMUSTATE_CHANGE_STOP }; - -#ifdef _MSC_VER -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 short bswap16(unsigned short x) { return _byteswap_ushort(x); } -#else -// TODO: speedup -inline unsigned short bswap16(unsigned short x) { return (x << 8) | (x >> 8); } -inline unsigned int bswap32(unsigned int x) { return (x >> 24) | ((x & 0xFF0000) >> 8) | ((x & 0xFF00) << 8) | (x << 24);} -inline unsigned long long bswap64(unsigned long long x) {return ((unsigned long long)bswap32(x) << 32) | bswap32(x >> 32); } -#endif - -inline float bswapf(float f) { - union { - float f; - unsigned int u32; - } dat1, dat2; - - dat1.f = f; - dat2.u32 = bswap32(dat1.u32); - - return dat2.f; -} - -inline double bswapd(double f) { - union { - double f; - unsigned long long u64; - } dat1, dat2; - - dat1.f = f; - dat2.u64 = bswap64(dat1.u64); - - return dat2.f; -} - #include "swap.h" |