Commit 97ed14aead862362210c0367782274afa0f593b9
1 parent
d52cf7a6
fix shufps/shufpd tests - added maskmov tests
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1225 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
44 additions
and
2 deletions
tests/test-i386.c
... | ... | @@ -1733,6 +1733,22 @@ static uint64_t __attribute__((aligned(16))) test_values[4][2] = { |
1733 | 1733 | SSE_OP2(op);\ |
1734 | 1734 | } |
1735 | 1735 | |
1736 | +#define SHUF_OP(op, ib)\ | |
1737 | +{\ | |
1738 | + int i;\ | |
1739 | + a.q[0] = test_values[0][0];\ | |
1740 | + a.q[1] = test_values[0][1];\ | |
1741 | + b.q[0] = test_values[1][0];\ | |
1742 | + b.q[1] = test_values[1][1];\ | |
1743 | + asm volatile (#op " $" #ib ", %2, %0" : "=x" (r.dq) : "0" (a.dq), "x" (b.dq));\ | |
1744 | + printf("%-9s: a=%016llx%016llx b=%016llx%016llx ib=%02x r=%016llx%016llx\n",\ | |
1745 | + #op,\ | |
1746 | + a.q[1], a.q[0],\ | |
1747 | + b.q[1], b.q[0],\ | |
1748 | + ib,\ | |
1749 | + r.q[1], r.q[0]);\ | |
1750 | +} | |
1751 | + | |
1736 | 1752 | #define PSHUF_OP(op, ib)\ |
1737 | 1753 | {\ |
1738 | 1754 | int i;\ |
... | ... | @@ -2009,6 +2025,32 @@ void test_sse(void) |
2009 | 2025 | asm volatile ("pmovmskb %1, %0" : "=r" (r.l[0]) : "x" (a.dq)); |
2010 | 2026 | printf("%-9s: r=%08x\n", "pmovmskb", r.l[0]); |
2011 | 2027 | |
2028 | + { | |
2029 | + r.q[0] = -1; | |
2030 | + r.q[1] = -1; | |
2031 | + | |
2032 | + a.q[0] = test_values[0][0]; | |
2033 | + a.q[1] = test_values[0][1]; | |
2034 | + b.q[0] = test_values[1][0]; | |
2035 | + b.q[1] = test_values[1][1]; | |
2036 | + asm volatile("maskmovq %1, %0" : | |
2037 | + : "y" (a.q[0]), "y" (b.q[0]), "D" (&r) | |
2038 | + : "memory"); | |
2039 | + printf("%-9s: r=%016llx a=%016llx b=%016llx\n", | |
2040 | + "maskmov", | |
2041 | + r.q[0], | |
2042 | + a.q[0], | |
2043 | + b.q[0]); | |
2044 | + asm volatile("maskmovdqu %1, %0" : | |
2045 | + : "x" (a.dq), "x" (b.dq), "D" (&r) | |
2046 | + : "memory"); | |
2047 | + printf("%-9s: r=%016llx%016llx a=%016llx%016llx b=%016llx%016llx\n", | |
2048 | + "maskmov", | |
2049 | + r.q[1], r.q[0], | |
2050 | + a.q[1], a.q[0], | |
2051 | + b.q[1], b.q[0]); | |
2052 | + } | |
2053 | + | |
2012 | 2054 | asm volatile ("emms"); |
2013 | 2055 | |
2014 | 2056 | SSE_OP2(punpcklqdq); |
... | ... | @@ -2027,8 +2069,8 @@ void test_sse(void) |
2027 | 2069 | SSE_OP2(unpckhps); |
2028 | 2070 | SSE_OP2(unpckhpd); |
2029 | 2071 | |
2030 | - PSHUF_OP(shufps, 0x78); | |
2031 | - PSHUF_OP(shufpd, 0x02); | |
2072 | + SHUF_OP(shufps, 0x78); | |
2073 | + SHUF_OP(shufpd, 0x02); | |
2032 | 2074 | |
2033 | 2075 | PSHUF_OP(pshufd, 0x78); |
2034 | 2076 | PSHUF_OP(pshuflw, 0x78); | ... | ... |