public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michel LESPINASSE <walken@zoy.org>
To: gcc@gcc.gnu.org
Subject: altivec support in gcc
Date: Tue, 08 Apr 2003 10:10:00 -0000	[thread overview]
Message-ID: <20030408085330.GC20370@zoy.org> (raw)

Hi,

I have a few questions about the altivec support in gcc...

First, is there any reason why altivec.h defines the second argument
in vec_ld as being a vector pointer instead of a const vector pointer ?
This is causing me no ends of trouble.

Second, I have not tried gcc 3.3 yet, but gcc 3.2 has a lot of trouble
compiling the following construct... it does compile it eventually,
but it requires hundreds of megabytes of virtual memory for doing
it...

(This code is meant as a shortcut for calculating (A+B+C+D+2)>>2, for
a vector of 16 unsigned char values. This is used in the motion
compensation loop of an mpeg2 decoder.)

    ones = vec_splat_u8 (1);
    avg0 = vec_avg (A, B);
    xor0 = vec_xor (A, B);
    avg1 = vec_avg (C, D);
    xor1 = vec_xor (C, D);
    tmp = vec_and (vec_and (ones, vec_or (xor0, xor1)),
                   vec_xor (avg0, avg1));
    out = vec_sub (vec_avg (avg0, avg1), tmp);

Initially I had only one out= assignment, i.e. I had put the tmp
expression in place of the tmp variable in the current out
assignment. I could not even get that code to compile, it made gcc
inflate to over 700 MB. After splitting it as shown above, the code
does compile fine, but GCC still inflates to over 300 MB compiling it.

This is on a debian/sid system, the gcc -v version indicates:
gcc -v
Reading specs from /usr/lib/gcc-lib/powerpc-linux/3.2.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc powerpc-linux
Thread model: posix
gcc version 3.2.3 20030316 (Debian prerelease)

It's probably not a critical bug as it can be worked around by
splitting expressions in smaller pieces, but I thought it should be
signaled as it makes some code extremely slow to compile. For
information, the same code used to compile just fine with apple's old
altivec-patched gcc 2.95.x compiler.

Hope this helps,

-- 
Michel "Walken" LESPINASSE
"In this time of war against Osama bin Laden and the oppressive
Taliban regime, we are thankful that OUR leader isn't the spoiled son
of a powerful politician from a wealthy oil family who is supported by
religious fundamentalists, operates through clandestine organizations,
has no respect for the democratic electoral process, bombs innocents,
and uses war to deny people their civil liberties." --The Boondocks

             reply	other threads:[~2003-04-08  8:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-08 10:10 Michel LESPINASSE [this message]
2003-04-09 16:57 ` Aldy Hernandez
2003-04-09 22:55   ` Michel LESPINASSE
2003-04-21 13:30     ` altivec support in gcc - bug with vec_mergel Michel LESPINASSE
2003-04-22 15:11       ` Daniel Egger
2003-04-22 16:43         ` Michel LESPINASSE
2003-04-22 19:55           ` Daniel Egger
2003-04-22 21:40             ` Aldy Hernandez
  -- strict thread matches above, loose matches on Subject: below --
2000-02-18 18:47 AltiVec support in GCC Mike Stump
2000-02-19 15:03 ` Geoff Keating
2000-02-18 17:13 Mike Stump
2000-02-18 18:04 ` Stan Shebs
2000-02-20 10:56 ` Richard Henderson
2000-02-17 20:30 Kumar Gala

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=20030408085330.GC20370@zoy.org \
    --to=walken@zoy.org \
    --cc=gcc@gcc.gnu.org \
    /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).