This is the mail archive of the
mailing list for the GCC project.
Re: k-byte memset/memcpy/strlen builtins
On Thu, Jan 12, 2017 at 9:26 AM, Robin Dapp <firstname.lastname@example.org> wrote:
>> Yes, for memset with larger element we could add an optab plus
>> internal function combination and use that when the target wants. Or
>> always use such IFN and fall back to loopy expansion.
> So, adding additional patterns in tree-loop-distribute.c (and mapping
> them to dedicated optabs) is fine? Or does the yes refer to the
> "else"/"or" part of my question (how would the backend recognize the
> patterns then)?
Yes, enhancing tree-loop-distribution.c with extra patterns is fine (hey, there
were supposed to be patterns for all of lapack & friends ... ;))
The question is only whether loop-distribution should always create the IFN
or just if the backend has an optab so expansion is trivial (rather than
needing to re-build a loop doing the operation).
>> I'd say a multibyte memchr might make sense, but strlen specifically?
>> Not sure.
> ok, memchr would also work for the snippet I have in mind.