Skip to content
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

Remove usage of platform-intrinsics where unadjusted works #630

Merged
merged 1 commit into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion coresimd/x86/rdrand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
//! on-chip hardware random number generator which has been seeded by an
//! on-chip entropy source.

extern "platform-intrinsic" {
#[allow(improper_ctypes)]
extern "unadjusted" {
#[link_name = "llvm.x86.rdrand.16"]
fn x86_rdrand16_step() -> (u16, i32);
#[link_name = "llvm.x86.rdrand.32"]
fn x86_rdrand32_step() -> (u32, i32);
#[link_name = "llvm.x86.rdseed.16"]
fn x86_rdseed16_step() -> (u16, i32);
#[link_name = "llvm.x86.rdseed.32"]
fn x86_rdseed32_step() -> (u32, i32);
}

Expand Down
5 changes: 4 additions & 1 deletion coresimd/x86_64/rdrand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
//! on-chip hardware random number generator which has been seeded by an
//! on-chip entropy source.

extern "platform-intrinsic" {
#[allow(improper_ctypes)]
extern "unadjusted" {
#[link_name = "llvm.x86.rdrand.64"]
fn x86_rdrand64_step() -> (u64, i32);
#[link_name = "llvm.x86.rdseed.64"]
fn x86_rdseed64_step() -> (u64, i32);
}

Expand Down
3 changes: 2 additions & 1 deletion crates/coresimd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
avx512_target_feature,
mips_target_feature,
powerpc_target_feature,
wasm_target_feature
wasm_target_feature,
abi_unadjusted
)]
// NB: When running nvptx/nvptx64 cross tests, enabling "integer_atomics" yields
// a compile-time error: 'unknown feature `integer_atomics`'. This ought to be
Expand Down