Assuming that the code
s1i == s2[j] ? 0 : 1
does give you a branching operation, which you really want to avoid, you could simply attempt the following:
!(s1i == s2[j])
This should give the same effect, and may help the compiler remove the branching. Or, you could reverse the logic and write
s1i != s2[j]
As always with this type of optimizations, there is never a guarantee that this will actually achieve the results you hope for. Optimizers do very many clever things and trying to predict how they will react to your tricks is very often difficult. So, even in the best case, all you can do is attempt different solutions and compare the resulting binary code.