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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user