X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=eradicate;a=blobdiff_plain;f=src%2Futil.h;fp=src%2Futil.h;h=d56bcf5f323612626e72a99af21348f89fefa700;hp=6d869ebec22169441afcde79fb10f102e8220e47;hb=03eaea2400647375400c3bc4d927c399e142a901;hpb=26db2e08470629e79e0afe76c2fcbb3b4e10a01d diff --git a/src/util.h b/src/util.h index 6d869eb..d56bcf5 100644 --- a/src/util.h +++ b/src/util.h @@ -30,6 +30,18 @@ static INLINE int32_t cround64(double val) extern uint32_t perf_start_count, perf_interval_count; #ifdef __WATCOMC__ +void memcpy64(void *dest, void *src, int count); +#pragma aux memcpy64 = \ + "cploop:" \ + "movq mm0, [edx]" \ + "movq [ebx], mm0" \ + "add edx, 8" \ + "add ebx, 8" \ + "dec ecx" \ + "jnz cploop" \ + "emms" \ + parm[ebx][edx][ecx]; + void perf_start(void); #pragma aux perf_start = \ "xor eax, eax" \ @@ -52,6 +64,17 @@ void debug_break(void); #endif #ifdef __GNUC__ +#define memcpy64(dest, src, count) asm volatile ( \ + "0:\n\t" \ + "movq (%1), %%mm0\n\t" \ + "movq %%mm0, (%0)\n\t" \ + "add $8, %1\n\t" \ + "add $8, %0\n\t" \ + "dec %2\n\t" \ + "jnz 0b\n\t" \ + "emms\n\t" \ + :: "r"(dest), "r"(src), "r"(count)) + #define perf_start() asm volatile ( \ "xor %%eax, %%eax\n" \ "cpuid\n" \