Only compile outlined-atomics intrinsics on linux
This commit is contained in:
parent
9234bedeea
commit
c4e9f479ad
3 changed files with 10 additions and 6 deletions
|
|
@ -58,8 +58,8 @@ pub mod mem;
|
|||
#[cfg(target_arch = "arm")]
|
||||
pub mod arm;
|
||||
|
||||
#[cfg(all(target_arch = "aarch64", not(feature = "no-asm"),))]
|
||||
pub mod aarch64;
|
||||
#[cfg(all(target_arch = "aarch64", target_os = "linux", not(feature = "no-asm"),))]
|
||||
pub mod aarch64_linux;
|
||||
|
||||
#[cfg(all(
|
||||
kernel_user_helpers,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ mod cas {
|
|||
testcrate::fuzz_2(10000, |expected: super::int_ty!($bytes), new| {
|
||||
let mut target = expected.wrapping_add(10);
|
||||
assert_eq!(
|
||||
unsafe { compiler_builtins::aarch64::$name::$name(expected, new, &mut target) },
|
||||
unsafe {
|
||||
compiler_builtins::aarch64_linux::$name::$name(expected, new, &mut target)
|
||||
},
|
||||
expected.wrapping_add(10),
|
||||
"return value should always be the previous value",
|
||||
);
|
||||
|
|
@ -29,7 +31,9 @@ mod cas {
|
|||
|
||||
target = expected;
|
||||
assert_eq!(
|
||||
unsafe { compiler_builtins::aarch64::$name::$name(expected, new, &mut target) },
|
||||
unsafe {
|
||||
compiler_builtins::aarch64_linux::$name::$name(expected, new, &mut target)
|
||||
},
|
||||
expected
|
||||
);
|
||||
assert_eq!(target, new, "should have updated target");
|
||||
|
|
@ -49,7 +53,7 @@ mod swap {
|
|||
testcrate::fuzz_2(10000, |left: super::int_ty!($bytes), mut right| {
|
||||
let orig_right = right;
|
||||
assert_eq!(
|
||||
unsafe { compiler_builtins::aarch64::$name::$name(left, &mut right) },
|
||||
unsafe { compiler_builtins::aarch64_linux::$name::$name(left, &mut right) },
|
||||
orig_right
|
||||
);
|
||||
assert_eq!(left, right);
|
||||
|
|
@ -69,7 +73,7 @@ macro_rules! test_op {
|
|||
let mut target = old;
|
||||
let op: fn(super::int_ty!($bytes), super::int_ty!($bytes)) -> _ = $($op)*;
|
||||
let expected = op(old, val);
|
||||
assert_eq!(old, unsafe { compiler_builtins::aarch64::$name::$name(val, &mut target) }, "{} should return original value", stringify!($name));
|
||||
assert_eq!(old, unsafe { compiler_builtins::aarch64_linux::$name::$name(val, &mut target) }, "{} should return original value", stringify!($name));
|
||||
assert_eq!(expected, target, "{} should store to target", stringify!($name));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue