Skip to content

WIP: Allow ctz and clz in user-written cmm

Andrew Martin requested to merge andrewthad/ghc:cmm_parse_ctz_clz into master

Issue #17651 discusses in poor code generation with the callish mach ops for CLZ and CTZ. I'm trying to work around this problem for now by hand-writing the cmm I'd like to see. However, I've run into a different problem: the cmm parser doesn't let you write prim %ctz64 or prim %clz64 (for 64, 32, 16, or 8). This MR makes the cmm parser accept these constructs.

Also, it would be really nice if this could make it into 8.10. I know we're past the cut off, but it's a very non-invasive change that cannot regress anything. Let me know if it's possible for this to happen.

Edited by Ben Gamari

Merge request reports