Enlightenment CVS committal

Author  : raster
Project : e17
Module  : proto

Dir     : e17/proto/gfx_routines


Modified Files:
        mmx.h 


Log Message:


fix mmx header.

===================================================================
RCS file: /cvs/e/e17/proto/gfx_routines/mmx.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- mmx.h       23 Feb 2006 06:56:13 -0000      1.4
+++ mmx.h       10 May 2006 04:09:07 -0000      1.5
@@ -121,11 +121,11 @@
 #define        mmx_a2r(op, mem, reg) \
        __asm__ __volatile__ (#op " %0, %%" #reg \
                              : /* nothing */ \
-                             : "g" (mem))
+                             : "m" (mem))
 
 #define        mmx_r2a(op, reg, mem) \
        __asm__ __volatile__ (#op " %%" #reg ", %0" \
-                             : "=g" (mem) \
+                             : "=m" (mem) \
                              : /* nothing */ )
 
 #define        mmx_r2r(op, regs, regd) \
@@ -582,6 +582,46 @@
 #define CPUID_SSE  (1 << 25) /* flags: xmm */
 #define CPUID_SSE2 (1 << 26) /* flags: ? */
 
+#ifdef __amd64
+#define have_cpuid(cpuid_ret) \
+         __asm__ __volatile__ ( \
+                                  ".align 32               \n" \
+                                  "  pushq %%rbx           \n" \
+                                  "  pushfq                \n" \
+                                  "  popq %%rax            \n" \
+                                  "  movq %%rax, %%rbx     \n" \
+                                  "  xorq $0x200000, %%rax \n" \
+                                  "  pushq %%rax           \n" \
+                                  "  popfq                 \n" \
+                                  "  pushfq                \n" \
+                                  "  popq %%rax            \n" \
+                                  "  cmpq %%rax, %%rbx     \n" \
+                                  "  je 1f                 \n" \
+                                  "  movl $1, %0           \n" \
+                                  "  jmp 2f                \n" \
+                                  "1:                      \n" \
+                                  "  movl $0, %0           \n" \
+                                  "2:                      \n" \
+                                  "  popq %%rbx            \n" \
+                                  : "=m" (cpuid_ret)           \
+                                  );
+
+#define get_cpuid(cpuid_ret) \
+         __asm__ __volatile__ ( \
+                                  ".align 32               \n" \
+                                  "  pushq %%rax           \n" \
+                                  "  movl $1, %%eax        \n" \
+                                  "  cpuid                 \n" \
+                                  "  test $0x00800000, %%edx\n" \
+                                  "1:                      \n" \
+                                  "  movl %%edx, %0        \n" \
+                                  "  jmp 2f                \n" \
+                                  "2:                      \n" \
+                                  "  movl $0, %0           \n" \
+                                  "  popq %%rax            \n" \
+                                  : "=m" (cpuid_ret)           \
+                                  );
+#else
 #define have_cpuid(cpuid_ret) \
         __asm__ __volatile__ ( \
                                  ".align 32               \n" \
@@ -620,6 +660,7 @@
                                  "  popl %%eax            \n" \
                                  : "=m" (cpuid_ret)           \
                                  );
+#endif
 #define prefetch(var) \
        __asm__ __volatile__ ( \
                                 "prefetchnta (%0) \n" \




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to