export fn foo(x: u8) u32 {
return @ctz(x >> 1);
}
foo:
shr dil
movzx eax, dil
or eax, 256
tzcnt eax, eax
ret
Could be:
foo:
shr dil
or edi, 256
tzcnt eax, edi
ret
The compiler could also look for things like or eax, -256 and eliminate movzx eax, al since the relevant bits are overwritten anyway.