On Tue, 29 Apr 2025 at 12:13, Andrew Cooper <andrew.coop...@citrix.com> wrote: > > That would improve code generation for 32bit, but generally regress 64bit. > > Preloading the destination register with -1 is better than the CMOV form > emitted by the builtin; BSF's habit of conditionally not writing the > destination register *is* a CMOV of sorts.
Right you are. So we'd need to do this just for the x86-32 case. Oh well. Ugly, but still prettier than what we have now, I guess. Linus