According to the gcc docs, memcmp is not an intrinsic function of GCC. If you wanted to speed up glibc\'s memcmp under gcc, you would need to use the lower level intrinsics
Note that the repz cmpsb routine might not be faster than glibc's memcmp. In my tests, in fact, it's never faster, even when comparing just a few bytes.
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052