public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Palao <david.palao@uv.es>
To: Thorsten Reinecke <thre@thorstenreinecke.de>
Cc: gcc-help@gcc.gnu.org
Subject: Re: problems with gcc inline assembly using xmm registers
Date: Fri, 03 Dec 2004 17:42:00 -0000	[thread overview]
Message-ID: <200412031841.20752.david.palao@uv.es> (raw)
In-Reply-To: <Pine.LNX.4.61.0412031705390.2211@tripper.tr69.homelinux.net>

Thank you for the answer!

>
> I had some trouble using mmx and xmm registers, too. But my code works
> now. See the attached code snippet. You can get an idea of how to use the
> input list, output list and clobber list and also how to share xmm
> registers between different asm inline blocks.
>

I will read it, but it looks hardcore to me (as I'm new in assembly)


> You use only memory operands, so this shouldn't be a problem. But you
> haven't declared any output. You're clobbering xmm registers, but you
> don't tell the compiler that you do so. Maybe that's the problem.

What's the problem if I don't need output operands?

Concerning to clobbering part; well, I have tried clobbering xmm registers as 
well (I hope I did it right). For instance:

__asm__ __volatile__ ("movsd %0, %%xmm3 \n\t" \
      "movsd %1, %%xmm6 \n\t" \
      "movsd %2, %%xmm4 \n\t" \
      "movsd %3, %%xmm7 \n\t" \
      "movsd %4, %%xmm5 \n\t" \
      "unpcklpd %%xmm3, %%xmm3 \n\t" \
      "unpcklpd %%xmm6, %%xmm6 \n\t" \
      "unpcklpd %%xmm4, %%xmm4 \n\t" \
      "mulpd %%xmm0, %%xmm3 \n\t" \
      "unpcklpd %%xmm7, %%xmm7 \n\t" \
      "mulpd %%xmm1, %%xmm6 \n\t" \
      "unpcklpd %%xmm5, %%xmm5 \n\t" \
      "mulpd %%xmm0, %%xmm4 \n\t" \
      "addpd %%xmm6, %%xmm3 \n\t" \
      "mulpd %%xmm2, %%xmm7 \n\t" \
      "mulpd %%xmm0, %%xmm5 \n\t" \
      "addpd %%xmm7, %%xmm4 \n\t" \
      "movsd %5, %%xmm6 \n\t" \
      "movsd %6, %%xmm7 \n\t" \
      "unpcklpd %%xmm6, %%xmm6 \n\t" \
      "unpcklpd %%xmm7, %%xmm7 \n\t" \
      "mulpd %%xmm1, %%xmm6 \n\t" \
      "mulpd %%xmm2, %%xmm7 \n\t" \
      "addpd %%xmm6, %%xmm5 \n\t" \
      "addpd %%xmm7, %%xmm3 \n\t" \
      "movsd %7, %%xmm6 \n\t" \
      "movsd %8, %%xmm7 \n\t" \
      "unpcklpd %%xmm6, %%xmm6 \n\t" \
      "unpcklpd %%xmm7, %%xmm7 \n\t" \
      "mulpd %%xmm1, %%xmm6 \n\t" \
      "mulpd %%xmm2, %%xmm7 \n\t" \
      "addpd %%xmm6, %%xmm4 \n\t" \
      "addpd %%xmm7, %%xmm5" \
      : \
      : \
      "m" ((u).c11.real()), \
      "m" ((u).c12.real()), \
      "m" ((u).c21.real()), \
      "m" ((u).c23.real()), \
      "m" ((u).c31.real()), \
      "m" ((u).c32.real()), \
      "m" ((u).c13.real()), \
      "m" ((u).c22.real()), \
      "m" ((u).c33.real())  \
: \
"%xmm0", \
"%xmm1", \
"%xmm2", \
"%xmm3", \
"%xmm4", \
"%xmm5", \
"%xmm6", \
"%xmm7" );

BUT it doesn't work either way (with/without clobbering list).
Any idea???

Regards

David

      parent reply	other threads:[~2004-12-03 17:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-03 15:29 David Palao
2004-12-03 16:37 ` Nathan Sidwell
2004-12-03 17:15   ` David Palao
2004-12-03 17:23     ` Nathan Sidwell
     [not found] ` <Pine.LNX.4.61.0412031705390.2211@tripper.tr69.homelinux.net>
2004-12-03 17:42   ` David Palao [this message]

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=200412031841.20752.david.palao@uv.es \
    --to=david.palao@uv.es \
    --cc=gcc-help@gcc.gnu.org \
    --cc=thre@thorstenreinecke.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).