1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 14:52:43 +00:00

fix asm constraints, tested on x86 and x86_64.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15809 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-06-23 16:44:52 +00:00
parent 0da3d3fe97
commit afc05ae3f2

40
mmx.h
View File

@ -246,15 +246,15 @@ mmx_ok(void)
printf(#op "_i2r(" #imm "=0x%08x%08x, ", \ printf(#op "_i2r(" #imm "=0x%08x%08x, ", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
__asm__ __volatile__ ("movq %%" #reg ", %0" \ __asm__ __volatile__ ("movq %%" #reg ", %0" \
: "=X" (mmx_trace) \ : "=m" (mmx_trace) \
: /* nothing */ ); \ : /* nothing */ ); \
printf(#reg "=0x%08x%08x) => ", \ printf(#reg "=0x%08x%08x) => ", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
__asm__ __volatile__ (#op " %0, %%" #reg \ __asm__ __volatile__ (#op " %0, %%" #reg \
: /* nothing */ \ : /* nothing */ \
: "X" (imm)); \ : "i" (imm)); \
__asm__ __volatile__ ("movq %%" #reg ", %0" \ __asm__ __volatile__ ("movq %%" #reg ", %0" \
: "=X" (mmx_trace) \ : "=m" (mmx_trace) \
: /* nothing */ ); \ : /* nothing */ ); \
printf(#reg "=0x%08x%08x\n", \ printf(#reg "=0x%08x%08x\n", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
@ -267,7 +267,7 @@ mmx_ok(void)
printf(#op "_m2r(" #mem "=0x%08x%08x, ", \ printf(#op "_m2r(" #mem "=0x%08x%08x, ", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
__asm__ __volatile__ ("movq %%" #reg ", %0" \ __asm__ __volatile__ ("movq %%" #reg ", %0" \
: "=X" (mmx_trace) \ : "=m" (mmx_trace) \
: /* nothing */ ); \ : /* nothing */ ); \
printf(#reg "=0x%08x%08x) => ", \ printf(#reg "=0x%08x%08x) => ", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
@ -275,7 +275,7 @@ mmx_ok(void)
: /* nothing */ \ : /* nothing */ \
: "X" (mem)); \ : "X" (mem)); \
__asm__ __volatile__ ("movq %%" #reg ", %0" \ __asm__ __volatile__ ("movq %%" #reg ", %0" \
: "=X" (mmx_trace) \ : "=m" (mmx_trace) \
: /* nothing */ ); \ : /* nothing */ ); \
printf(#reg "=0x%08x%08x\n", \ printf(#reg "=0x%08x%08x\n", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
@ -285,7 +285,7 @@ mmx_ok(void)
{ \ { \
mmx_t mmx_trace; \ mmx_t mmx_trace; \
__asm__ __volatile__ ("movq %%" #reg ", %0" \ __asm__ __volatile__ ("movq %%" #reg ", %0" \
: "=X" (mmx_trace) \ : "=m" (mmx_trace) \
: /* nothing */ ); \ : /* nothing */ ); \
printf(#op "_r2m(" #reg "=0x%08x%08x, ", \ printf(#op "_r2m(" #reg "=0x%08x%08x, ", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
@ -293,7 +293,7 @@ mmx_ok(void)
printf(#mem "=0x%08x%08x) => ", \ printf(#mem "=0x%08x%08x) => ", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
__asm__ __volatile__ (#op " %%" #reg ", %0" \ __asm__ __volatile__ (#op " %%" #reg ", %0" \
: "=X" (mem) \ : "=m" (mem) \
: /* nothing */ ); \ : /* nothing */ ); \
mmx_trace = (mem); \ mmx_trace = (mem); \
printf(#mem "=0x%08x%08x\n", \ printf(#mem "=0x%08x%08x\n", \
@ -304,18 +304,18 @@ mmx_ok(void)
{ \ { \
mmx_t mmx_trace; \ mmx_t mmx_trace; \
__asm__ __volatile__ ("movq %%" #regs ", %0" \ __asm__ __volatile__ ("movq %%" #regs ", %0" \
: "=X" (mmx_trace) \ : "=m" (mmx_trace) \
: /* nothing */ ); \ : /* nothing */ ); \
printf(#op "_r2r(" #regs "=0x%08x%08x, ", \ printf(#op "_r2r(" #regs "=0x%08x%08x, ", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
__asm__ __volatile__ ("movq %%" #regd ", %0" \ __asm__ __volatile__ ("movq %%" #regd ", %0" \
: "=X" (mmx_trace) \ : "=m" (mmx_trace) \
: /* nothing */ ); \ : /* nothing */ ); \
printf(#regd "=0x%08x%08x) => ", \ printf(#regd "=0x%08x%08x) => ", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
__asm__ __volatile__ (#op " %" #regs ", %" #regd); \ __asm__ __volatile__ (#op " %" #regs ", %" #regd); \
__asm__ __volatile__ ("movq %%" #regd ", %0" \ __asm__ __volatile__ ("movq %%" #regd ", %0" \
: "=X" (mmx_trace) \ : "=m" (mmx_trace) \
: /* nothing */ ); \ : /* nothing */ ); \
printf(#regd "=0x%08x%08x\n", \ printf(#regd "=0x%08x%08x\n", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
@ -333,8 +333,8 @@ mmx_ok(void)
__asm__ __volatile__ ("movq %0, %%mm0\n\t" \ __asm__ __volatile__ ("movq %0, %%mm0\n\t" \
#op " %1, %%mm0\n\t" \ #op " %1, %%mm0\n\t" \
"movq %%mm0, %0" \ "movq %%mm0, %0" \
: "=X" (memd) \ : "=m" (memd) \
: "X" (mems)); \ : "m" (mems)); \
mmx_trace = (memd); \ mmx_trace = (memd); \
printf(#memd "=0x%08x%08x\n", \ printf(#memd "=0x%08x%08x\n", \
mmx_trace.d[1], mmx_trace.d[0]); \ mmx_trace.d[1], mmx_trace.d[0]); \
@ -348,7 +348,7 @@ mmx_ok(void)
#define mmx_i2r(op, imm, reg) \ #define mmx_i2r(op, imm, reg) \
__asm__ __volatile__ (#op " %0, %%" #reg \ __asm__ __volatile__ (#op " %0, %%" #reg \
: /* nothing */ \ : /* nothing */ \
: "X" (imm) ) : "i" (imm) )
#define mmx_m2r(op, mem, reg) \ #define mmx_m2r(op, mem, reg) \
__asm__ __volatile__ (#op " %0, %%" #reg \ __asm__ __volatile__ (#op " %0, %%" #reg \
@ -357,7 +357,7 @@ mmx_ok(void)
#define mmx_r2m(op, reg, mem) \ #define mmx_r2m(op, reg, mem) \
__asm__ __volatile__ (#op " %%" #reg ", %0" \ __asm__ __volatile__ (#op " %%" #reg ", %0" \
: "=X" (mem) \ : "=m" (mem) \
: /* nothing */ ) : /* nothing */ )
#define mmx_r2r(op, regs, regd) \ #define mmx_r2r(op, regs, regd) \
@ -367,8 +367,8 @@ mmx_ok(void)
__asm__ __volatile__ ("movq %0, %%mm0\n\t" \ __asm__ __volatile__ ("movq %0, %%mm0\n\t" \
#op " %1, %%mm0\n\t" \ #op " %1, %%mm0\n\t" \
"movq %%mm0, %0" \ "movq %%mm0, %0" \
: "=X" (memd) \ : "=m" (memd) \
: "X" (mems)) : "m" (mems))
#endif #endif
@ -383,8 +383,8 @@ mmx_ok(void)
#define movq(vars, vard) \ #define movq(vars, vard) \
__asm__ __volatile__ ("movq %1, %%mm0\n\t" \ __asm__ __volatile__ ("movq %1, %%mm0\n\t" \
"movq %%mm0, %0" \ "movq %%mm0, %0" \
: "=X" (vard) \ : "=m" (vard) \
: "X" (vars)) : "m" (vars))
/* 1x32 MOVe Doubleword /* 1x32 MOVe Doubleword
@ -398,8 +398,8 @@ mmx_ok(void)
#define movd(vars, vard) \ #define movd(vars, vard) \
__asm__ __volatile__ ("movd %1, %%mm0\n\t" \ __asm__ __volatile__ ("movd %1, %%mm0\n\t" \
"movd %%mm0, %0" \ "movd %%mm0, %0" \
: "=X" (vard) \ : "=m" (vard) \
: "X" (vars)) : "m" (vars))
/* 2x32, 4x16, and 8x8 Parallel ADDs /* 2x32, 4x16, and 8x8 Parallel ADDs