This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: issues with rtl vector operators
- From: Devang Patel <dpatel at apple dot com>
- To: James E Wilson <wilson at specifixinc dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 18 Aug 2004 12:01:35 -0700
- Subject: Re: issues with rtl vector operators
- References: <1092099404.14558.175.camel@aretha.corp.specifixinc.com>
On Aug 9, 2004, at 5:56 PM, James E Wilson wrote:
Now look at the altivec_vmrghw pattern in the rs6000/altivec.md file.
The Altivec PEM says that given two inputs "ABCD" and "WXYZ" the result
is "AWBX" The altivec pattern is
(vec_merge:V4SI
(vec_select:V4SI (match_operand...) [2 3 0 1])
(match_operand...)
(const_int 12))
The vec_select rewrites the "ABCD" as "CDAB". So we are then doing a
vector merge of "CDAB" "WXYZ" 1100 which should be "CDYZ"
vector merge of "CDAB" "WXYZ" 1100 should be WXAB. But I still don't
understand how it gets the right answer, that is "AWBX".
I tried following,
#include <altivec.h>
vector int a1 = { 100, 200, 300, 400};
vector int a2 = { 500, 600, 700, 800};
vector int k;
int main()
{
int i;
k = vec_mergeh (a1, a2);
}
And it does the right thing, means k is assigned {100, 500, 200, 600}.
thoughts?
-
Devang
which has
nothing in common with the result that the hardware delivers. I don't
know what the Altivec port is doing here. I think it is just broken.