Skip to content

Instantly share code, notes, and snippets.

@gmanley
Created September 7, 2010 02:47
Show Gist options
  • Save gmanley/567791 to your computer and use it in GitHub Desktop.
Save gmanley/567791 to your computer and use it in GitHub Desktop.
--- mmx.h 2004/12/21 05:08:03 1.3
+++ mmx.h 2006/03/07 05:54:48 1.4
@@ -272,15 +272,15 @@
fprintf(stderr, #op "_m2r(" #mem "=0x%08x%08x, ", \
mmx_trace.d[1], mmx_trace.d[0]); \
__asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
+ : "=m" (mmx_trace) \
: /* nothing */ ); \
fprintf(stderr, #reg "=0x%08x%08x) => ", \
mmx_trace.d[1], mmx_trace.d[0]); \
__asm__ __volatile__ (#op " %0, %%" #reg \
: /* nothing */ \
- : "X" (mem)); \
+ : "m" (mem)); \
__asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
+ : "=m" (mmx_trace) \
: /* nothing */ ); \
fprintf(stderr, #reg "=0x%08x%08x\n", \
mmx_trace.d[1], mmx_trace.d[0]); \
@@ -290,7 +290,7 @@
{ \
mmx_t mmx_trace; \
__asm__ __volatile__ ("movq %%" #reg ", %0" \
- : "=X" (mmx_trace) \
+ : "=m" (mmx_trace) \
: /* nothing */ ); \
fprintf(stderr, #op "_r2m(" #reg "=0x%08x%08x, ", \
mmx_trace.d[1], mmx_trace.d[0]); \
@@ -298,7 +298,7 @@
fprintf(stderr, #mem "=0x%08x%08x) => ", \
mmx_trace.d[1], mmx_trace.d[0]); \
__asm__ __volatile__ (#op " %%" #reg ", %0" \
- : "=X" (mem) \
+ : "=m" (mem) \
: /* nothing */ ); \
mmx_trace = (mem); \
fprintf(stderr, #mem "=0x%08x%08x\n", \
@@ -338,8 +338,8 @@
__asm__ __volatile__ ("movq %0, %%mm0\n\t" \
#op " %1, %%mm0\n\t" \
"movq %%mm0, %0" \
- : "=X" (memd) \
- : "X" (mems)); \
+ : "=m" (memd) \
+ : "m" (mems)); \
mmx_trace = (memd); \
fprintf(stderr, #memd "=0x%08x%08x\n", \
mmx_trace.d[1], mmx_trace.d[0]); \
@@ -353,16 +353,16 @@
#define mmx_i2r(op, imm, reg) \
__asm__ __volatile__ (#op " %0, %%" #reg \
: /* nothing */ \
- : "X" (imm) )
+ : "i" (imm) )
#define mmx_m2r(op, mem, reg) \
__asm__ __volatile__ (#op " %0, %%" #reg \
: /* nothing */ \
- : "X" (mem))
+ : "m" (mem))
#define mmx_r2m(op, reg, mem) \
__asm__ __volatile__ (#op " %%" #reg ", %0" \
- : "=X" (mem) \
+ : "=m" (mem) \
: /* nothing */ )
#define mmx_r2r(op, regs, regd) \
@@ -372,8 +372,8 @@
__asm__ __volatile__ ("movq %0, %%mm0\n\t" \
#op " %1, %%mm0\n\t" \
"movq %%mm0, %0" \
- : "=X" (memd) \
- : "X" (mems))
+ : "=m" (memd) \
+ : "m" (mems))
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment