This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

altivec support in gcc - bug with vec_mergel


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

#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

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.


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]