‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Thursday, February 27, 2020 9:52 AM, Jakub Jelinek <ja...@redhat.com> wrote:
> On Thu, Feb 27, 2020 at 08:47:19AM -0600, Bill Schmidt wrote: > > > But is this actually a good idea? It seems to me this will generate lousy > > code in the absence of hardware support. Won't we be better off warning and > > ignoring the directive, leaving the code in scalar form? > > Depends on the exact code, I think sometimes it will be just fine and will > allow vectorizing something that really couldn't be otherwise. > Isn't it better to leave it for the user to decide? > They can always ask for it not to be generated (add notinbranch) if it isn't > worthwhile. > I'm trying to understand what the x86_64 implementation does w.r.t. masked versions of user defined functions. I haven't found any test under directory testsuite which verifies that compiler-generated versions (from inbranch being specified) produce expected results. Which raises the question: what use-case motivated allowing the compiler to auto-vectorize user defined functions? From having manually created vector versions of sin, cos and other libmvec functions, I'm wondering how GCC is able to autovectorize a non-trivial user defined function. Any pointers to relevant tests and documentation will be really appreciated. Thanks. Bert.