2010-04-02 05:13:09 +00:00
|
|
|
/* This testcase is part of GDB, the GNU debugger.
|
|
|
|
|
2012-01-04 08:28:28 +00:00
|
|
|
Copyright 2009-2012 Free Software Foundation, Inc.
|
2010-04-02 05:13:09 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
/* Architecture tests for intel i386 platform. */
|
|
|
|
|
|
|
|
void
|
|
|
|
sse_test (void)
|
|
|
|
{
|
|
|
|
char buf0[] = {0, 1, 2, 3, 4, 5, 6, 7, 8,
|
|
|
|
9, 10, 11, 12, 13, 14, 15};
|
|
|
|
char buf1[] = {16, 17, 18, 19, 20, 21, 22, 23,
|
|
|
|
24, 25, 26, 27, 28, 29, 30, 31};
|
|
|
|
char buf2[] = {32, 33, 34, 35, 36, 37, 38, 39,
|
|
|
|
40, 41, 42, 43, 44, 45, 46, 47};
|
|
|
|
|
|
|
|
asm ("movupd %0, %%xmm0":"=m"(buf0));
|
|
|
|
asm ("movupd %0, %%xmm1":"=m"(buf1));
|
|
|
|
asm ("movupd %0, %%xmm2":"=m"(buf2));
|
|
|
|
|
|
|
|
asm ("addpd %xmm0, %xmm1");
|
|
|
|
asm ("addps %xmm1, %xmm2");
|
|
|
|
asm ("addsd %xmm2, %xmm1");
|
|
|
|
asm ("addss %xmm1, %xmm0");
|
|
|
|
asm ("addsubpd %xmm0, %xmm2");
|
|
|
|
asm ("addsubps %xmm0, %xmm1");
|
|
|
|
asm ("andpd %xmm1, %xmm2");
|
|
|
|
asm ("andps %xmm2, %xmm1");
|
|
|
|
asm ("cmppd $3, %xmm0, %xmm1");
|
|
|
|
asm ("cmpps $4, %xmm1, %xmm2");
|
|
|
|
asm ("cmpsd $5, %xmm2, %xmm1");
|
|
|
|
asm ("cmpss $6, %xmm1, %xmm0");
|
|
|
|
asm ("comisd %xmm0, %xmm2");
|
|
|
|
asm ("comiss %xmm0, %xmm1");
|
|
|
|
asm ("cvtdq2pd %xmm1, %xmm2");
|
|
|
|
asm ("cvtdq2ps %xmm2, %xmm1");
|
|
|
|
asm ("cvtpd2dq %xmm1, %xmm0");
|
|
|
|
asm ("cvtpd2ps %xmm0, %xmm1");
|
|
|
|
asm ("divpd %xmm1, %xmm2");
|
|
|
|
asm ("divps %xmm2, %xmm1");
|
|
|
|
asm ("divsd %xmm1, %xmm0");
|
|
|
|
asm ("divss %xmm0, %xmm2");
|
|
|
|
asm ("mulpd %xmm0, %xmm1");
|
|
|
|
asm ("mulps %xmm1, %xmm2");
|
|
|
|
asm ("mulsd %xmm2, %xmm1");
|
|
|
|
asm ("mulss %xmm1, %xmm0");
|
|
|
|
asm ("orpd %xmm2, %xmm0");
|
|
|
|
asm ("orps %xmm0, %xmm1");
|
|
|
|
asm ("packsswb %xmm0, %xmm2");
|
|
|
|
asm ("packssdw %xmm0, %xmm1");
|
|
|
|
asm ("ucomisd %xmm1, %xmm2");
|
|
|
|
asm ("ucomiss %xmm2, %xmm1");
|
|
|
|
asm ("unpckhpd %xmm1, %xmm0");
|
|
|
|
asm ("unpckhps %xmm2, %xmm0");
|
|
|
|
asm ("xorpd %xmm0, %xmm1");
|
|
|
|
asm ("xorps %xmm1, %xmm2");
|
|
|
|
} /* end sse_test */
|
|
|
|
|
gdb/testsuite/
Support processors without SSSE3.
* gdb.reverse/i386-sse-reverse.c (sse_test): Move pabsb, pabsw and
pabsd into ...
(ssse3_test): ... a new function.
(main): Call ssse3_test.
* gdb.reverse/i386-sse-reverse.exp: New variable end_ssse3_test.
Update expected values everywhere.
(reverse-step to pabsd, verify xmm0 after reverse pabsd)
(verify xmm1 after reverse pabsd, verify xmm2 after reverse pabsd)
(reverse-step to pabsw, verify xmm0 after reverse pabsw)
(verify xmm1 after reverse pabsw, verify xmm2 after reverse pabsw)
(reverse-step to pabsb, verify xmm0 after reverse pabsb)
(verify xmm1 after reverse pabsb, verify xmm2 after reverse pabsb):
Move these tests lower.
(set breakpoint at end of ssse3_test, continue to end of ssse3_test)
(verify xmm0 at end of ssse3_test, verify xmm1 at end of ssse3_test)
(verify xmm2 at end of ssse3_test, continue to end of ssse3_test #2):
New tests.
2012-02-29 14:55:46 +00:00
|
|
|
void
|
|
|
|
ssse3_test (void)
|
|
|
|
{
|
|
|
|
char buf0[] = {0, 1, 2, 3, 4, 5, 6, 7, 8,
|
|
|
|
9, 10, 11, 12, 13, 14, 15};
|
|
|
|
char buf1[] = {16, 17, 18, 19, 20, 21, 22, 23,
|
|
|
|
24, 25, 26, 27, 28, 29, 30, 31};
|
|
|
|
char buf2[] = {32, 33, 34, 35, 36, 37, 38, 39,
|
|
|
|
40, 41, 42, 43, 44, 45, 46, 47};
|
|
|
|
|
|
|
|
asm ("movupd %0, %%xmm0":"=m"(buf0));
|
|
|
|
asm ("movupd %0, %%xmm1":"=m"(buf1));
|
|
|
|
asm ("movupd %0, %%xmm2":"=m"(buf2));
|
|
|
|
|
|
|
|
asm ("pabsb %xmm1, %xmm2");
|
|
|
|
asm ("pabsw %xmm2, %xmm1");
|
|
|
|
asm ("pabsd %xmm1, %xmm0");
|
|
|
|
} /* end ssse3_test */
|
|
|
|
|
2010-04-02 05:13:09 +00:00
|
|
|
void
|
|
|
|
sse4_test (void)
|
|
|
|
{
|
|
|
|
char buf0[] = {0, 1, 2, 3, 4, 5, 6, 7, 8,
|
|
|
|
9, 10, 11, 12, 13, 14, 15};
|
|
|
|
char buf1[] = {16, 17, 18, 19, 20, 21, 22, 23,
|
|
|
|
24, 25, 26, 27, 28, 29, 30, 31};
|
|
|
|
char buf2[] = {32, 33, 34, 35, 36, 37, 38, 39,
|
|
|
|
40, 41, 42, 43, 44, 45, 46, 47};
|
|
|
|
|
|
|
|
asm ("movupd %0, %%xmm0":"=m"(buf0));
|
|
|
|
asm ("movupd %0, %%xmm1":"=m"(buf1));
|
|
|
|
asm ("movupd %0, %%xmm2":"=m"(buf2));
|
|
|
|
|
|
|
|
asm ("blendpd $1, %xmm1, %xmm0");
|
|
|
|
asm ("blendps $2, %xmm2, %xmm0");
|
|
|
|
asm ("blendvpd %xmm0, %xmm1, %xmm2");
|
|
|
|
asm ("blendvps %xmm0, %xmm2, %xmm1");
|
|
|
|
} /* end sse4_test */
|
|
|
|
|
|
|
|
int
|
|
|
|
main ()
|
|
|
|
{
|
|
|
|
sse_test ();
|
gdb/testsuite/
Support processors without SSSE3.
* gdb.reverse/i386-sse-reverse.c (sse_test): Move pabsb, pabsw and
pabsd into ...
(ssse3_test): ... a new function.
(main): Call ssse3_test.
* gdb.reverse/i386-sse-reverse.exp: New variable end_ssse3_test.
Update expected values everywhere.
(reverse-step to pabsd, verify xmm0 after reverse pabsd)
(verify xmm1 after reverse pabsd, verify xmm2 after reverse pabsd)
(reverse-step to pabsw, verify xmm0 after reverse pabsw)
(verify xmm1 after reverse pabsw, verify xmm2 after reverse pabsw)
(reverse-step to pabsb, verify xmm0 after reverse pabsb)
(verify xmm1 after reverse pabsb, verify xmm2 after reverse pabsb):
Move these tests lower.
(set breakpoint at end of ssse3_test, continue to end of ssse3_test)
(verify xmm0 at end of ssse3_test, verify xmm1 at end of ssse3_test)
(verify xmm2 at end of ssse3_test, continue to end of ssse3_test #2):
New tests.
2012-02-29 14:55:46 +00:00
|
|
|
ssse3_test ();
|
2010-04-02 05:13:09 +00:00
|
|
|
sse4_test ();
|
|
|
|
return 0; /* end of main */
|
|
|
|
}
|