On Fri, 2016-11-04 at 20:43 -0600, Jeff Law wrote:
> So what's the motivation here?  When we don't have any constants
> then 
> I'd think we'd be better off punting into the library.

When none of the args to strncmp are constant, I'd be inclined to
agree. However the current state of affairs is that strncmp is not
expanded in the case where the length is a constant but the strings are
not. This patch allows the expansion to be attempted.

The target's cmpstrnsi pattern can then make the decision of which
cases to expand and which cases to punt to the library. For instance RX
might always want to expand this for all cases as that target has an
instruction that is intended to map to strncmp.

My particular motivation is that I'm working on a cmpstrnsi pattern for
powerpc64 and I want to have access to the case where the strings are
not constant but the length is.

Thanks,
   Aaron

-- 
Aaron Sawdey, Ph.D.  acsaw...@linux.vnet.ibm.com
050-2/C113  (507) 253-7520 home: 507/263-0782
IBM Linux Technology Center - PPC Toolchain

Reply via email to