Open am11 opened 3 months ago
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.
The codegens with zero extensions are common, remember C# doesn't have the operators defined for less than Int32, there's always been binary promotion to 32bit number, hence why you get setl
on the promoted numbers.
On that note, however, what you really want is actually instead of the setb al
-> movzx rax, al
(which really should be movzx eax, al
at least - and I've just checked, JIT does generate properly movzx eax, al
for me in those cases? + on SharpLab)
xor eax, eax
<compare>
setb al
That means you'd have to use r8d
f.e. for extension in this case, which are two REX prefixes sure but it would work out for the better in the case of no inlining — but that's very specific.
For < 32-bit values (
byte
andushort
), there seems to be redundant moves in codegen:gives:
Expected