Move GCC/x86 assembler instructions into a single common file; begin work on supporting MinGW as a secondary Win32 build environment.

This commit is contained in:
Ben Anderson
2005-06-20 01:33:32 +00:00
parent 8c121d4598
commit ebcbdd3c9f
3 changed files with 70 additions and 33 deletions
+3 -33
View File
@@ -5,39 +5,9 @@
#include <stdint.h>
#endif
#if defined(CPU_X86)
inline uint32_t ArchSwap32( uint32_t n )
{
asm(
"xchg %b0, %h0\n"
"rorl $16, %0\n"
"xchg %b0, %h0":
"=q" (n): "0" (n) );
return n;
}
inline uint32_t ArchSwap24( uint32_t n )
{
asm(
"xchg %b0, %h0\n"
"rorl $16, %0\n"
"xchg %b0, %h0\n"
"shrl $8, %0\n":
"=q" (n): "0" (n) );
return n;
}
inline uint16_t ArchSwap16( uint16_t n )
{
asm(
"xchg %b0, %h0\n":
"=q" (n): "0" (n) );
return n;
}
#define HAVE_BYTE_SWAPS
#endif
// XXX: Maybe we should make sure we're using GCC first?
// But if not, then what DO we use?
#include "archutils/Common/gcc_byte_swaps.h"
#endif