Mesa (master): i915: Remove hand-rolled memcpy implementation.

Matt Turner mattst88 at kemper.freedesktop.org
Mon Mar 2 18:39:07 UTC 2015


Module: Mesa
Branch: master
Commit: 93a8c702a6582049d2f49c752fdaab1df625cc0c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=93a8c702a6582049d2f49c752fdaab1df625cc0c

Author: Matt Turner <mattst88 at gmail.com>
Date:   Fri Feb 20 20:32:14 2015 -0800

i915: Remove hand-rolled memcpy implementation.

Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/drivers/dri/i915/intel_batchbuffer.c |    2 +-
 src/mesa/drivers/dri/i915/intel_context.h     |   28 -------------------------
 2 files changed, 1 insertion(+), 29 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/src/mesa/drivers/dri/i915/intel_batchbuffer.c
index 3d4e365..e0f14a4 100644
--- a/src/mesa/drivers/dri/i915/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.c
@@ -246,7 +246,7 @@ intel_batchbuffer_data(struct intel_context *intel,
 {
    assert((bytes & 3) == 0);
    intel_batchbuffer_require_space(intel, bytes);
-   __memcpy(intel->batch.map + intel->batch.used, data, bytes);
+   memcpy(intel->batch.map + intel->batch.used, data, bytes);
    intel->batch.used += bytes >> 2;
 }
 
diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h
index a2819a1..1bbd58f 100644
--- a/src/mesa/drivers/dri/i915/intel_context.h
+++ b/src/mesa/drivers/dri/i915/intel_context.h
@@ -297,34 +297,6 @@ do {						\
 } while (0)
 
 /* ================================================================
- * From linux kernel i386 header files, copes with odd sizes better
- * than COPY_DWORDS would:
- * XXX Put this in src/mesa/main/imports.h ???
- */
-#if defined(i386) || defined(__i386__)
-static inline void * __memcpy(void * to, const void * from, size_t n)
-{
-   int d0, d1, d2;
-   __asm__ __volatile__(
-      "rep ; movsl\n\t"
-      "testb $2,%b4\n\t"
-      "je 1f\n\t"
-      "movsw\n"
-      "1:\ttestb $1,%b4\n\t"
-      "je 2f\n\t"
-      "movsb\n"
-      "2:"
-      : "=&c" (d0), "=&D" (d1), "=&S" (d2)
-      :"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from)
-      : "memory");
-   return (to);
-}
-#else
-#define __memcpy(a,b,c) memcpy(a,b,c)
-#endif
-
-
-/* ================================================================
  * Debugging:
  */
 extern int INTEL_DEBUG;




More information about the mesa-commit mailing list