core/stdarch/crates/core_arch/src/x86_64/
movrs.rs1#[cfg(test)]
4use stdarch_test::assert_instr;
5
6unsafe extern "unadjusted" {
7 #[link_name = "llvm.x86.movrsqi"]
8 fn movrsqi(src: *const i8) -> i8;
9 #[link_name = "llvm.x86.movrshi"]
10 fn movrshi(src: *const i16) -> i16;
11 #[link_name = "llvm.x86.movrssi"]
12 fn movrssi(src: *const i32) -> i32;
13 #[link_name = "llvm.x86.movrsdi"]
14 fn movrsdi(src: *const i64) -> i64;
15}
16
17#[inline]
21#[target_feature(enable = "movrs")]
22#[cfg_attr(all(test, not(target_vendor = "apple")), assert_instr(movrs))]
23#[unstable(feature = "movrs_target_feature", issue = "137976")]
24pub unsafe fn _movrs_i8(src: *const i8) -> i8 {
25 movrsqi(src)
26}
27
28#[inline]
32#[target_feature(enable = "movrs")]
33#[cfg_attr(all(test, not(target_vendor = "apple")), assert_instr(movrs))]
34#[unstable(feature = "movrs_target_feature", issue = "137976")]
35pub unsafe fn _movrs_i16(src: *const i16) -> i16 {
36 movrshi(src)
37}
38
39#[inline]
43#[target_feature(enable = "movrs")]
44#[cfg_attr(all(test, not(target_vendor = "apple")), assert_instr(movrs))]
45#[unstable(feature = "movrs_target_feature", issue = "137976")]
46pub unsafe fn _movrs_i32(src: *const i32) -> i32 {
47 movrssi(src)
48}
49
50#[inline]
54#[target_feature(enable = "movrs")]
55#[cfg_attr(all(test, not(target_vendor = "apple")), assert_instr(movrs))]
56#[unstable(feature = "movrs_target_feature", issue = "137976")]
57pub unsafe fn _movrs_i64(src: *const i64) -> i64 {
58 movrsdi(src)
59}
60
61#[cfg(test)]
62mod tests {
63 use stdarch_test::simd_test;
64
65 use super::*;
66
67 #[simd_test(enable = "movrs")]
68 fn test_movrs_i8() {
69 let x: i8 = 42;
70 let y = unsafe { _movrs_i8(&x) };
71 assert_eq!(x, y);
72 }
73
74 #[simd_test(enable = "movrs")]
75 fn test_movrs_i16() {
76 let x: i16 = 42;
77 let y = unsafe { _movrs_i16(&x) };
78 assert_eq!(x, y);
79 }
80
81 #[simd_test(enable = "movrs")]
82 fn test_movrs_i32() {
83 let x: i32 = 42;
84 let y = unsafe { _movrs_i32(&x) };
85 assert_eq!(x, y);
86 }
87
88 #[simd_test(enable = "movrs")]
89 fn test_movrs_i64() {
90 let x: i64 = 42;
91 let y = unsafe { _movrs_i64(&x) };
92 assert_eq!(x, y);
93 }
94}