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

[PATCH] Add Shift operation for vector types


Hi,
  The Cell C/C++ Language extension document includes a shift
operations for vector types.  These operators take an integer vector
type and does an element by element shift, just like what is done for
addition and subtraction.

This patch was originally done by Trevor Smigiel with some changes and
the documentation and the testcases written by me.

OK? Bootstrapped and tested on i386-darwin.

Thanks,
Andrew Pinski

ChangeLog:
* doc/extend.texi (Vector Extensions): Document shifts work now.
* c-typeck.c (build_binary_op): Allow vector types for RSHIFT_EXPR and
LSHIFT_EXPR.

testsuite/ChangeLog:
* gcc.c-torture/execute/vector-shift.c: New test.
* g++.dg/torture/vector-shift.C: New test.

cp/ChangeLog:
* typeck.c (cp_build_binary_op): Allow vector types for RSHIFT_EXPR
and LSHIFT_EXPR.

Attachment: addvectorshift.diff.txt
Description: Text document


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