public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michel LESPINASSE <walken@zoy.org>
To: Aldy Hernandez <aldyh@redhat.com>
Cc: gcc@gcc.gnu.org
Subject: altivec support in gcc - bug with vec_mergel
Date: Mon, 21 Apr 2003 13:30:00 -0000	[thread overview]
Message-ID: <20030421030614.GB1304@zoy.org> (raw)
In-Reply-To: <20030409221337.GA29531@zoy.org>

Hi,

I have some code that compiles and works fine in apple's version of
gcc 3.1 (as used in darwin) but fails to work when compiled with FSF
gcc 3.2. Looking at the issue, I think it's due to vec_mergel being
miscompiled into vmrghh instead of vmrglh. Basically gcc miscompiles
vec_mergel to do what vec_mergeh should be doing !

The following allows me to work around the issue by using vec_perm to
do the same work, but I think you'll agree that this should not be
necessary:

#if 1	/* work around gcc vec_mergel bug */
static inline vector_s16_t my_vec_mergel (vector_s16_t const A,
					  vector_s16_t const B)
{
    static const vector_u8_t mergel = {
	0x08, 0x09, 0x18, 0x19, 0x0a, 0x0b, 0x1a, 0x1b,
	0x0c, 0x0d, 0x1c, 0x1d, 0x0e, 0x0f, 0x1e, 0x1f
    };
    return vec_perm (A, B, mergel);
}
#undef vec_mergel
#define vec_mergel my_vec_mergel
#endif

Can you double check the issue and see if you can reproduce it locally ?
I'm guessing it's probably a cut and paste error in gcc, but I couldnt
be sure... I did look at the altivec.h file though, and I think the
error is not there.

Cheers,

-- 
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-21  3:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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     ` Michel LESPINASSE [this message]
2003-04-22 15:11       ` altivec support in gcc - bug with vec_mergel Daniel Egger
2003-04-22 16:43         ` Michel LESPINASSE
2003-04-22 19:55           ` Daniel Egger
2003-04-22 21:40             ` Aldy Hernandez

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=20030421030614.GB1304@zoy.org \
    --to=walken@zoy.org \
    --cc=aldyh@redhat.com \
    --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).