core\stdarch\crates\core_arch\src\aarch64/
rand.rs1#[cfg(test)]
6use stdarch_test::assert_instr;
7
8unsafe extern "unadjusted" {
9 #[link_name = "llvm.aarch64.rndr"]
10 fn rndr_() -> Tuple;
11
12 #[link_name = "llvm.aarch64.rndrrs"]
13 fn rndrrs_() -> Tuple;
14}
15
16#[repr(C)]
17struct Tuple {
18 bits: u64,
19 status: bool,
20}
21
22#[inline]
27#[target_feature(enable = "rand")]
28#[cfg_attr(test, assert_instr(mrs))]
29#[unstable(feature = "stdarch_aarch64_rand", issue = "153514")]
30pub unsafe fn __rndr(value: *mut u64) -> i32 {
31 let Tuple { bits, status } = rndr_();
32 unsafe { *value = bits };
33 status as i32
34}
35
36#[inline]
41#[target_feature(enable = "rand")]
42#[cfg_attr(test, assert_instr(mrs))]
43#[unstable(feature = "stdarch_aarch64_rand", issue = "153514")]
44pub unsafe fn __rndrrs(value: *mut u64) -> i32 {
45 let Tuple { bits, status } = rndrrs_();
46 unsafe { *value = bits };
47 status as i32
48}