Revision: 2921 Author: lewis Date: 2014-05-11 09:05:51 -0700 (Sun, 11 May 2014) Log Message: ----------- Fix bug on windows ioShowDisplay for bitdepth 16/8/4 (big endian)
Fix by Nicolai Hess. Added to oscog branch by Eliot Miranda. Merge update from oscog to trunk.
Fix and discussion on vm-dev: http://lists.squeakfoundation.org/pipermail/vm-dev/2014-May/015331.html
Updated in oscog branch in SVN commit 2919: http://lists.squeakfoundation.org/pipermail/vm-dev/2014-May/015334.html
Modified Paths: -------------- trunk/platforms/win32/vm/sqWin32Window.c
Modified: trunk/platforms/win32/vm/sqWin32Window.c =================================================================== --- trunk/platforms/win32/vm/sqWin32Window.c 2014-05-10 15:56:23 UTC (rev 2920) +++ trunk/platforms/win32/vm/sqWin32Window.c 2014-05-11 16:05:51 UTC (rev 2921) @@ -1710,14 +1710,14 @@ # define BYTE_SWAP(w) w # define WORD_SWAP(w) w #else /* LSB_FIRST */ -# if defined(__GNUC__) && defined(_X86_) +# if defined(__GNUC__) && (defined(_X86_) || defined(i386) || defined(__i386) || defined(__i386__)) /* GCC generates *optimal* code with a little help */ -# define BYTE_SWAP(w) __asm__("bswap %%eax" : "=eax" (w) : "eax" (w)) -# define WORD_SWAP(w) __asm__("roll $16, %%eax" : "=eax" (w) : "eax" (w)) +# define BYTE_SWAP(w) __asm__("bswap %0" : "+r" (w)) +# define WORD_SWAP(w) __asm__("roll $16, %0" : "+r" (w)) # define SRC_PIX_REG asm("%esi") # define DST_PIX_REG asm("%edi") -# else /* Not GCC?! Well, it's your own fault */ -# define BYTE_SWAP(w) w = (w << 24) | ((w & 0xFF00) << 8) | ((w >> 8) & 0xFF00) | (w >> 24) +# else /* Not GCC?! Well, it's your own fault ;-) */ +# define BYTE_SWAP(w) w = (w<<24) | ((w&0xFF00)<<8) | ((w>>8)&0xFF00) | (w>>24) # define WORD_SWAP(w) w = (( (unsigned)(w) << 16) | ((unsigned) (w) >> 16)) # endif /* __GNUC__ */ #endif /* MSB_FIRST */
vm-dev@lists.squeakfoundation.org