diff options
author | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-11-06 00:29:59 +0000 |
---|---|---|
committer | tma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-11-06 00:29:59 +0000 |
commit | c613485929e503ef9b71bdc226e9b504f3640e03 (patch) | |
tree | dd75a3f30a3597c25b0bbde33f9ce84ed8eae7ba /code/qcommon/vm_interpreted.c | |
parent | c322f59e69a690e99e69114d4207ce0e7f261a3a (diff) | |
download | ioquake3-aero-c613485929e503ef9b71bdc226e9b504f3640e03.tar.gz ioquake3-aero-c613485929e503ef9b71bdc226e9b504f3640e03.zip |
* Tidy-up of q_platform.h
* Introduced Q3_BIG_ENDIAN and Q3_LITTLE_ENDIAN #defines
* Changed some stricmp to Q_stricmp so that #define stricmp strcasecmp could be
removed
git-svn-id: svn://svn.icculus.org/quake3/trunk@287 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon/vm_interpreted.c')
-rw-r--r-- | code/qcommon/vm_interpreted.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/code/qcommon/vm_interpreted.c b/code/qcommon/vm_interpreted.c index 1d180aa..4a9ff5b 100644 --- a/code/qcommon/vm_interpreted.c +++ b/code/qcommon/vm_interpreted.c @@ -113,16 +113,26 @@ static char *opnames[256] = { #endif #if idppc - #if defined(__GNUC__) - static ID_INLINE unsigned int loadWord(void *addr) { - unsigned int word; - - asm("lwbrx %0,0,%1" : "=r" (word) : "r" (addr)); - return word; - } - #else - #define loadWord(addr) __lwbrx(addr,0) - #endif + +//FIXME: these, um... look the same to me +#if defined(__GNUC__) +static ID_INLINE unsigned int loadWord(void *addr) { + unsigned int word; + + asm("lwbrx %0,0,%1" : "=r" (word) : "r" (addr)); + return word; +} +#else +static ID_INLINE unsigned int __lwbrx(register void *addr, + register int offset) { + register unsigned int word; + + asm("lwbrx %0,%2,%1" : "=r" (word) : "r" (addr), "b" (offset)); + return word; +} +#define loadWord(addr) __lwbrx(addr,0) +#endif + #else static ID_INLINE int loadWord(void *addr) { int word; |