Until you use a different compiler/CPU and end up with the equivalent of:
if (a[i] == b[i])
rv |= 1;
And suddenly you have data dependent branches again. That’s very unlikely, but since the point of the exercise is to avoid branching instructions, best to avoid potentially branching operators entirely.
!= is probably the wrong operator in bcmp. Most implementations use xor.
Using xor is just a tiny optimization (makes it 3 bytes smaller and, in theory, saves a clock cycle per iteration):
Until you use a different compiler/CPU and end up with the equivalent of:
And suddenly you have data dependent branches again. That’s very unlikely, but since the point of the exercise is to avoid branching instructions, best to avoid potentially branching operators entirely.