public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* altivec support in gcc
@ 2003-04-08 10:10 Michel LESPINASSE
  2003-04-09 16:57 ` Aldy Hernandez
  0 siblings, 1 reply; 8+ messages in thread
From: Michel LESPINASSE @ 2003-04-08 10:10 UTC (permalink / raw)
  To: gcc

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-04-22 19:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-08 10:10 altivec support in gcc Michel LESPINASSE
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

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).