]>
git.proxmox.com Git - rustc.git/blob - library/stdarch/crates/core_arch/src/x86/eflags.rs
5 /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=__readeflags)
6 #[cfg(target_arch = "x86")]
8 #[stable(feature = "simd_x86", since = "1.27.0")]
11 reason
= "See issue #51810 - use inline assembly instead"
14 pub unsafe fn __readeflags() -> u32 {
16 asm
!("pushfd", "pop {}", out(reg
) eflags
, options(nomem
, att_syntax
));
22 /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=__readeflags)
23 #[cfg(target_arch = "x86_64")]
25 #[stable(feature = "simd_x86", since = "1.27.0")]
28 reason
= "See issue #51810 - use inline assembly instead"
31 pub unsafe fn __readeflags() -> u64 {
33 asm
!("pushfq", "pop {}", out(reg
) eflags
, options(nomem
, att_syntax
));
39 /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=__writeeflags)
40 #[cfg(target_arch = "x86")]
42 #[stable(feature = "simd_x86", since = "1.27.0")]
45 reason
= "See issue #51810 - use inline assembly instead"
48 pub unsafe fn __writeeflags(eflags
: u32) {
49 asm
!("push {}", "popfd", in(reg
) eflags
, options(nomem
, att_syntax
));
54 /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=__writeeflags)
55 #[cfg(target_arch = "x86_64")]
57 #[stable(feature = "simd_x86", since = "1.27.0")]
60 reason
= "See issue #51810 - use inline assembly instead"
63 pub unsafe fn __writeeflags(eflags
: u64) {
64 asm
!("push {}", "popfq", in(reg
) eflags
, options(nomem
, att_syntax
));
69 use crate::core_arch
::x86
::*;
75 // reads eflags, writes them back, reads them again,
76 // and compare for equality:
77 let v
= __readeflags();
79 let u
= __readeflags();