-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update stdsimd #57808
Merged
Merged
Update stdsimd #57808
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
//! These tests just check that the macros are available in libstd. | ||
|
||
#![cfg_attr( | ||
any( | ||
all(target_arch = "arm", any(target_os = "linux", target_os = "android")), | ||
all(target_arch = "aarch64", any(target_os = "linux", target_os = "android")), | ||
all(target_arch = "powerpc", target_os = "linux"), | ||
all(target_arch = "powerpc64", target_os = "linux"), | ||
), | ||
feature(stdsimd) | ||
)] | ||
|
||
#[test] | ||
#[cfg(all(target_arch = "arm", | ||
any(target_os = "linux", target_os = "android")))] | ||
fn arm_linux() { | ||
println!("neon: {}", is_arm_feature_detected!("neon")); | ||
println!("pmull: {}", is_arm_feature_detected!("pmull")); | ||
} | ||
|
||
#[test] | ||
#[cfg(all( | ||
target_arch = "aarch64", | ||
any(target_os = "linux", target_os = "android") | ||
))] | ||
fn aarch64_linux() { | ||
println!("fp: {}", is_aarch64_feature_detected!("fp")); | ||
println!("fp16: {}", is_aarch64_feature_detected!("fp16")); | ||
println!("neon: {}", is_aarch64_feature_detected!("neon")); | ||
println!("asimd: {}", is_aarch64_feature_detected!("asimd")); | ||
println!("sve: {}", is_aarch64_feature_detected!("sve")); | ||
println!("crc: {}", is_aarch64_feature_detected!("crc")); | ||
println!("crypto: {}", is_aarch64_feature_detected!("crypto")); | ||
println!("lse: {}", is_aarch64_feature_detected!("lse")); | ||
println!("rdm: {}", is_aarch64_feature_detected!("rdm")); | ||
println!("rcpc: {}", is_aarch64_feature_detected!("rcpc")); | ||
println!("dotprod: {}", is_aarch64_feature_detected!("dotprod")); | ||
} | ||
|
||
#[test] | ||
#[cfg(all(target_arch = "powerpc", target_os = "linux"))] | ||
fn powerpc_linux() { | ||
println!("altivec: {}", is_powerpc_feature_detected!("altivec")); | ||
println!("vsx: {}", is_powerpc_feature_detected!("vsx")); | ||
println!("power8: {}", is_powerpc_feature_detected!("power8")); | ||
} | ||
|
||
#[test] | ||
#[cfg(all(target_arch = "powerpc64", target_os = "linux"))] | ||
fn powerpc64_linux() { | ||
println!("altivec: {}", is_powerpc64_feature_detected!("altivec")); | ||
println!("vsx: {}", is_powerpc64_feature_detected!("vsx")); | ||
println!("power8: {}", is_powerpc64_feature_detected!("power8")); | ||
} | ||
|
||
#[test] | ||
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] | ||
fn x86_all() { | ||
println!("aes: {:?}", is_x86_feature_detected!("aes")); | ||
println!("pcmulqdq: {:?}", is_x86_feature_detected!("pclmulqdq")); | ||
println!("rdrand: {:?}", is_x86_feature_detected!("rdrand")); | ||
println!("rdseed: {:?}", is_x86_feature_detected!("rdseed")); | ||
println!("tsc: {:?}", is_x86_feature_detected!("tsc")); | ||
println!("mmx: {:?}", is_x86_feature_detected!("mmx")); | ||
println!("sse: {:?}", is_x86_feature_detected!("sse")); | ||
println!("sse2: {:?}", is_x86_feature_detected!("sse2")); | ||
println!("sse3: {:?}", is_x86_feature_detected!("sse3")); | ||
println!("ssse3: {:?}", is_x86_feature_detected!("ssse3")); | ||
println!("sse4.1: {:?}", is_x86_feature_detected!("sse4.1")); | ||
println!("sse4.2: {:?}", is_x86_feature_detected!("sse4.2")); | ||
println!("sse4a: {:?}", is_x86_feature_detected!("sse4a")); | ||
println!("sha: {:?}", is_x86_feature_detected!("sha")); | ||
println!("avx: {:?}", is_x86_feature_detected!("avx")); | ||
println!("avx2: {:?}", is_x86_feature_detected!("avx2")); | ||
println!("avx512f {:?}", is_x86_feature_detected!("avx512f")); | ||
println!("avx512cd {:?}", is_x86_feature_detected!("avx512cd")); | ||
println!("avx512er {:?}", is_x86_feature_detected!("avx512er")); | ||
println!("avx512pf {:?}", is_x86_feature_detected!("avx512pf")); | ||
println!("avx512bw {:?}", is_x86_feature_detected!("avx512bw")); | ||
println!("avx512dq {:?}", is_x86_feature_detected!("avx512dq")); | ||
println!("avx512vl {:?}", is_x86_feature_detected!("avx512vl")); | ||
println!("avx512_ifma {:?}", is_x86_feature_detected!("avx512ifma")); | ||
println!("avx512_vbmi {:?}", is_x86_feature_detected!("avx512vbmi")); | ||
println!( | ||
"avx512_vpopcntdq {:?}", | ||
is_x86_feature_detected!("avx512vpopcntdq") | ||
); | ||
println!("fma: {:?}", is_x86_feature_detected!("fma")); | ||
println!("bmi1: {:?}", is_x86_feature_detected!("bmi1")); | ||
println!("bmi2: {:?}", is_x86_feature_detected!("bmi2")); | ||
println!("abm: {:?}", is_x86_feature_detected!("abm")); | ||
println!("lzcnt: {:?}", is_x86_feature_detected!("lzcnt")); | ||
println!("tbm: {:?}", is_x86_feature_detected!("tbm")); | ||
println!("popcnt: {:?}", is_x86_feature_detected!("popcnt")); | ||
println!("fxsr: {:?}", is_x86_feature_detected!("fxsr")); | ||
println!("xsave: {:?}", is_x86_feature_detected!("xsave")); | ||
println!("xsaveopt: {:?}", is_x86_feature_detected!("xsaveopt")); | ||
println!("xsaves: {:?}", is_x86_feature_detected!("xsaves")); | ||
println!("xsavec: {:?}", is_x86_feature_detected!("xsavec")); | ||
} |
Submodule stdsimd
updated
from 269d0b to b23541
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the largest change here. Instead of re-compiling core::arch again and including it two times, one in std and one in core, this PR changes libstd to re-export the intrinsics from core directly.