> Yeah. Like Tami says, this is what the instruction does. > > I think all three definitions are equivalent: the extend/operate/truncate > one, the ?: one above, and the "max - min" one. Probably just personal > preference as to which seems more natural.
Decided to switch to using the ?: one as it makes more sense for unsigned types. > It would be good to document what the parameters mean (except VINFO, > which is obvious). Documentation added for vect_recog_absolute_difference. > I think this should instead be: > > if (TYPE_PRECISION (unprom_diff.type) != TYPE_PRECISION (abs_type) > && TYPE_UNSIGNED (unprom_diff.type) > && TYPE_UNSIGNED (abs_type)) > return false; > > .... > > I think the code would be easier to follow if it used vect_widened_op_tree > first, and only considered the unextended case on failure. Implemented Richard's suggested changes to vect_recog_absolute_difference. > Minor formatting nit: GCC style is to indent braces by two spaces > further than an "if": > > if (...) > { > ... > } Adopted this style. New patch will be in the reply.