summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-02-13 17:40:22 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-02-13 17:40:22 +0100
commit76146a471dc385b371e92418d67506842f7dbe8b (patch)
treeed68db4d8d4c5754de1c23b7f942449387987ce4
parent813c7abf04ab9f7f9c30059b258612e18dec5ce7 (diff)
downloadipecamera-76146a471dc385b371e92418d67506842f7dbe8b.tar.gz
ipecamera-76146a471dc385b371e92418d67506842f7dbe8b.tar.bz2
ipecamera-76146a471dc385b371e92418d67506842f7dbe8b.tar.xz
ipecamera-76146a471dc385b371e92418d67506842f7dbe8b.zip
Commented out unsuccesfull attempts to make 64 bit transfers
-rw-r--r--tools.c71
1 files changed, 70 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 7766c6a..9770b60 100644
--- a/tools.c
+++ b/tools.c
@@ -35,9 +35,77 @@ void *memcpy64(void * dst, void const * src, size_t len) {
while (len >= 8) {
*plDst++ = *plSrc++;
- len -= 4;
+ len -= 8;
+ }
+
+ char * pcDst = (char *) plDst;
+ char const * pcSrc = (char const *) plSrc;
+
+ while (len--) {
+ *pcDst++ = *pcSrc++;
+ }
+
+ return (dst);
+}
+
+/*
+void *memcpy128(void * dst, void const * src, size_t len) {
+
+ long pos = - (len>>2);
+ char * plDst = (char *) dst - 4 * pos;
+ char const * plSrc = (char const *) src - 4 * pos;
+
+ if (pos) {
+ __asm__ __volatile__ (
+ "1: \n\t"
+ "mov (%0,%2,4), %%edi \n\t"
+ "mov %%edi, (%1,%2,4) \n\t"
+ "inc %2 \n\t"
+ "jnz 1b \n\t"
+ :
+ : "r" (plSrc), "r" (plDst), "r" (pos)
+ : "%edi"
+ );
+ }
+
+
+
+ long pos = - ((len>>4)<<4);
+ char * plDst = (char *) dst - pos;
+ char const * plSrc = (char const *) src - pos;
+
+ if (pos) {
+ __asm__ __volatile__ (
+ "1: \n\t"
+// "movdqa (%0,%2), %%xmm0 \n\t"
+ "mov (%0,%2), %%esi \n\t"
+ "movd %%esi, %%xmm0 \n\t"
+ "mov 4(%0,%2), %%esi \n\t"
+ "movd %%esi, %%xmm1 \n\t"
+ "mov 8(%0,%2), %%esi \n\t"
+ "movd %%esi, %%xmm2 \n\t"
+ "mov 12(%0,%2), %%esi \n\t"
+ "movd %%esi, %%xmm3 \n\t"
+ "pslldq $4, %%xmm1 \n\t"
+ "por %%xmm1, %%xmm0 \n\t"
+ "pslldq $8, %%xmm2 \n\t"
+ "por %%xmm2, %%xmm0 \n\t"
+ "pslldq $12, %%xmm3 \n\t"
+ "por %%xmm3, %%xmm0 \n\t"
+
+ "movntdq %%xmm0, (%1,%2) \n\t"
+ "add $16, %2 \n\t"
+ "jnz 1b \n\t"
+ :
+ : "r" (plSrc), "r" (plDst), "r" (pos)
+ : "%rsi"
+ );
}
+
+
+ len &= 0x3;
+
char * pcDst = (char *) plDst;
char const * pcSrc = (char const *) plSrc;
@@ -47,6 +115,7 @@ void *memcpy64(void * dst, void const * src, size_t len) {
return (dst);
}
+*/
int get_page_mask() {