microsoft / microsoft/STL

`<bit>`: Should emit rbit, clz on ARM64 for `countr_zero`

Open
#926 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ARM64 performance
Dominant language
C++
Stars
11.2k
Forks
1.7k
Avg merge
4d 15h
Merged PRs (30d)
22

Description

Right now countr_zero falls back to software on arm, this could be improved to emit rbit followed by clz. (alternatively countr_zero_fallback could call countl_zero instead of _Countl_zero_fallback see https://github.com/microsoft/STL/pull/795#discussion_r445676597 for more details.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the implementation for countr_zero and trace its ARM fallback path. Compare the existing fallback with the linked discussion about calling countl_zero, and verify the intended ARM64 instruction sequence is rbit followed by clz. Done means countr_zero no longer uses the software fallback on ARM64 and the relevant tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.