public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: Ian Lance Taylor <iant@google.com>
Cc: Clem Taylor <clem.taylor@gmail.com>, gcc-help@gcc.gnu.org
Subject: Re: workaround for "error: more than 30 operands in 'asm'"?
Date: Thu, 13 Mar 2008 09:45:00 -0000	[thread overview]
Message-ID: <47D8F7B5.5030306@redhat.com> (raw)
In-Reply-To: <m37ig7w4jl.fsf@google.com>

Ian Lance Taylor wrote:
> "Clem Taylor" <clem.taylor@gmail.com> writes:
> 
>> I'm working on taking PowerPC VMX code that uses altivec intrinsics
>> and rescheduling it with inline assembly. gcc is making some fairly
>> bad scheduling choices in with the code, resulting in code that is
>> running 4x slower then I was hoping for. I have a simplified version
>> working, but with the real version gcc is failing with: "error: more
>> than 30 operands in 'asm'". The code is using 28 vector registers and
>> 6 serial registers.
>>
>> The code is a mixture of setup code in C and only the inner loop is in
>> assembly, so it wouldn't be convenient to write this directly in
>> assembly. Also, because the code is highly pipelined (to overcome the
>> latency of the VMX floating point unit) it is a mess to split this up
>> into multiple asm() statements. Beyond recompiling gcc with a larger
>> operand count, is there a workaround for this problem?
> 
> Use fewer operands?  Otherwise, no.  It's a hard limit in gcc.
> 
> Since you mention the number of registers you are using, note that
> that only matters if they are inputs or outputs.  If you need a
> temporary register, just pick one, and add it the clobber list.  But
> if you really have that many inputs and outputs, then you are stuck.

Isn't this trivially fixed by changing:

  /* Allow at least 30 operands for the sake of asm constructs.  */
  /* ??? We *really* ought to reorganize things such that there
     is no fixed upper bound.  */
  max_recog_operands = 29;  /* We will add 1 later.  */
  max_dup_operands = 1;

in genconfig.c ?

Andrew.

  reply	other threads:[~2008-03-13  9:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-12 23:25 Clem Taylor
2008-03-13  5:56 ` Ian Lance Taylor
2008-03-13  9:45   ` Andrew Haley [this message]
2008-03-13 16:54     ` Ian Lance Taylor
2008-03-14 10:11       ` Andrew Haley
2008-03-14 10:22         ` Segher Boessenkool
2008-03-14 15:13           ` Ian Lance Taylor
2008-03-14 14:10         ` Ian Lance Taylor
2008-03-14  1:10   ` Clem Taylor

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=47D8F7B5.5030306@redhat.com \
    --to=aph@redhat.com \
    --cc=clem.taylor@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=iant@google.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).