[autovect] [patch] Improve generated vector comparisons

David Edelsohn dje@watson.ibm.com
Wed May 24 21:37:00 GMT 2006


	The type of code that you are trying to vectorize creates a
VEC_COND_EXPR.  This is converted to RTL in
gcc/optabs.c:expand_vec_cond_expr(), which invokes a vcondMMMM pattern,
such as vconduv16qi in altivec.md.  For Altivec, those patterns invoke
rs6000.c:rs6000_emit_vector_cond_expr(), which calls
rs6000_emit_vector_compare() and rs6000_emit_vector_select().

	rs6000_emit_vector_compare() is the function that should reverse
the comparison for GE and LE.  It appears to be trying to do something,
but apparently not sufficient.  Also, the algorithm probably should use
gcc/jump.c:reverse_condition().

	The PowerPC port uses reverse_condition in
rs6000.c:rs6000_emit_sCOND() and rs6000.c:rs6000_emit_cmove(), as examples
of how to perform this type of transforarmation.

David



More information about the Gcc-patches mailing list