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] |
you could rename it to something like vecvec_optab_for_tree_code with code like:
switch (code) { case LSHIFT_EXPR: return (TYPE_SATURATING(type)) ? NULL : vashl_optab;
case RSHIFT_EXPR: return TYPE_UNSIGNED (type) ? vlshr_optab : vashr_optab;
case LROTATE_EXPR: return vrotl_optab;
case RROTATE_EXPR: return vrotr_optab;
default: return optab_for_tree_code (code, type); }
Then the caller does not even need to special case shifts/rotates, it can just do:
/* Supportable by target? */ vec_mode = TYPE_MODE (vectype); optab = NULL; if (dt[1] == vect_constant_def || dt[1] == vect_invariant_def) optab = optab_for_tree_code (code, vectype);
/* Or maybe we can use another optab for vector-vector operations? */ if (!optab || optab_handler (optab, vec_mode)->insn_code == CODE_FOR_nothing) optab = vecvec_optab_for_tree_code (code, vectype);
if (!optab) { if (vect_print_dump_info (REPORT_DETAILS)) fprintf (vect_dump, "no optab."); return false; }
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |