[PATCH] Builtin strcpy/strncpy/memcpy/strcmp/fputs fixes and optimizations
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Thu Nov 30 05:35:00 GMT 2000
> From: Richard Henderson <rth@redhat.com>
>
> On Wed, Nov 29, 2000 at 06:29:31PM -0500, Michael Meissner wrote:
> > Assuming you change:
> > strcmp ("constant-string", pointer)
> > into
> > memcmp ("constant-string", pointer, sizeof ("constant-string")-1),
> > what happens if memcmp on the machine is aggresive and reads multiple
> > words at a time to hide the memory latency.
>
> Well, we don't do this transformation in general, only when
> we can inline the memcmp. There are currently only three
> targets that implement cmpstrsi, and none of them do this
> multiple read optimization.
>
> So perhaps we just need to add commentary somewhere...
> r~
Heh, agreed:
http://gcc.gnu.org/ml/gcc-patches/2000-03/msg00789.html
Would you then please reconsider this patch? (It probably needs
updating, but the general concept of strncmp -> expand_builtin_memcmp
is what I'd like approval for.)
http://gcc.gnu.org/ml/gcc-patches/2000-03/msg00746.html
The current builtin strncmp becomes expand_builtin_strcmp if one of
the strings strlen < 'n' ('n' is the length parameter.) That in turn
calls expand_builtin_memcmp. I'd like to have strncmp call
expand_builtin_memcmp directly and use a len parameter clamped at one
of the strings strlen or 'n', which ever is lower.
Thanks,
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions
More information about the Gcc-patches
mailing list