Skip to content
Merged
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
9 changes: 9 additions & 0 deletions coresimd/x86/eflags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#[cfg(target_arch = "x86")]
#[inline(always)]
#[stable(feature = "simd_x86", since = "1.27.0")]
#[rustc_deprecated(since = "1.29.0", reason = "See issue #51810 - use inline assembly instead")]
#[doc(hidden)]
pub unsafe fn __readeflags() -> u32 {
let eflags: u32;
asm!("pushfd; popl $0" : "=r"(eflags) : : : "volatile");
Expand All @@ -18,6 +20,8 @@ pub unsafe fn __readeflags() -> u32 {
#[cfg(target_arch = "x86_64")]
#[inline(always)]
#[stable(feature = "simd_x86", since = "1.27.0")]
#[rustc_deprecated(since = "1.29.0", reason = "See issue #51810 - use inline assembly instead")]
#[doc(hidden)]
pub unsafe fn __readeflags() -> u64 {
let eflags: u64;
asm!("pushfq; popq $0" : "=r"(eflags) : : : "volatile");
Expand All @@ -30,6 +34,8 @@ pub unsafe fn __readeflags() -> u64 {
#[cfg(target_arch = "x86")]
#[inline(always)]
#[stable(feature = "simd_x86", since = "1.27.0")]
#[rustc_deprecated(since = "1.29.0", reason = "See issue #51810 - use inline assembly instead")]
#[doc(hidden)]
pub unsafe fn __writeeflags(eflags: u32) {
asm!("pushl $0; popfd" : : "r"(eflags) : "cc", "flags" : "volatile");
}
Expand All @@ -40,6 +46,8 @@ pub unsafe fn __writeeflags(eflags: u32) {
#[cfg(target_arch = "x86_64")]
#[inline(always)]
#[stable(feature = "simd_x86", since = "1.27.0")]
#[rustc_deprecated(since = "1.29.0", reason = "See issue #51810 - use inline assembly instead")]
#[doc(hidden)]
pub unsafe fn __writeeflags(eflags: u64) {
asm!("pushq $0; popfq" : : "r"(eflags) : "cc", "flags" : "volatile");
}
Expand All @@ -49,6 +57,7 @@ mod tests {
use coresimd::x86::*;

#[test]
#[allow(deprecated)]
fn test_eflags() {
unsafe {
// reads eflags, writes them back, reads them again,
Expand Down