rust-lang / rust-lang/stdarch

Allow multiple target features in is_target_feature_detected

Open
#348 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-runtime-detection
Dominant language
Rust
Stars
694
Forks
336
Avg merge
5d 14h
Merged PRs (30d)
9

Description

We should support:

is_target_feature_detected!("avx2,sse4.2,lzcnt,popcnt")

so that users don't need to write

is_target_feature_detected!("avx2") && 
is_target_feature_detected!("sse4.2") && 
is_target_feature_detected!("lzcnt") &&
is_target_feature_detected!("popcnt")

cc @cocalus

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

Locate the definition and existing tests for is_target_feature_detected! and inspect how a single feature string is parsed. Done means the comma-separated example works as one check while preserving the existing single-feature behavior, with tests covering both forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.