Re: Implement memcmp function with help from gcc's inline asm




"Netocrat" wrote:

For reference, here is the final version of my code. Note that I have re-arranged the tests so the test for equality comes first - this optimises ever so slightly for long bits of equal memory but the performance gain whilst slight is measurable.


There is no need for bswap when testing for equality. The expression (bswap(*ua) == bswap(*ub)) gives the same result as (*ua == *ub).

J.

.