Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Hui Zhu <teawater@gmail.com>
Cc: Joel Brobecker <brobecker@adacore.com>,
	  gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [RFA/i386] Prec x86 MMX 3DNow! SSE SSE2 SSE3 SSSE3 SSE4 support
Date: Mon, 29 Mar 2010 18:11:00 -0000	[thread overview]
Message-ID: <4BB0ED42.70106@vmware.com> (raw)
In-Reply-To: <daef60381003290620j6a563a26y7d041209741843fa@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

Hui Zhu wrote:
> Hi Michael,
> 
> I make a new testsuite that can support sse and sse4 better.
> 
> When the pc doesn't support sse4 insn, the test will skip the sse4 insn test.
> 
> Please help me review it.

Hui,

I found out that older versions of GAS require three arguments for 
blendvps and blendvpd -- and the first argument must be %xmm0.

Try this on your machine:


[-- Attachment #2: i386-sse-reverse.c --]
[-- Type: text/x-csrc, Size: 3172 bytes --]

/* This testcase is part of GDB, the GNU debugger.

   Copyright 2009, 2010 Free Software Foundation, Inc.

   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 ("pabsb %xmm1, %xmm2");
  asm ("pabsw %xmm2, %xmm1");
  asm ("pabsd %xmm1, %xmm0");
  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 */

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 ();
  sse4_test ();
  return 0;	/* end of main */
}

  parent reply	other threads:[~2010-03-29 18:11 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07 15:00 [RFA] " Hui Zhu
2009-12-07 16:54 ` Michael Snyder
2009-12-07 17:16 ` Michael Snyder
2009-12-07 17:43   ` Joel Brobecker
2009-12-07 17:54     ` Michael Snyder
2009-12-07 18:00       ` Joel Brobecker
2009-12-07 18:05         ` Michael Snyder
2009-12-08  5:51           ` Hui Zhu
2009-12-08 19:56             ` Michael Snyder
2009-12-07 18:08         ` Doug Evans
2009-12-08 17:43         ` Tom Tromey
2009-12-10 19:52 ` Michael Snyder
2009-12-11 15:00   ` Hui Zhu
2009-12-13  4:28     ` Hui Zhu
2009-12-13 10:35       ` Hui Zhu
2009-12-14 18:24       ` Michael Snyder
2009-12-15  1:47         ` Hui Zhu
2009-12-18 19:44           ` Michael Snyder
2010-01-08 16:07             ` Hui Zhu
2010-01-08 18:45               ` Michael Snyder
2010-01-09 12:28               ` [RFA/i386] " Joel Brobecker
2010-01-11  2:48                 ` Hui Zhu
2010-01-11  4:05                   ` Joel Brobecker
2010-01-12  1:38                   ` Michael Snyder
2010-03-28 16:27                     ` Hui Zhu
2010-03-29  1:35                       ` Michael Snyder
2010-03-29  1:36                       ` Michael Snyder
2010-03-29  9:25                         ` Hui Zhu
2010-03-29  1:40                       ` Michael Snyder
2010-03-29  2:23                         ` Hui Zhu
2010-03-29 13:21                           ` Hui Zhu
2010-03-29 17:52                             ` Michael Snyder
2010-03-29 18:11                             ` Michael Snyder [this message]
2010-03-30  6:29                               ` Hui Zhu
2010-03-30 12:55                                 ` Hui Zhu
2010-04-01 15:36                                   ` Hui Zhu
2010-04-01 21:50                                     ` Michael Snyder
2010-04-02  5:14                                       ` Hui Zhu
2010-03-29  2:18                       ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BB0ED42.70106@vmware.com \
    --to=msnyder@vmware.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=teawater@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox