memcmp-sse4.S EqualHappy bug

Andrea Arcangeli aarcange@redhat.com
Thu Jun 18 17:49:00 GMT 2015


On Thu, Jun 18, 2015 at 06:19:43PM +0200, Andrea Arcangeli wrote:
> workload.  That it can only return non zero is defined by the hardware
> and trivial to enforce in the workload of my testcase.

Instead of thinking in hardware terms, our colleague David (CC'ed)
suggested we can explain why there is a problem in C terms as well.

While the compiler would be free to reorder the load/stores if you
wrote the memcmp in C, and it would be free to duplicate a read, it
would never be free to terminate the comparison loop due any equal
result.



More information about the Libc-alpha mailing list