> The question is really whether xor or sub is "better" statically. I can't > think of any reasons. On s390, why does xor end up "better"?
There is an xor with immediate (as opposed to no "subtract from immediate") which saves an instruction, usually. On x86, I think the usual argument for xor is that it's shorter (if flags etc. are not needed). It's not that I don't want to implement it in the backend, just that I understood the original PR in a way that it would make sense to have this conversion available for more targets. If there are too many confounding factors that prevent this situation from being statically costed properly, then sure, not much use in implementing it generally. Regards Robin