This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: workaround for "error: more than 30 operands in 'asm'"?
- From: Ian Lance Taylor <iant at google dot com>
- To: "Clem Taylor" <clem dot taylor at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 12 Mar 2008 22:56:14 -0700
- Subject: Re: workaround for "error: more than 30 operands in 'asm'"?
- References: <ecb4efd10803121625h60713dcck5d76d93d189ab3f2@mail.gmail.com>
"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.
Ian