[commit] r2260 - Fix win32 image byte/word reversal under gcc >= 3.x.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] r2260 - Fix win32 image byte/word reversal under gcc >= 3.x.

commits-3
 
Author: eliot
Date: 2010-08-24 18:35:31 -0700 (Tue, 24 Aug 2010)
New Revision: 2260

Modified:
   branches/Cog/platforms/win32/vm/sqWin32Window.c
Log:
Fix win32 image byte/word reversal under gcc >= 3.x.


Modified: branches/Cog/platforms/win32/vm/sqWin32Window.c
===================================================================
--- branches/Cog/platforms/win32/vm/sqWin32Window.c 2010-08-25 00:41:22 UTC (rev 2259)
+++ branches/Cog/platforms/win32/vm/sqWin32Window.c 2010-08-25 01:35:31 UTC (rev 2260)
@@ -1778,8 +1778,8 @@
 # if defined(__GNUC__) && (defined(_X86_) || defined(i386) || defined(__i386) || defined(__i386__))
    /* GCC generates *optimal* code with a little help */
 #  if __GNUC__ >= 3
-#   define BYTE_SWAP(w) __asm__("bswap %%eax" : "=r" (w) : "r" (w))
-#   define WORD_SWAP(w) __asm__("roll $16, %%eax" : "=r" (w) : "r" (w))
+#   define BYTE_SWAP(w) __asm__("bswap %0" : "=r" (w) : "r" (w))
+#   define WORD_SWAP(w) __asm__("roll $16, %0" : "=r" (w) : "r" (w))
 #  else
 #   define BYTE_SWAP(w) __asm__("bswap %%eax" : "=eax" (w) : "eax" (w))
 #   define WORD_SWAP(w) __asm__("roll $16, %%eax" : "=eax" (w) : "eax" (w))