This is the mail archive of the gcc@gcc.gnu.org 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]

Re: issues with rtl vector operators



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.


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