all repos — mgba @ 010a4dad44eb7a9da394df440af17d1fc88512f9

mGBA Game Boy Advance Emulator

Wii: Fix ppc32 endianness regression
Vicki Pfau vi@endrift.com
Mon, 17 Aug 2020 15:52:20 -0700
commit

010a4dad44eb7a9da394df440af17d1fc88512f9

parent

8b7660c679459801a8428ed708f98896ac882099

1 files changed, 8 insertions(+), 8 deletions(-)

jump to
M include/mgba-util/common.hinclude/mgba-util/common.h

@@ -129,32 +129,32 @@ #if defined __BIG_ENDIAN__

#define LOAD_32BE(DEST, ADDR, ARR) DEST = *(uint32_t*) ((uintptr_t) (ARR) + (size_t) (ADDR)) #if defined(__PPC__) || defined(__POWERPC__) #define LOAD_32LE(DEST, ADDR, ARR) { \ - off_t _addr = (ADDR); \ + size_t _addr = (ADDR); \ const void* _ptr = (ARR); \ __asm__("lwbrx %0, %1, %2" : "=r"(DEST) : "b"(_ptr), "r"(_addr)); \ } #define LOAD_16LE(DEST, ADDR, ARR) { \ - off_t _addr = (ADDR); \ + size_t _addr = (ADDR); \ const void* _ptr = (ARR); \ __asm__("lhbrx %0, %1, %2" : "=r"(DEST) : "b"(_ptr), "r"(_addr)); \ } #define STORE_32LE(SRC, ADDR, ARR) { \ - off_t _addr = (ADDR); \ + size_t _addr = (ADDR); \ void* _ptr = (ARR); \ __asm__("stwbrx %0, %1, %2" : : "r"(SRC), "b"(_ptr), "r"(_addr) : "memory"); \ } #define STORE_16LE(SRC, ADDR, ARR) { \ - off_t _addr = (ADDR); \ + size_t _addr = (ADDR); \ void* _ptr = (ARR); \ __asm__("sthbrx %0, %1, %2" : : "r"(SRC), "b"(_ptr), "r"(_addr) : "memory"); \ } #ifndef _ARCH_PWR7 #define LOAD_64LE(DEST, ADDR, ARR) { \ - off_t _addr = (ADDR); \ + size_t _addr = (ADDR); \ union { \ struct { \ uint32_t hi; \

@@ -171,7 +171,7 @@ DEST = bswap.b64; \

} #define STORE_64LE(SRC, ADDR, ARR) { \ - off_t _addr = (ADDR); \ + size_t _addr = (ADDR); \ union { \ struct { \ uint32_t hi; \

@@ -187,13 +187,13 @@ : : "r"(bswap.hi), "r"(bswap.lo), "b"(_ptr), "r"(_addr), "r"(_addr + 4) : "memory"); \

} #else #define LOAD_64LE(DEST, ADDR, ARR) { \ - off_t _addr = (ADDR); \ + size_t _addr = (ADDR); \ const void* _ptr = (ARR); \ __asm__("ldbrx %0, %1, %2" : "=r"(DEST) : "b"(_ptr), "r"(_addr)); \ } #define STORE_64LE(SRC, ADDR, ARR) { \ - off_t _addr = (ADDR); \ + size_t _addr = (ADDR); \ void* _ptr = (ARR); \ __asm__("stdbrx %0, %1, %2" : : "r"(SRC), "b"(_ptr), "r"(_addr) : "memory"); \ }