fix auto-detection of SSE headers on x86

This commit is contained in:
gbeauche 2004-02-24 10:21:21 +00:00
parent b802615c36
commit 643f9ad5e5
2 changed files with 30 additions and 18 deletions

View File

@ -183,9 +183,6 @@ AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
AC_CHECK_HEADERS(sys/time.h sys/times.h)
AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h)
AC_CHECK_HEADERS(mmintrin.h, [have_mmintrin_h=yes])
AC_CHECK_HEADERS(xmmintrin.h, [have_xmmintrin_h=yes])
AC_CHECK_HEADERS(emmintrin.h, [have_emmintrin_h=yes])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
@ -728,15 +725,17 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then
else
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
fi
if [[ "x$have_mmintrin_h" = "xyes" ]]; then
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"
fi
if [[ "x$have_xmmintrin_h" = "xyes" ]]; then
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"
fi
if [[ "x$have_emmintrin_h" = "xyes" ]]; then
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"
fi
saved_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -mmmx"
AC_CHECK_HEADERS(mmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
CPPFLAGS="$CPPFLAGS -msse"
AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
CPPFLAGS="$CPPFLAGS -msse2"
AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
CPPFLAGS=$saved_CPPFLAGS
;;
x86_64)
AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
;;
esac
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"

View File

@ -1334,37 +1334,43 @@ void op_store_vect_VD_T0(void)
* Vector operations helpers
**/
struct VNONE {
#define VNONE op_VNONE
struct op_VNONE {
typedef null_operand type;
static inline uint32 get(powerpc_vr const & v, int i) { return 0; }
static inline void set(powerpc_vr const & v, int i, uint32) { }
};
struct V16QI {
#define V16QI op_V16QI
struct op_V16QI {
typedef uint8 type;
static inline type get(powerpc_vr const & v, int i) { return v.b[i]; }
static inline void set(powerpc_vr & v, int i, type x) { v.b[i] = x; }
};
struct V8HI {
#define V8HI op_V8HI
struct op_V8HI {
typedef uint16 type;
static inline type get(powerpc_vr const & v, int i) { return v.h[i]; }
static inline void set(powerpc_vr & v, int i, type x) { v.h[i] = x; }
};
struct V4SI {
#define V4SI op_V4SI
struct op_V4SI {
typedef uint32 type;
static inline type get(powerpc_vr const & v, int i) { return v.w[i]; }
static inline void set(powerpc_vr & v, int i, type x) { v.w[i] = x; }
};
struct V2DI {
#define V2DI op_V2DI
struct op_V2DI {
typedef uint64 type;
static inline type get(powerpc_vr const & v, int i) { return v.j[i]; }
static inline void set(powerpc_vr & v, int i, type x) { v.j[i] = x; }
};
struct V4SF {
#define V4SF op_V4SF
struct op_V4SF {
typedef float type;
static inline type get(powerpc_vr const & v, int i) { return v.f[i]; }
static inline void set(powerpc_vr & v, int i, type x) { v.f[i] = x; }
@ -1485,6 +1491,13 @@ void op_record_cr6_VD(void)
dyngen_barrier();
}
#undef VNONE
#undef V16QI
#undef V8HI
#undef V4SI
#undef V2DI
#undef V4SF
/**
* SSE optimizations
**/