On Mon, Sep 22, 2014 at 3:26 PM, Alan Lawrence <alan.lawre...@arm.com> wrote: > Richard Biener wrote: >> >> >> scalar_reduc_to_vector misses a comment. > > > Ok to reuse the comment in optabs.h in optabs.c also?
Sure. >> I wonder if at the end we wouldn't transition all backends and then >> renaming reduc_*_scal_optab back to reduc_*_optab makes sense. > > > Yes, that sounds like a plan, the _scal is a bit of a mouthful. > >> The optabs have only one mode - I wouldn't be surprised if an ISA >> invents for example v4si -> di reduction? So do we want to make >> reduc_plus_scal_optab a little bit more future proof (maybe there >> is already an ISA that supports this kind of reduction?). > > > That sounds like a plausible thing for an ISA to do, indeed. However given > these names are only used by the autovectorizer rather than directly, the > question is what the corresponding source code looks like, and/or what > changes to the autovectorizer we might have to make to (look for code to) > exploit such an instruction. Ah, indeed. Would be sth like a REDUC_WIDEN_SUM_EXPR or so. > At this point I could go for a > reduc_{plus,min_max}_scal_<mode><mode> which reduces from the first vector > mode to the second scalar mode, and then make the vectorizer look only for > cases where the second mode was the element type of the first; but I'm not > sure I want to do anything more complicated than that at this stage. > (However, indeed it would leave the possibility open for the future.) Yeah, agreed. For the min/max case a widen variant isn't useful anyway. Thanks, Richard. > --Alan >