diff --git a/memset.c b/memset.c new file mode 100644 index 0000000000..e034dbeae5 --- /dev/null +++ b/memset.c @@ -0,0 +1,17 @@ +#include "config.h" + +#ifdef USE_FASTMEMSET +#if defined(HAVE_SSE) || defined(HAVE_SSE2) +/* (C) 2001 Csabai Csaba */ +inline void *fast_memset(void *ptr, long val, long num) +{ + __asm__ __volatile__( + "cmpxchg8 (%2)" + : "=a" (val), "=d" (num) + : "r" (ptr), "0" (val), "1" (num) + :"memory"); + + return(ptr); +} +#endif +#endif